Skip to main content
The Switch node holds an ordered list of named cases, each with its own condition. It publishes one output port per case, plus an Other port for runs that match nothing. The first case whose condition matches wins. Switch never changes the data. It passes the incoming output straight through, so downstream nodes keep referencing the node above the Switch, not the Switch itself.

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.
A Switch node with no cases fails the step when the run reaches it. Open the node and add at least one case.Removing a case also removes any edge connected to that case’s port.

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.

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