switch.json•2.44 kB
{
"nodeType": "n8n-nodes-base.switch",
"displayName": "Switch",
"description": null,
"version": "3.2",
"properties": [
{
"name": "mode",
"displayName": "Mode",
"type": "options",
"default": "rules",
"description": "Build a matching rule for each output",
"options": [
{
"name": "Rules",
"value": "rules",
"description": "Build a matching rule for each output"
},
{
"name": "Expression",
"value": "expression",
"description": "Write an expression to return the output index"
}
]
},
{
"name": "numberOutputs",
"displayName": "Number of Outputs",
"type": "number",
"default": 4,
"description": "How many outputs to create",
"displayOptions": {
"show": {
"mode": [
"expression"
]
}
}
},
{
"name": "output",
"displayName": "Output Index",
"type": "number",
"default": "={{}}",
"description": "The output index to send the input item to. Use an expression to calculate which input item should be routed to which output. The expression must return a number.",
"displayOptions": {
"show": {
"mode": [
"expression"
]
}
}
},
{
"name": "rules",
"displayName": "Routing Rules",
"type": "fixedCollection",
"default": {},
"description": "The label of output to which to send data to if rule matches",
"placeholder": "Add Routing Rule",
"typeOptions": {
"multipleValues": true
},
"displayOptions": {
"show": {
"mode": [
"rules"
]
}
}
},
{
"name": "options",
"displayName": "Options",
"type": "collection",
"default": {},
"description": "If no rule matches the item will be sent to this output, by default they will be ignored",
"placeholder": "Add option",
"displayOptions": {
"show": {
"mode": [
"rules"
]
}
}
}
],
"credentialsConfig": [],
"io": {
"inputs": [],
"outputs": [],
"outputNames": [],
"hints": {}
},
"wiring": {
"role": "generic",
"requires": [],
"optional": [],
"consumedBy": [],
"consumes": [],
"produces": []
}
}