Search documentation

Search for pages in the documentation

Control Flow

Nodes that control execution flow and data routing

Control flow nodes manage how data moves through your workflow. They enable conditional logic, data merging, iteration, delays, and graceful termination.

Available Control Nodes

NodeDescriptionUse Case
IfConditional branchingRoute based on conditions
ZipMerge multiple streamsCombine parallel data
BroadcastAttach shared dataAdd context to items
Select ManyFlatten arraysIterate over items
WaitPause executionDelays and scheduling
SinkTerminate branchEnd without action

Control Flow Concepts

Execution Order

Workflows execute based on data readiness:

  1. Trigger fires, outputs data
  2. Downstream nodes become ready when all inputs have data
  3. Ready nodes execute (potentially in parallel)
  4. Process continues until all branches complete
text
         [Trigger]
         ↓       ↓
     [Node A] [Node B]   ← A and B run in parallel
         ↓       ↓
     [Node C] [Node D]   ← C waits for A; D waits for B
         ↓       ↓
       [End]   [End]

Branching with If

The If node creates two paths based on a condition:

text
[If: x > 5]
├─ True ──→ [Path A]
└─ False ─→ [Path B]

Only one path executes per item. The other branch is not executed.

Merging Streams

Use Zip or Broadcast to combine data from multiple sources:

text
[Source A] ──┐
             ├──→ [Zip] → [Combined Data]
[Source B] ──┘

Iteration with Select Many

Expand arrays into individual items for processing:

text
    [Load Data]             [Process Each]
         ↓                        ↓
{items: [a,b,c]}            Item: a
         ↓                  Item: b
[Select Many: items] ──→    Item: c

Termination with Sink

End a branch without taking action:

text
[If: important?]
├─ Yes ──→ [Send Alert]
└─ No ───→ [Sink]  ← Branch ends cleanly

Common Patterns

Pattern: Conditional Action

Route to different actions based on data:

text
[AI: Classify urgency]
         ↓
    [If: urgent?]
    ├─ Yes ──→ [SMS + Slack]
    └─ No ───→ [Email only]

Pattern: Parallel Then Merge

Process data in parallel, then combine:

text
              ┌─→ [AI: Summarize] ─────┐
[Load Data] ──┤                        ├─→ [Zip] → [Send Combined]
              └─→ [AI: Extract Items] ─┘

Pattern: Iterate and Process

Process each item in an array:

text
       [Load Meeting]
             ↓
[Select Many: attendees]  ← Expands to individual attendees
             ↓
       [Email Send]       ← Sends one email per attendee

Pattern: Add Context to Items

Attach shared data to each item:

text
[Shared Context] ─┐
                  ├─→ [Broadcast] → [Items with Context]
[Item Stream] ────┘

Pattern: Delayed Follow-up

Wait before taking action:

text
[Meeting Ended] → [Wait: 2 days] → [Send Follow-up]

Pattern: Graceful Error Handling

End error branches without action:

text
[API Call]
├─ Success ─→ [Process Result]
└─ Error ───→ [Log Error] → [Sink]

Node Characteristics

Input/Output Summary

NodeInputsSuccess OutputsError OutputsMode
If12 (true/false)0Per-item
Zip (2)210Batch
Zip (3)310Batch
Zip (4)410Batch
Broadcast210Batch
Select Many110Per-item
Wait110Per-item
Sink100Per-item

Batch vs Per-Item

Per-item nodes (If, Select Many, Wait, Sink):

  • Process each input item individually
  • 5 items in = 5 executions

Batch nodes (Zip, Broadcast):

  • Process all items together
  • 5 items in = 1 execution with all items

Best Practices

1. Always Terminate Branches

Every branch should end at either:

  • An action node (Slack, Email, etc.)
  • A Sink node (explicit termination)

Unterminated branches can cause unexpected behavior.

2. Handle Both If Paths

Don't leave If branches unconnected:

Good:

text
[If]
├─ Yes ─→ [Action]
└─ No ──→ [Sink]

Bad:

text
[If]
├─ Yes ─→ [Action]
└─ No ──→ (nothing)  ← Don't do this

3. Use Appropriate Merge Type

NeedUse
Combine parallel resultsZip
Add context to each itemBroadcast
Both streams are itemsZip
One stream is context, one is itemsBroadcast

4. Consider Data Timing

Merge nodes wait for ALL inputs:

  • If one source is slow, the merge waits
  • If one source fails, the merge may not complete

5. Use Select Many for Iteration

Don't try to process arrays directly—expand them:

Good:

text
[Load] → [Select Many] → [Email Send]

Bad:

text
[Load] → [Email Send]  ← Can't iterate over array

Debugging Control Flow

Visualize the Path

When debugging, trace which path data takes:

  1. Check If node conditions
  2. Verify Select Many is expanding correctly
  3. Confirm Zip/Broadcast receive all inputs

Check Execution Status

In execution logs:

  • See which branches executed
  • Identify nodes that didn't run
  • Check input/output at each step

Common Issues

IssueCauseSolution
Branch not executingCondition never trueCheck If expression
Merge stuckOne input never arrivesCheck upstream sources
Too many outputsSelect Many created many itemsVerify array size
Missing contextBroadcast not configuredCheck left/right labels

Next Steps