improvement(trigger-subflow): reuse helper code#1885
Merged
icecrasher321 merged 1 commit intostagingfrom Nov 11, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile OverviewGreptile SummaryRefactored duplicate subflow validation logic by extracting it into a reusable Key changes:
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant CollaborativeHook as use-collaborative-workflow
participant WorkflowStore as workflow/store
participant TriggerUtils as TriggerUtils.isBlockInSubflow()
participant Blocks as blocks Record
User->>CollaborativeHook: Toggle trigger mode
CollaborativeHook->>TriggerUtils: isBlockInSubflow(id, blocks)
TriggerUtils->>Blocks: Find block by id
Blocks-->>TriggerUtils: block
TriggerUtils->>Blocks: Find parent by parentId
Blocks-->>TriggerUtils: parent
TriggerUtils->>TriggerUtils: Check parent.type === 'loop' || 'parallel'
TriggerUtils-->>CollaborativeHook: isInSubflow result
alt Block is in subflow
CollaborativeHook->>User: Dispatch warning event
else Block not in subflow
CollaborativeHook->>WorkflowStore: Execute toggle operation
end
User->>WorkflowStore: Toggle trigger mode (direct)
WorkflowStore->>TriggerUtils: isBlockInSubflow(id, blocks)
TriggerUtils->>Blocks: Find block by id
Blocks-->>TriggerUtils: block
TriggerUtils->>Blocks: Find parent by parentId
Blocks-->>TriggerUtils: parent
TriggerUtils->>TriggerUtils: Check parent.type === 'loop' || 'parallel'
TriggerUtils-->>WorkflowStore: isInSubflow result
alt Block is in subflow
WorkflowStore->>WorkflowStore: Log warning & return early
else Block not in subflow
WorkflowStore->>WorkflowStore: Toggle trigger mode & remove edges
end
|
waleedlatif1
pushed a commit
that referenced
this pull request
Nov 12, 2025
waleedlatif1
pushed a commit
that referenced
this pull request
Nov 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reuse trigger utils func to check if trigger is in subflow.
Type of Change
Testing
Tested manually
Checklist