Conditional steps branch Flow execution based on conditions, letting you build if/else logic and route data through different paths. To gate a single step instead of branching, give that step a when condition — see Conditionally skipping a single step (when).
Conditions use JavaScript expressions. Reference variables with {{variable}} syntax:
Supported operators:
==, !=, <, >, <=, >= — Comparison&&, || — Logical AND/OR! — NegationIf true: Use AI response. Else: Route to human review.
If true: Priority support Flow. Else: Standard support Flow.
If true: Error handling. Else: Process response.
If true: Require approval. Else: Auto-approve.
Use quotes for string values:
Test if a value exists:
Add conditional steps inside if/else branches for complex logic:
Conditional steps can be nested up to 10 levels deep. Flows that exceed this limit fail validation. Real-world flows rarely need more than 3 or 4 levels. If you are approaching the limit, use a transform-data step to consolidate the branching logic into a single boolean expression, then reference that in one conditional.
Use a conditional branch to guard against invalid requests. Place the main processing logic in the “else” branch so the Flow skips it when validation fails:
Keep conditions simple. If you need complex logic, use a transform-data step to calculate a boolean, then reference that in the conditional.
Steps inside conditional branches set their outputVariable in the same Flow-level scope. Reference them by their outputVariable name in later steps:
Run your Flow with inputs that trigger both branches:
Any step can carry an optional when condition that gates just that one step. When the condition is falsy, the step is skipped and the Flow continues — you don’t need to wrap the step in a Conditional to do this.
This is useful when one step should only run in certain cases, such as a retry that runs only after a failure, or an enrichment step that runs only when data is present.
By default, every step shows an Always runs pill. Set a condition to make the step run only when that condition is true:
Once a condition is set, the pill changes to Runs conditionally with an amber accent, and the step gets an amber left border so you can spot gated steps at a glance. Consecutive steps that share the same condition are grouped together under a single amber border.
When the Flow runs and a step’s when condition evaluates to a falsy value, that step is skipped:
outputVariable is set to null, so later steps that reference it see null rather than stale dataConditions use the same {{variable}} syntax as Conditional steps. For example:
This step runs only when needs_retry is true; otherwise it is skipped.
If a when condition throws an error — for example, because of a typo or a missing variable — the step is skipped by default rather than failing the whole Flow. This keeps a single bad expression from halting execution.
If you want a broken condition to stop the Flow instead, set the step’s error handling to fail on error.
Use when to skip a single step. Use a Conditional step when you need separate true and false branches.