The n8n IF Node and Switch Node With Multiple Data

Written By david

In this Post

About this Video

In a previous video we looked at how to send a single piece of data through an n8n IF Node and SWITCH Node. In this video, we look at what happens when you send multiple data through an n8n workflow and through the IF Node and SWITCH Node

Multiple Data and the IF Node

When you input multiple data items into the IF node, you create the true condition as you did previously by dragging an expression into value1, then setting the condition in value2.

When you run the node with multiple data, it will spilt the inputted data based on the condition and send the data that matches the true condition down the true branch and that data that does not match down the false branch.

When you send multiple data like this, the workflow with run both the true branch and the false branch, so you can configure what happens in each branch in your workflow.

Each time multiple data runs into a node, n8n will run the node for each bit of data. So, for example, if you add a node to send an email and you add in the email address etc into that node it will run the node for each item. So, if there are 7 items, the workflow will send 7 individual emails – one to each item.

Multiple Data and the SWITCH Node

Similar to the IF Node, if you input multiple data into the SWITCH Node and create different branches based on conditions, it will split the data and send the data down the relevant branch. For example, if you create 6 branches, then the data would be split 6 ways if they all had a match.

The workflow will then run all of the branches that have data in them in the same way the IF Node does and that means that you will need to configure each branch.

And again, where multiple items are inputted into a node, n8n will run the node for each item inputted.

Why Use the IF Node and SWITCH Node With Multiple Data?

It’s a great way to filter or split data sets and do individual things based on the conditions that you set.

Join our free community and discuss this article and video. You can also ask for help with your own use case.

Some of our posts contain referral links and affiliate links where we receive a small payment for a recommendation. In many cases, the recommendations we make will also mean that you receive an offer or a credit too.

We only provide links to relevant content, for example where we have mentioned a service in the a workflow. We never provide any personal data to the sites we link too and we do not use any of this data for marketing purposes.

Where we have made a recommendation, this will be clearly mentioned in the relevant post.

Receive the latest articles in your inbox