Skip to main content

Conditional

The Conditional node introduces if-else branching into your workflow. It evaluates a single condition and routes the workflow down either the TRUE branch or the FALSE branch. This enables dynamic workflows that adapt their behavior based on data from previous steps.

Before You Use This Node

What you may needWhere to set it upWhy it matters
Thresholds, approval limits, or status namesGlobal VariablesChange the rule value once instead of editing every conditional step.

Actions

ActionDescription
conditional:ifElseEvaluate a condition and branch the workflow

conditional:ifElse

Evaluates a single JavaScript condition and routes the workflow to the TRUE or FALSE branch.

Parameters

ParameterTypeRequiredDescription
conditionstringYesA single condition expression, at conditionalDetails.condition, evaluated to a boolean

The result of the evaluation is reported as routedTo (TRUE or FALSE) and determines which downstream branch runs.

Writing the Condition

The condition is a single expression. It is accepted in three forms:

  1. Bare JavaScript — a raw expression such as amount > 1000. It is automatically wrapped in {{ }} and evaluated.
  2. A single full placeholder — an expression already wrapped, such as {{ $('fetchOrder').result.status === 'approved' }}. It is used as-is.
  3. Mixed inline placeholders with literal text — for example {{ order.region }} === 'EMEA'. Each placeholder is resolved and the whole expression is wrapped and evaluated.

Because the condition is JavaScript, use JavaScript operators (===, !==, >, <, &&, ||, .includes(), etc.) rather than a fixed operator vocabulary. Combine multiple checks with && and || inside the single expression.

How the Result Becomes TRUE or FALSE

The evaluated value is coerced to a boolean with these rules:

Evaluated valueResult
BooleanUsed directly
Number0 is FALSE; any other number is TRUE
String"true" (case-insensitive) is TRUE; anything else is FALSE
null / undefinedFALSE

If the expression throws or cannot be evaluated, the result is treated as FALSE and the step still completes — it does not fail the workflow.

How Branching Works in the DAG

The Conditional node creates two distinct output paths in the workflow's directed acyclic graph (DAG): the TRUE branch and the FALSE branch.

  • In the Canvas editor, the Conditional node displays two output connectors. You connect downstream steps to either the TRUE output or the FALSE output.
  • When the condition evaluates to TRUE (routedTo: TRUE), only the steps connected via the TRUE path execute. Steps on the FALSE path are skipped entirely.
  • When the condition evaluates to FALSE (routedTo: FALSE), only the steps connected via the FALSE path execute. Steps on the TRUE path are skipped entirely.
  • Steps that are not connected to either branch of the Conditional node are unaffected. They execute based on their own position in the DAG, independent of this conditional evaluation.

Both branches eventually rejoin the main workflow at whatever step comes after the branching section. You do not need to explicitly "merge" the branches.

Combining with Boolean Nodes

For a simple check, put the comparison directly in the condition expression. For more complex logic involving multiple values or multi-step computations, consider using a Boolean node upstream:

  1. Add a Boolean node earlier in the workflow that computes a true/false result from complex logic. For example, a Boolean node might evaluate whether isHighPriority AND isNewCustomer and output a single boolean value.
  2. In the Conditional node, reference the Boolean node's output directly in the condition, for example {{ $('checkPriority').result }}.

This pattern keeps your Conditional expressions short and readable, while the Boolean node handles the heavy logic.

Nested Conditions

You can chain multiple Conditional nodes to create complex, multi-level branching:

  • The first Conditional checks a high-level criterion (e.g., {{ order.region }} === 'EMEA').
  • On the TRUE branch, a second Conditional checks a more specific criterion (e.g., order.amount > 10000).
  • Each level can have its own TRUE and FALSE branches with different steps.

Recommendation: Keep nesting shallow, ideally no more than 2-3 levels deep. Deeply nested conditionals become difficult to read, debug, and maintain. If you find yourself nesting beyond 3 levels, consider restructuring the logic using Boolean nodes to pre-compute combined conditions, or splitting the workflow into sub-jobs via the Call node.

Connection

No connection required. This is a control flow node.

Output

The Conditional node reports which branch was taken via the routedTo field (TRUE or FALSE) and routes execution accordingly. It does not produce data output of its own; the workflow continues from whichever branch was followed.