Nodes
Switch
Branches on the first matching case, with a Default for the rest.
The Switch node tests a list of cases in order and follows the first one that holds. When none does, it takes the always-present Default port.
When to use it
- Route by category: product type, customer segment, country group.
- Replace a chain of nested conditions with one readable node.
How it works
- Cases are evaluated top to bottom, each one a boolean expression.
- The first truthy case wins and its port is taken. The rest are not evaluated.
- If no case holds, the run takes Default.
Ports
| Port | Taken when |
|---|---|
| One port per case | That case was the first to hold. The port is named after the case label. |
Default | No case held. Always present and cannot be removed. |
Configuration
| Field | What it does |
|---|---|
| Name | Label shown on the canvas and in the trace. |
| Cases | A label and an expression for each case. Order matters. |
What it writes
No variables. The trace records the matched case (case_id, case_label), or that the Default branch was taken.
In a real flow
A switch on the loan product sends each product to its own rate calculation. Anything unexpected goes to manual review through Default.
When it fails
- A case expression cannot be evaluated: the run fails with
EXPRESSION_FAILEDand names the case. - A case without an expression, a duplicated case id or a case named
defaultare errors in Checks.
Good to know
- Only one path runs. If two things must happen, put them one after the other on the same branch rather than side by side.
- Renaming a case label never rewires the graph; the port keeps its identifier. Deleting a case removes its connection.
- Put the most specific case first: the first match wins.