Switch
Overview
The Switch node routes data to one of N output ports based on a field value. It functions like a switch/case statement — mapping field values to specific output ports, with a default port for unmatched values.
Category
Flow Control — flowcontrol/switch
Settings
| Setting | Type | Default | Description |
|---|---|---|---|
| field | String | — | Field to evaluate for routing |
| cases | Object | {} | Value-to-output mapping: { 'active': 'output1', 'pending': 'output2' } |
| defaultOutput | String | else | Output port for unmatched values |
| caseSensitive | Boolean | false | Case-sensitive value matching |
| mode | String | value | Matching mode: value, range, regex |
Inputs & Outputs
- input1 — Upstream data
- output1 … outputN — One port per case
- default output — Unmatched rows
Use Cases
- Route by status — Send
activeorders to processing,cancelledto refund workflow,pendingto review - Regional routing — Route data to different pipelines based on country code
- Error classification — Route error types to different handling workflows