Control Flow Nodes
Nodes for branching, looping, and controlling flow execution.
Available Nodes
If (Conditional)
Branch based on a condition.
Configuration:
condition- Expression that evaluates to true/false
Outputs:
truebranch - Executed when condition is truefalsebranch - Executed when condition is false
Example Conditions:
// Simple comparison
{{orderTotal}} > 100
// String check
{{status}} === "active"
// Multiple conditions
{{user.role}} === "admin" && {{user.verified}}
// Array check
{{items.length}} > 0Use Case: Route flow based on data conditions.
Switch
Multi-way branching based on a value.
Configuration:
value- Expression to evaluatecases- Map of values to branch names
Example:
{
"value": "{{orderStatus}}",
"cases": {
"pending": "handlePending",
"processing": "handleProcessing",
"shipped": "handleShipped",
"delivered": "handleDelivered"
},
"default": "handleUnknown"
}Use Case: Handle multiple distinct cases (status codes, categories, etc.).
Loop
Iterate over an array of items.
Configuration:
items- Array to iterate overitemVariable- Name for current item (default:item)indexVariable- Name for current index (default:index)
Example:
{
"items": "{{orders}}",
"itemVariable": "order",
"indexVariable": "i"
}Inside the loop, access:
{{order.id}}- Current item{{i}}- Current index (0, 1, 2...)
Use Case: Process each item in a list (send emails to users, update records).
Merge
Combine multiple branches back into one.
Configuration:
strategy- How to merge (wait for all, first complete)
Example:
┌── Branch A ──┐
Start ─┤ ├── Merge ── Continue
└── Branch B ──┘Use Case: Rejoin parallel branches, aggregate results.
Wait
Pause execution for a specified duration.
Configuration:
duration- Time to waitunit- seconds, minutes, hours, days
Example:
{
"duration": 5,
"unit": "minutes"
}Use Case: Rate limiting, scheduled delays, retry backoff.
Complex Flow Patterns
Parallel Execution
┌── Send Email ──┐
Start ─┼── Send SMS ──┼── Merge ── Done
└── Update DB ──┘Retry Pattern
Try Action → If Failed → Wait → Loop Back to Try
↓
Success → ContinueFan-Out / Fan-In
Fetch List → Loop ──→ Process Each ──→ Merge Results
↑ ↓
└───────────────────┘Next: Actions →