Skip to main content
Execution flow commands control which commands run inside a step. They are available in every step type. They share CommandType EXECUTION_FLOW; ids are scoped by that type: If-Else is 1100, For is 1101.

Available Commands

If-Else

Run trueCommands or falseCommands depending on a condition (ID 1100)

For

Run a PARSE body, optionally ending in one sink, once per element of a JSON array (ID 1101)

Common Use Cases

  • Conditional Parsing: Parse a response differently depending on its shape
  • Guarded Delivery: Send to a sink only when a field has an expected value
  • Early Close: Close a WebSocket connection only when a stopping condition is met
  • Per-element Processing: Transform or deliver each element of an array without creating child Items

Conditional Execution

See If-Else for operand types, operations and AND / OR conditions.

Iteration

For expects the previous output data to be a bare JSON array. Envelopes such as { "events": [...] } and HTTP parallel { "data": { "aggregatedResults": [...] } } need a PARSE extract onto data first. Each iteration runs the nested body sequentially. The body holds PARSE commands (not Sleep 1008) and at most one sink, which must be last. HTTP, If-Else, and nested For are not allowed inside the body. The output is { "data": { "aggregatedResults": [...] } }; For does not create Items or set children.
See For for locals (item, index, parent), the 1000-element cap, how failed elements appear in aggregatedResults, and timings.
An If-Else cannot contain another If-Else in trueCommands or falseCommands, and a For body cannot contain If-Else or another For; such projects are rejected on save. Combine conditions with a complex AND / OR condition instead. To run the next step once per element, write the list to children instead of using For.

Best Practices

  • Keep branches short: Put shared commands before or after the If-Else rather than duplicating them in both branches
  • Set a timeout: timeout is required on If-Else and cannot exceed the step’s interval
  • Test both branches: Use the step test panel with inputs that hit each branch
  • Extract before For: Put the array on data with a PARSE command first