Combine Data from Multiple Sources in n8n
The Merge node confused me for a long time. Not the concept itself, but when I actually needed it. I kept reaching for it in situations where it was the wrong tool.
Here's what took me a while to figure out: most workflows are linear. Data flows from one node to the next. If you want data from the beginning of your workflow at the end, you don't need a Merge node. You need expressions. Specifically, backwards referencing, which we covered in the Reference Previous Nodes lesson. I built more workflows than I'd like to admit where I split things apart and merged them back together, when all I needed was $('Node Name').item.json.field to grab data from an earlier step.
So when do you actually need Merge? When your workflow has parallel branches that execute independently, and you need all of their results before the next step can happen. Say you're calling three different APIs at the same time and then sending one email with all the data. Without a Merge node, each branch finishes on its own and triggers whatever comes next independently. You'd send three emails instead of one.
The Merge node has six modes for combining data in different ways. This challenge uses Append (the simplest one). The explanation below covers all six.
What you'll practice:
- Using the Merge node to combine parallel branches
- Setting Number of Inputs to handle three branches
- Understanding when to use Merge vs expressions
Your Task
- 1Copy the exercise below
- 2Paste into your n8n editor (Ctrl+V)
- 3Solve it — use hints if you get stuck
- 4Check the solution when done
Fetch users, posts, and todos from the JSONPlaceholder API in parallel and combine them into a single list.
- Add a Manual Trigger to start the workflow
- Add three HTTP Request nodes, all connected directly to the trigger:
- Fetch Users:
https://jsonplaceholder.typicode.com/users?_limit=3 - Fetch Posts:
https://jsonplaceholder.typicode.com/posts?_limit=3 - Fetch Todos:
https://jsonplaceholder.typicode.com/todos?_limit=3
- Fetch Users:
- Add a Merge node. In its settings, set Number of Inputs to 3
- Connect all three HTTP Request nodes to the Merge node's three inputs
- Mode should be Append (the default)
Expected output: 9 items total (3 users + 3 posts + 3 todos), stacked in one list.
User structure:
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
...
}
Post structure:
{
"userId": 1,
"id": 1,
"title": "sunt aut facere...",
"body": "quia et suscipit..."
}
Todo structure:
{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
Get the exercise workflow
Create a free account to copy exercises into your n8n editor.