Switch
The Switch node compares one value against a list of cases and sends the workflow down the path of the case that matches.
Screenshot placeholder
The palette describes it as "Multi-case switch".
When to use it
Use it when one value can take several known options, such as an order status of "new", "paid" or "shipped", and each option needs a different path.
Settings
| Field | What it does | Notes |
|---|---|---|
| Expression | The value to match against each case | Placeholder {{ input.status }}. A new node starts with {{ output.value }} |
| Cases | The list of cases | A new node starts with Case A (value "a") and Case B (value "b") |
| Include default (else) branch | Adds a path for values that match no case | On by default |
Each case has:
| Field | What it does | Notes |
|---|---|---|
| Case label | The name shown on the node and on its output | Placeholder "Case label" |
| Match value | The value to compare with | Placeholder "Match value" |
Click Add case to add one. The trash icon removes a case. New cases are named "Case 1", "Case 2" and so on.
Inputs and outputs
| Handle | Where | Purpose |
|---|---|---|
| Input | Top | The step that comes before |
| One output per case | Right side, evenly spaced | The path for that case |
| default | Bottom | The path when no case matches |
The node lists each case with a number, plus a D entry for the default (named "Default" unless a default label is set).
Example
This is an illustrative example. You are handling order statuses.
- Set Expression to
{{ input.status }}. - Add a case labelled "Paid" with match value
"paid", and a case labelled "Shipped" with match value"shipped". - Keep Include default (else) branch on, and connect the default output to a step that logs unexpected statuses.
Tips
- The starter cases use quotes around their values (
"a"). Follow the same style if your expression returns text. - Keep the default branch on unless you are sure every value is covered.