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 need | Where to set it up | Why it matters |
|---|---|---|
| Thresholds, approval limits, or status names | Global Variables | Change the rule value once instead of editing every conditional step. |
Actions
| Action | Description |
|---|---|
conditional:ifElse | Evaluate a condition and branch the workflow |
conditional:ifElse
Evaluates a single JavaScript condition and routes the workflow to the TRUE or FALSE branch.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
condition | string | Yes | A 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:
- Bare JavaScript — a raw expression such as
amount > 1000. It is automatically wrapped in{{ }}and evaluated. - A single full placeholder — an expression already wrapped, such as
{{ $('fetchOrder').result.status === 'approved' }}. It is used as-is. - 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 value | Result |
|---|---|
| Boolean | Used directly |
| Number | 0 is FALSE; any other number is TRUE |
| String | "true" (case-insensitive) is TRUE; anything else is FALSE |
null / undefined | FALSE |
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:
- 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 isNewCustomerand output a single boolean value. - 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.