Switch
Route workflow execution to one of many named cases based on conditions evaluated in order, with a configurable fallback.
The Switch node evaluates a list of named cases in order and routes execution to the first case whose condition matches. If no case matches, execution routes to a configurable fallback. Use it when you need more than two branches -- for example, routing by department, status code, or plan tier.
Each case is a single flat condition (not a group), evaluated top to bottom. The first match wins.
Configuration
Cases
Each case defines a named route with a single condition. Add as many cases as you need.
| Field | Type | Required | Description |
|---|---|---|---|
| Route name | text | Yes | Identifier for this case, used as the output handle name (e.g. sales, support, billing). Must be unique across cases. |
| Field | template string | Yes | Variable path to the value being tested, e.g. nodes.form1.department |
| Data type | select | No | Type hint: String, Number, Boolean, Date, Array, Object, or Any. Defaults to Any. |
| Operator | select | Yes | Comparison operator. The list updates based on the selected data type. |
| Value | template string | Conditional | Expected value. Hidden for unary operators like "is empty". |
| Ignore case | toggle | No | Case-insensitive comparison for String and Any types. Defaults to off. |
Click Add Case to append a new case. Click the trash icon on any case card to remove it.
Fallback Route
| Field | Type | Required | Description |
|---|---|---|---|
| Fallback Route | text | No | Route name used when no case matches. Defaults to default. |
Output Handles
The Switch node creates a dynamic output handle for each case name, plus one for the fallback route. Connect downstream nodes to the handle matching the route name you defined.
For example, if you define cases named sales, support, and billing with a fallback of default, the node will have four output handles.
Output
| Field | Type | Description |
|---|---|---|
| route | string | The name of the matched case, or the fallback route name if no case matched |
Example
A contact form asks users to select their department. You want each department routed to a different integration:
- Add a Switch node after the form.
- Add three cases:
- Route name =
sales, Field =nodes.contactForm.department, Operator = Equals, Value =sales - Route name =
support, Field =nodes.contactForm.department, Operator = Equals, Value =support - Route name =
billing, Field =nodes.contactForm.department, Operator = Equals, Value =billing
- Route name =
- Set Fallback Route to
other. - Connect each output handle to the appropriate downstream node.
The first matching case determines the route. If the user selects a department not covered by any case, the other fallback fires.
See the Logic Nodes overview for a full list of available nodes.