Blocks
Switch
The switch step: N-way case routing — first matching expression wins, a default port catches the rest.
The N-way branch: a list of cases, each an expression plus a label; the first match routes down that label's port, and the default port catches everything else.
Config
One row per case: when this expression is true, route to this label.
Each case has:
- When — an expression over
payload(same sandboxed dialect as if):payload["kind"] == "refund". - Route to — a free-form label (
refund,vip,spam) that becomes one of this step's output ports.
Cases evaluate in order; first match wins. No match → the
default port.
Output
Like if, switch passes the payload through unchanged on the port that fired.
Patterns
- After a classify — an AI classify
picks a label, the switch routes on
payload["data"]["label"] == "refund"— one case per label. - Tiering — score ranges to different handling lanes, ordered highest first (first match wins does the range logic for you).
Gotchas
- Wire every case port and the default. A case without an outgoing edge silently drops the payloads that match it — and the default is where typos and unexpected values land, so give it at least a notification.
- Order matters: put the most specific case first. A broad first case shadows everything below it.