Skip to main content
Switch is an LLM-powered multi-way router. It evaluates the value connected to its input against a list of cases and sends it through the matching case output, or through the default output if nothing matches. The value flows through unchanged — Switch only decides the route. The case list controls how many output ports the node has. Three cases create three case outputs plus a default. Each output inherits its data type from the input, so downstream nodes receive the same kind of data.

When to use

  • Classify images by subject and route each class to a different generator
  • Categorize customer feedback into support, sales, or bug channels
  • Branch a workflow into format-specific tracks (square, vertical, landscape)
  • Pick a prompt strategy based on the input asset type

Inputs

Input
dynamic
required
The value to route. Required. Its type determines the type of every output port.
Evaluation context
any
Extra context the model may consider when matching cases — text, images, or any mix. This context is not routed. Optional, accepts multiple inputs and an array.

Outputs

Case
dynamic
One output port per case. The input value flows through the port whose condition matches.
Default
dynamic
Receives the input value when no case condition matches.

Configuration

cases
array
default:"[{ label, condition }]"
The list of cases. Each case has a label (used to name its output port) and a condition (a natural-language rule the model evaluates). Add up to 16 cases. Every case must have a non-empty label and condition.
Switch runs on a selectable model (default Gemini 2.5 Flash) to evaluate conditions and consumes credits when it runs.