Control Flow
If / Else and Switch Nodes Reference
Technical reference for `ifElse` and `switch`, including condition operators, branch handle behavior, and routing rules.
Updated 2 min read
Overview
ifElse and switch are branch routers:
ifElsesplits a collection intotrueandfalsebranches.switchevaluates ordered cases and activates the first matching case handle, ordefault.
Configuration / Settings
| Node | Setting | Details |
|---|---|---|
ifElse | variable, operator, value | Supports file-specific checks such as fileSize and fileName, plus nested object paths like customer.total. |
switch | variable, caseCount, cases[].conditions[], logicOperator | Cases support AND/OR compound logic and operators such as equals, greater-than, contains, regex, empty, and not-empty. |
Inputs Expected
ifElseaccepts single items or arrays. Arrays are evaluated item by item.switchevaluates a single resolved variable string and routes the original input forward on one handle.
Variables Exported / Outputs
| Node | Output shape | Branch behavior |
|---|---|---|
ifElse | original input array | Branch-specific arrays are sent through the true and false handles via metadata. |
switch | original input | The executor records matchedCase metadata and activates one handle only. |
Important implementation detail:
- Branch-routing data such as
selectedHandlesandhandleOutputslives in executor metadata and is consumed by the engine, not by{{node_id.field}}expressions.
Common Use Cases
- Route PDFs larger than a threshold to compression while small files skip it.
- Send different document types to different conversion branches.
- Split rows by status or approval result before emailing or archiving.
Edge Cases
ifElsereturns both handles when there is no data, but with empty arrays.switchstops on the first matching case, so case order matters.- Regex operators fail closed if the pattern is invalid.