Switch
Switch
Match a value against several cases and run the first one that matches
Fields
| Field | Type | Required | Description |
|---|---|---|---|
value | operand ({path} or {literal}) | yes | The value to match. |
cases | array of {when: operand, steps}, non-empty | yes | Matching is strict equality only — the first case whose 'when' equals 'value' runs. |
default | array of steps | no | Runs if no case matches. |
Example
{
"id": "01H8XGJVBWX7Y5Z3K9M2N4P6Q1",
"type": "switch",
"value": {
"path": "vars.run.choice"
},
"cases": [
{
"when": {
"literal": "a"
},
"steps": []
}
],
"default": []
}Updated about 14 hours ago
Did this page help you?
