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
| Node | Description | Use Case |
|---|---|---|
| If | Conditional branching | Route based on conditions |
| Zip | Merge multiple streams | Combine parallel data |
| Broadcast | Attach shared data | Add context to items |
| Select Many | Flatten arrays | Iterate over items |
| Wait | Pause execution | Delays and scheduling |
| Sink | Terminate branch | End without action |
Control Flow Concepts
Execution Order
Workflows execute based on data readiness:
- Trigger fires, outputs data
- Downstream nodes become ready when all inputs have data
- Ready nodes execute (potentially in parallel)
- Process continues until all branches complete
[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:
[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:
[Source A] ──┐
├──→ [Zip] → [Combined Data]
[Source B] ──┘
Iteration with Select Many
Expand arrays into individual items for processing:
[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:
[If: important?]
├─ Yes ──→ [Send Alert]
└─ No ───→ [Sink] ← Branch ends cleanly
Common Patterns
Pattern: Conditional Action
Route to different actions based on data:
[AI: Classify urgency]
↓
[If: urgent?]
├─ Yes ──→ [SMS + Slack]
└─ No ───→ [Email only]
Pattern: Parallel Then Merge
Process data in parallel, then combine:
┌─→ [AI: Summarize] ─────┐
[Load Data] ──┤ ├─→ [Zip] → [Send Combined]
└─→ [AI: Extract Items] ─┘
Pattern: Iterate and Process
Process each item in an array:
[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:
[Shared Context] ─┐
├─→ [Broadcast] → [Items with Context]
[Item Stream] ────┘
Pattern: Delayed Follow-up
Wait before taking action:
[Meeting Ended] → [Wait: 2 days] → [Send Follow-up]
Pattern: Graceful Error Handling
End error branches without action:
[API Call]
├─ Success ─→ [Process Result]
└─ Error ───→ [Log Error] → [Sink]
Node Characteristics
Input/Output Summary
| Node | Inputs | Success Outputs | Error Outputs | Mode |
|---|---|---|---|---|
| If | 1 | 2 (true/false) | 0 | Per-item |
| Zip (2) | 2 | 1 | 0 | Batch |
| Zip (3) | 3 | 1 | 0 | Batch |
| Zip (4) | 4 | 1 | 0 | Batch |
| Broadcast | 2 | 1 | 0 | Batch |
| Select Many | 1 | 1 | 0 | Per-item |
| Wait | 1 | 1 | 0 | Per-item |
| Sink | 1 | 0 | 0 | Per-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:
[If]
├─ Yes ─→ [Action]
└─ No ──→ [Sink]
❌ Bad:
[If]
├─ Yes ─→ [Action]
└─ No ──→ (nothing) ← Don't do this
3. Use Appropriate Merge Type
| Need | Use |
|---|---|
| Combine parallel results | Zip |
| Add context to each item | Broadcast |
| Both streams are items | Zip |
| One stream is context, one is items | Broadcast |
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:
[Load] → [Select Many] → [Email Send]
❌ Bad:
[Load] → [Email Send] ← Can't iterate over array
Debugging Control Flow
Visualize the Path
When debugging, trace which path data takes:
- Check If node conditions
- Verify Select Many is expanding correctly
- 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
| Issue | Cause | Solution |
|---|---|---|
| Branch not executing | Condition never true | Check If expression |
| Merge stuck | One input never arrives | Check upstream sources |
| Too many outputs | Select Many created many items | Verify array size |
| Missing context | Broadcast not configured | Check left/right labels |