When to use Switch
- You have three or more mutually exclusive paths, such as one extraction schema per document type.
- You want a named fallback for unrecognized inputs, rather than a run that quietly stops.
- Use if instead for a simple yes/no split.
- Use classify instead when the decision needs to read the document’s content. Switch compares values you already have.
- Use split instead when one upload holds several documents and each needs its own run. Switch picks a path; it does not fan a run out.
Configuration
Each case row can be renamed, reordered by dragging its handle, and removed. The case name becomes its port label on the canvas, so a descriptive name keeps the graph readable.
Order matters
Cases are evaluated top to bottom and the first match wins, so a run never leaves through two case ports. Put the most specific case first: a broad case placed above a narrow one will shadow it. A case with no rules in its condition never matches, so a half-configured case is skipped rather than swallowing every run.Inputs and outputs
Allowed inputs: every trigger and every action node, including another Switch or If. Each case resolves against the incoming node’s output and that node’s ancestors, so anything upstream is available to compare. Output ports: one port per case, labeled with the case name, plus:
Exactly one port fires. Leaving a port unconnected is fine: a run that leaves through an unconnected port stops there, and the run still completes. Connect Other whenever your cases are not exhaustive, so unrecognized inputs are handled instead of silently stopping.
The data on every port is the upstream output, unchanged.
Credits
The Switch node costs 0 credits. It only compares values that already exist in the run.Related
If action
A simple true/false split
Conditional routing guide
How ports, conditions, and operators fit together
Classify action
Branch on document type by rules or examples
Split action
Cut one upload into per-sub-document runs