n8n IF, Switch and Merge Nodes Explained with Examples

A workflow that does the same thing every time is limited. Logic nodes let it decide and combine information.

IF node

The IF node checks a condition and sends items down a true or false path. Example: if the order amount is high, notify a manager; otherwise, just log it.

Switch node

Switch sends items to one of several outputs, based on rules. Use it to route messages by category, such as sales, support or billing.

Filter node

Filter keeps only items that match a condition and drops the rest. Use it when you do not need a false path.

Merge node

Merge combines data from two branches. You can append items, match them by a shared field (like an email), or combine them by position. Use it to attach customer details to an order.

A practical example

A new enquiry arrives. IF checks whether the email is valid. A Switch routes by city to the right salesperson. Merge adds details from a sheet. The result is a clean, routed lead.

Tips

  • Handle the empty case: decide what happens when no item matches.
  • Name nodes clearly, so branches are easy to read.
  • Test each branch with data that matches and data that does not.

Related

See loops for processing many items and expressions for writing conditions.

Quick answers

IF or Switch, which should I use?

Use IF for two paths and Switch for several.

What does the Merge node do?

It combines data from two branches, by position or by a matching field.

What happens when no item matches?

That branch gets no items, so plan for the empty case.


Related reading

Not sure where to start?

Tell us your goal, whether it is your own business, freelancing, studies or a job, and we will say honestly if our 15-day live n8n course is the right fit.

See the 15-day n8n training  |  Find your city  |  Book free counselling

Want to learn n8n hands-on?

Join our 15-day live, trainer-led n8n training.

Book Free Counselling
WhatsApp Call Enquiry

Request A Callback

Talk To Our Expert

We use your details only to contact you about this training.