Resources · n8n integration

n8n Switch nodeConfigure Switch in n8n.

Switch sends each incoming item down one of several outputs. The n8n Switch node hangs on a single head parameter, Mode, which picks between matching rules and an expression returning an output index. Useful once a workflow has to serve three or four different paths.

Verified Trustpilot reviews · AI, automation & growth agency

Why automate

What does the n8n Switch node actually do?

Switch is a core node that routes items depending on a defined expression or rules. It sits in the middle of a workflow, reads each item that reaches it, and decides which of its outputs that item leaves by. Where the If node gives a true branch and a false branch, Switch opens as many branches as the routing needs, so one workflow can handle several cases without being copied four times over.

Take a support inbox. Messages land through a trigger, and the priority field decides the rest: urgent tickets go to one output, billing questions to another, everything else to a third. Each branch then does its own thing, a message posted to Slack here, a reply drafted in Gmail there. One node, three destinations. The rules still read fine months later.

A second case: an order feed where the amount matters. Small orders are logged in Google Sheets and nothing else happens. Bigger ones get a notification and a follow-up task. The Routing Rules use a number comparison, and because rules are evaluated in order, the tightest condition goes first.

A third case runs on Expression mode instead. A payload carries a region code, a short expression turns it into an index, and the item leaves through the matching output. No rule list to maintain, just a calculation that returns a number. Expression mode earns its place when the branch count is stable and the logic is arithmetic rather than a set of comparisons.

When should something else do the job? A plain yes or no test belongs to the If node, which is easier to read with two branches. Routing that ends in a call to an API with no dedicated node is still routing, so Switch picks the branch and HTTP Request makes the call at the end of it. And if the goal is to change the data rather than to send it somewhere, Switch is the wrong tool: it moves items, it never rewrites them.

The limits are worth knowing before building. An item that matches no rule is dropped unless Fallback Output says otherwise, which is the most common surprise. Rules compare values, so the data type selected has to match what the field holds. Version 3 of the node is what this page describes; an older workflow can show an earlier version with fewer options. If conditional logic is a recurring headache in the team, the n8n training covers it hands on.

Parameters

How is the Switch node configured?

The Switch node has one parameter. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.

01

Mode

mode

What you see in n8n

Notes & use cases

Mode decides how data should be routed, and the rest of the panel follows from it.

Key parameters

  • Mode: rules builds a matching rule per output, expression returns the output index.
  • Routing Rules: one condition per output, added with Add Routing Rule; Rename Output turns on an Output Name.
  • Number of Outputs and Output Index: the Expression pair, where the expression must return a number and indexes start at 0.
  • Options: Fallback Output (None, Extra Output, Output 0), Ignore Case, Less Strict Type Validation, Send data to all matching outputs.
Use cases
split tickets by priority in Rules mode, or turn a score into a branch with {{ $json.score }}.
Need help

Need help automating Switch with n8n?

A person reads every message.

FAQ

Switch node questions

01Is the Switch node included in n8n?
Yes. Switch is a core node shipped with n8n, on n8n Cloud and on a self-hosted instance alike, under the Community Edition and its Sustainable Use license. Nothing to install, no package to add, no extra cost on the n8n side. A workflow built with it behaves the same whether n8n runs in Docker on a server of your own or on the hosted offer. The node appears in the panel as soon as the editor opens, and the routing you configure travels with the workflow when it is exported and imported elsewhere. What it costs is what n8n costs, and nothing more.
02What do you need to make the Switch node work?
Nothing to authenticate. Switch has no credential and no Authentication selector, so there is no account to connect and no key to paste before it runs. That is one less thing to break in production. What it does need is data: Switch never opens a workflow, it runs on items that reach it, so a trigger has to come first, a Schedule Trigger, a Webhook, or the trigger of a tool. It also needs to know what to compare. A field referenced through an expression like {{ $json.status }} has to exist on the incoming item, otherwise the condition has nothing to work with.
03What are the limits of the n8n Switch node?
Switch routes items, it does not transform them. The item that leaves through an output is the item that came in. An item matching none of the rules is ignored by default, and Fallback Output is what changes that, with Extra Output sending it to a separate branch or Output 0 sending it along with the first rule. By default an item leaves through the first output whose condition matches, and Send data to all matching outputs changes that behavior. Comparisons depend on the data type selected, so a number stored as text needs Less Strict Type Validation or a cleanup before the node. This page describes version 3.
04Switch or the If node for conditional routing?
If for two branches, Switch beyond that. The If node answers a single yes or no question and the workflow reads clearly with a true side and a false side. Once the same question has three or more answers, chaining If nodes turns into a staircase nobody wants to edit, and Switch replaces it with one node and one rule per output. The other split is Rules against Expression inside Switch itself. Rules suits business conditions written by hand, a status, a country, an amount. Expression suits a branch index that can be calculated, and the expression has to return a number.
05n8n or Make for conditional routing?
It depends on where the data has to live and how the bill is built. Make is hosted by Make, with no self-hosting option, and charges per operation, so a workflow that fans out into many branches has a cost that grows with the volume it processes. n8n runs on its own hosted offer or on a server of your own, which keeps sensitive payloads inside your infrastructure when that matters. On the routing itself both handle branching visually. The honest test is the one that runs for a month: the tool that ends up cheaper and clearer for the branching you actually build is the right one.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.