The n8n If and Merge node, read by counting items

By Christophe Paka · Facts checked on 23 October 2026

Twelve orders go into your workflow. Ten rows land in the sheet. The run is green, there is no error, and two orders are gone. Most people open every node to hunt for the leak.

There is a faster way, and it needs no code. Before you touch the n8n merge node or the If node, count the items on every wire. The figure below shows the habit on one small workflow, and the numbers tell you where the bug is before you open a single node.

An n8n workflow: a trigger fetches 12 orders, an If node sends 5 down true and 7 down false, each branch sets a tier, and a Merge node in Append mode outputs 12 rows to a sheet.
Figure 6.1: Count the items on every wire. 5 plus 7 is 12, so nothing was lost between the trigger and the sheet.
Use this diagram on your site

Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.

How to read this figure

  1. Start at the trigger. The trigger fetches 12 orders, so 12 items leave it. An item is n8n's name for one record; see the items pipeline. That number is your total. Select Execute workflow and each node shows its item count, so you can read every wire.

  2. Follow the split at the If node. The If node sends each item one of two ways by a test, here whether the amount is over 100. Five items leave by true and 7 by false. It does not copy items, so the two sides always add up to 12.

  3. Read each branch. Each branch has an Edit Fields node. True items get the tier priority, false items get the tier standard. The counts stay the same: 5 in, 5 out, and 7 in, 7 out.

  4. Check the Merge inputs. The 5 priority items go into Input 1 and the 7 standard items into Input 2. Which branch feeds Input 1 matters for some modes, so note it.

  5. Do the sum at the end. The Merge node joins two branches back into one. In Append mode it stacks both inputs, so 12 items come out and the sheet gets 12 rows. Five plus 7 is 12, so nothing was lost.

Key takeaways

  • Write the item count on every wire after each change; the branches must add up to what came in.
  • Pick a Merge mode by the count you want out: Append gives 12 here, Combine by Position gives 5.
  • Set a Switch node's Fallback Output, so an item that matches no rule cannot vanish in a green run.

Worked example: the same 5 and 7 through each Merge mode

Keep the workflow from the figure, with the 5 priority orders wired into Input 1. Change only the Merge mode and count what comes out.

  1. Append keeps every item, one input after the other: 12 items.
  2. Combine by Position pairs the first priority order with the first standard order, the second with the second, and so on. After 5 pairs, Input 1 is empty, and by default the 2 standard orders left over are dropped: 5 items.
  3. Combine by Matching Fields joins only items whose chosen field has the same value: as many items as there are matching pairs.
  4. Combine by All Possible Combinations pairs each of the 5 with each of the 7. Five times 7 gives 35 items. If you expected 12, a jump like this means the wrong mode.
  5. Choose Branch waits for both inputs and passes one of them on: 5 or 7 items.

Result: If your sheet expects 12 rows and gets 5, the mode is the bug, not your data. Switch to Append, or check which branch feeds Input 1.

Questions readers ask

Why does my n8n Merge node lose items?

Usually the mode or the inputs. Combine modes are capped by Input 1: with 5 items in Input 1 and 10 in Input 2, the node processes 5. Count the items on both inputs, then check which branch you wired into Input 1.

Does the If node copy items to both branches?

No. Each item goes down one output, true or false. If 12 orders go in and 5 are over 100, then 5 leave by true and 7 by false. Never 11, never 13.

Why do items vanish after a Switch node with no error?

An item that matches no rule goes to the Fallback Output, a setting on the Switch node. Its default is None, which means ignore the item, so the run ends green. Set Fallback Output to Extra Output: the leftovers then leave by one more output. Wire it to a node you will notice.

Sources: Merge node (n8n docs); If node (n8n docs); Switch node (n8n docs).

This figure is from n8n Made Crystal Clear, chapter 6.

The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.

Get the book

All diagrams