Logic & Decision Nodes
Logic nodes control execution flow — branching, looping, error handling, and flow interruption. They render as diamonds on the canvas to indicate their routing role. These nodes do not transform data; they route it.
Logic Node Reference
if-condition
Evaluates a JavaScript expression and routes to the true or false output port. Classic binary branch.
| Field | Description |
|---|---|
| Condition | JavaScript expression (e.g., $json.status === 'approved') |
Output ports: true (green), false (grey)
switch
Evaluates a value and routes to the matching case port. Equivalent to a code switch statement.
| Field | Description |
|---|---|
| Value Expression | Expression that produces the value to match against (e.g., $json.category) |
| Cases | List of {value, label} pairs — each creates one output port |
| Default Port | Optional — catches values that match no case |
filter
Evaluates a condition against the input. If true, passes data to the match port; otherwise to the no-match port. Similar to if-condition but semantically used for data filtering rather than branching.
loop
Iterates over an array, executing the loop body once per item. The current item is available as $input.item and the index as $input.index.
| Field | Description |
|---|---|
| Array Expression | Expression that evaluates to the array to iterate (e.g., $json.items) |
| Max Iterations | Safety limit to prevent infinite loops (default: 1000) |
| Batch Size | Optional: process N items at a time instead of one |
Output ports: body (executed each iteration), done (executed after all iterations complete), error
break
Exits the current loop immediately. Used inside a loop body. Routes to the loop's done port without completing remaining iterations.
continue
Skips to the next iteration of the current loop. Used inside a loop body to bypass downstream nodes for the current item.
try-catch
Wraps a section of the workflow in error handling. Nodes inside the try block route to catch if they throw an unhandled error.
| Field | Description |
|---|---|
| Error Variable | Name of the variable where the caught error is stored (default: error). Accessible in catch block as $var.error |
Output ports: try (normal flow), catch (error occurred), finally (always runs after try or catch)