// guides · n8n error index

n8n Merge node not working after an IF? 31 tests of what really happens

Why an n8n Merge node outputs nothing, drops items or never runs after an IF node, and why IF sends items to the wrong branch. Exact behaviour and fixes from 31 real runs on n8n 2.43.7.

Updated 2026-10-19 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. Use Append when you just want the IF branches back together

    If you only want the true and false items in one list again, use Mode: Append. In our runs, Append worked when one IF branch was empty, whichever input the empty branch was plugged into: 3 paid items on Input 1 and nothing on Input 2 gave 3 items, and the same with the inputs swapped. With both branches holding data, the output was Input 1 first, then Input 2 (ids 1, 3, then 2). Older forum answers say Merge stops when Input 1 is empty; that was not true on n8n 2.43.7 with the default v1 execution order.

  2. Know that Combine and Choose Branch stop on an empty input

    This is the usual reason a Merge "does nothing". With one IF branch empty, Combine by Matching Fields and Combine by Position ran but output 0 items, so the next node never ran and there was no error. Choose Branch did not run at all. Fixes that worked: Combine by Matching Fields with Output Type: Keep Everything passed the 3 items through; Append worked. Turning on Always Output Data on the Merge node made the next node run, but with a single empty item {}, so you must filter it out. Turning it on for the IF node did not help Choose Branch.

  3. Check that the match fields have the same type and name

    Combine by Matching Fields compares types strictly. id: 1 (number) on one side and id: "1" (text) on the other gave 0 matches and no error. Turn on Options > Fuzzy Compare: the same data then matched 2 of 2. If the field is called id on one side and userId on the other, typing only id also gave 0 matches silently; turn on Fields to Match Have Different Names and pair id with userId (2 of 2 matched).

  4. Watch for dropped, doubled and overwritten items

    Default Keep Matches drops items without a partner: 3 people and 2 emails gave 2 items, and Cy was gone. Use Enrich Input 1 to keep all 3. Combine by Position with 3 and 2 items also gave 2, until we turned on Include Any Unpaired Items (3). A duplicate key doubles items: one person matching two email rows gave 2 output items. When both sides have the same field (name), Input 2 won by default (Ada B replaced Ada); Options > Clash Handling > Prefer Input 1 kept Ada.

  5. Fix the IF node itself

    If items go down the wrong branch, check the condition, not the Merge. With strict types, comparing "5" (text) as a number stopped the workflow: Wrong type: '5' is a string but was expecting a number [condition 0, item 0]. Turn on Convert types where required (it then went to true) or add .toNumber(). A missing field, Paid versus paid with case sensitivity on, and a trailing space ("paid ") all went to false silently. And if you join both IF branches straight into one node without a Merge, that node runs twice, once per branch (2 items, then 1).

What we tested, and what happened

On 19 October 2026 we ran 31 small workflows on self-hosted n8n 2.43.7 with n8n execute, default execution order v1, IF node version 2.2 and Merge node version 3.2. Data: 3 orders (one IF test sent all 3 to true, so the false branch was empty), or 3 people and 2 emails for the Combine tests.

SetupWhat happened
IF, false branch empty, Merge AppendRan, 3 items. Same with the empty branch on Input 1.
IF, both branches have data, Merge AppendRan, 3 items, Input 1 first (ids 1, 3, 2).
IF, one branch empty, Combine by PositionRan, 0 items. Next node did not run. No error.
IF, one branch empty, Combine by Matching FieldsRan, 0 items. Next node did not run. No error.
Same, Output Type Keep Everything3 items, next node ran.
Same, Always Output Data on MergeNext node ran with 1 empty item {}.
IF, one branch empty, Choose BranchMerge never ran. Always Output Data on the IF did not change that.
Both IF branches into one node, no MergeThat node ran twice: 2 items, then 1.
Match id number vs "1" text0 items, no error. With Fuzzy Compare: 2 matched.
Match id vs userId, only "id" typed0 items, no error. With different field names set: 2 matched.
3 people, 2 emails, Keep Matches2 items (unmatched person dropped). Enrich Input 1: 3.
Combine by Position, 3 and 2 items2 items. Include Any Unpaired Items: 3.
One person, two matching email rows2 items for that person.
Same field name on both sidesInput 2 value won. Prefer Input 1 kept Input 1.
All Possible Combinations, 3 and 2 items6 items.
IF number > 3 on "5", strictError: Wrong type: '5' is a string but was expecting a number.
Same, Convert types where requiredTrue branch.
IF on a missing field, on Paid, on "paid "All went to false, no error.
IF boolean is true on the text "false", convert types onFalse branch.
After Merge, Code reads $("Not paid").first() but that branch was emptyError: Node 'Not paid' hasn't been executed.
Same with $("Not paid").isExecuted ? ... : "not run"Ran, returned "not run".

Quick checklist

Good to know

What we didn't test

FAQ

Why does my n8n Merge node output nothing after an IF node?

When one IF branch has no items, Merge in Combine mode runs but outputs 0 items, and Choose Branch does not run at all; the next node is skipped without an error. In our n8n 2.43.7 tests, Append mode still worked with an empty branch, and Combine by Matching Fields with Keep Everything passed the items through.

Does the n8n Merge node wait for both inputs?

With the v1 execution order, Append ran with only one input holding data, whichever input it was. Combine modes ran but returned 0 items when one input was empty, and Choose Branch never ran.

Why does Merge by matching fields find no matches?

Usually a type or name mismatch: the number 1 and the text "1" did not match in our test until we turned on Fuzzy Compare, and id versus userId did not match until we set Fields to Match Have Different Names. Neither case shows an error.

How do I fix "Wrong type: is a string but was expecting a number" in the n8n IF node?

Turn on Convert types where required in the IF node, or convert the value in the expression, for example {{ $json.n.toNumber() }}. In our test, the same "5" then went to the true branch.

How do I fix "Node hasn't been executed" after an IF and Merge?

A later node is reading data from a branch that did not run. Check first with $("Node name").isExecuted, as in $("Not paid").isExecuted ? $("Not paid").first().json.branch : "not run", which ran without error in our test.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.