Flows
Node Types
Control Flow

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:

  • true branch - Executed when condition is true
  • false branch - 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}} > 0

Use Case: Route flow based on data conditions.


Switch

Multi-way branching based on a value.

Configuration:

  • value - Expression to evaluate
  • cases - 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 over
  • itemVariable - 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 wait
  • unit - 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 → Continue

Fan-Out / Fan-In

Fetch List → Loop ──→ Process Each ──→ Merge Results
                ↑                   ↓
                └───────────────────┘

Next: Actions →