n8n Switch Node Explained: Route Workflows Down Multiple Paths (2025)
The Switch node is how you build “if this, go here; if that, go there” logic in n8n without stacking a dozen IF nodes. Where the IF node only gives you a true/false fork, the Switch node lets one node send each item down one of many outputs. This guide covers exactly how it works and when to reach for it.
What the Switch node does
The Switch node evaluates each incoming item and sends it out of exactly one output branch. Think of it as a router: an order status of paid goes to fulfillment, refunded goes to accounting, and everything else falls through to a default branch. One node, many clean paths — far more readable than nested IF nodes.
Rules mode vs. Expression mode
Switch runs in two modes. In Rules mode you define each output visually: a value, an operator (equals, contains, larger than, etc.), and the branch it maps to. In Expression mode you write a single expression that returns the output index (0, 1, 2…), which is powerful when the routing key is computed. Start with Rules mode — it covers 90% of real cases and stays readable for teammates.
⚙️ Skip the build: LLM Router — Route AI Tasks to the Right Model
A production Switch-based router that sends each request to the cheapest model that can handle it — cutting AI spend by up to 60%.
Get the ready-to-import template on Gumroad →
A practical example: routing support tickets
Imagine tickets arriving with a priority field. Add a Switch node in Rules mode with three outputs: priority = urgent → Slack alert + on-call ping, priority = normal → create a Zendesk ticket, and a fallback output for anything unmatched → log for review. Enable “Fallback Output” so nothing silently disappears when a new value shows up.
Switch vs. IF: which to use
Use the IF node for a binary decision (subscribed or not, above or below a threshold). Use the Switch node the moment you have three or more destinations, or when the branches map to distinct categories. Chaining IF nodes to fake a switch works, but it becomes unmaintainable fast — the Switch node keeps the canvas flat and the logic obvious.
Common pitfalls
Two things trip people up. First, data types: a Switch comparing equals 5 won’t match the string "5" — cast values consistently upstream with a Set node. Second, forgetting the fallback output: without it, unmatched items are dropped and you’ll swear the workflow is “losing” data. Turn it on and route the fallback to a log or notification.
Ready to automate?
Get the LLM Router — Route AI Tasks to the Right Model workflow — import the JSON, connect your accounts, and it runs on autopilot.