Switch Node

Route workflow items to different branches based on a value matching multiple cases.

Written By pvdyck

Last updated 14 minutes ago

Switch Node

The Switch node routes items to different output branches based on matching a value against multiple cases -- similar to a switch/case statement in code.

Modes

ModeDescription
RulesDefine conditions for each output. Each rule has a condition (same operators as the If node) and routes matching items to its output
ExpressionEvaluate a single expression and route items based on the result value matching output names

Parameters (Rules Mode)

ParameterDescription
Routing RulesOne or more rules, each with a condition and target output
Condition TypesString, Number, Boolean, Date & Time, Array, Object -- same operators as the If node

Parameters (Expression Mode)

ParameterDescription
ValueAn expression that returns a value (e.g., {{ $json.status }})
OutputsNamed outputs that match possible expression results

Options

OptionDescription
Send to All MatchingRoutes each item to every matching output instead of only the first match
Fallback OutputConfigures which output receives items that match no rule. Options: None (items are discarded), Extra Output (dedicated fallback branch), or a specific output index
Loose Type ValidationAttempts type coercion before comparing values

Tips

  • Use Rules mode for complex multi-condition routing
  • Use Expression mode when routing is based on a single field value (e.g., status = "active", "pending", "closed")
  • The fallback output acts like the default case in a switch statement

Limitations

  • None. Full support.

Related