Conditional Edges
Any edge can carry a routing condition — a JavaScript expression evaluated at execution time. If the condition evaluates to false (or throws), the edge is skipped and execution continues on other edges from the same port.
What a Condition Does
An edge condition is a JavaScript expression evaluated against the execution context at the moment the source node completes. The edge is followed only if the expression evaluates to a truthy value.
// Example conditions:
$output.httpRequest1.body.status === 'active'
$json.amount > 1000 && $json.currency === 'USD'
$var.retryCount < 3
Array.isArray($output.dbQuery1.rows) && $output.dbQuery1.rows.length > 0
Adding a Condition via EdgeEditModal
Select the Edge
Click the edge line to select it. A pencil icon appears at the midpoint.
Open the EdgeEditModal
Click the pencil icon, or double-click the edge, or right-click → Edit Condition.
Enter the Condition
Type a JavaScript expression in the Condition field. The editor provides autocomplete for $json, $output, $var, and $global.
Optionally Set a Label and Priority
Add a human-readable label (shown on the canvas) and a priority number (1 = evaluated first) if this port has multiple edges.
Priority and Multiple Conditions
When a node's output port has multiple edges, each edge's condition is evaluated in priority order (ascending: 1 first). The first edge whose condition is truthy is followed. Edges with no condition always evaluate to true.
true as an explicit default.
Condition Context Variables
| Variable | Contains |
|---|---|
$json | The trigger node's initial data |
$output.{nodeId} | Output of any previously executed node |
$var.{name} | Workflow variables set by variable-assignment nodes |
$global.{key} | Tenant-level constants configured in platform settings |
$context.executionId | Current execution ID |
$context.triggeredBy | User ID who started the workflow |