Switch
core.switch · version 3.2 · Flow
Send each item to the output whose rule it matches.
Ports
| Port | Kind | Label | Required | Max connections |
|---|---|---|---|---|
| input 0 | main | |||
| output 0 | main | 0 |
The number of ports depends on the parameters; the table shows the default set.
Credentials
This node uses no credentials.
Parameters
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
mode | options | "rules" | One of rules, expression. | ||
rules | fixed_collection | mode = rules | Routing rules. | ||
rules.values | fixed_collection | Rule. | |||
rules.values.conditions | filter | ||||
rules.values.renameOutput | boolean | false | Name the output. | ||
rules.values.outputKey | string | renameOutput = true | Output name. | ||
numberOutputs | number | 4 | mode = expression | Number of outputs. | |
output | number | mode = expression | Output index. Expression that returns the zero-based output for the item. | ||
looseTypeValidation | boolean | false | Convert types where required. | ||
options | collection | ||||
options.fallbackOutput | options | "none" | Unmatched items. Or the index of an existing output. One of none, extra. | ||
options.renameFallbackOutput | string | Extra output name. | |||
options.ignoreCase | boolean | false | Ignore case. | ||
options.allMatchingOutputs | boolean | false | Send to every matching output. |
Import
Exported workflows that use these node types import to this node. Unverified ranges import with a parameter warning until parity fixtures confirm them; see Migrating.
| Source type | Version range | Status | Fixtures |
|---|---|---|---|
n8n-nodes-base.switch | 1 | unverified | |
n8n-nodes-base.switch | 2 | unverified | |
n8n-nodes-base.switch | >=3 <4 | unverified |