Merge node not working as expected

Describe the problem/error/question

I have use append method in merge node but it is not appending results of one of its input.

as in the output only segregate node’s output is appending and not LLM model’s. why? Should it just append one after another??

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Aarush_Bisht

1)The most common reason for this in n8n is that the Merge node triggers as soon as the first input arrives, rather than waiting for all inputs.

  • The Problem: Your Aggregate1 node likely finishes almost instantly, while the AI Agent takes several seconds to call the LLM. If the Merge node is not configured to wait, it may execute the moment Aggregate1 finishes and ignore the AI Agent result that arrives later.
  • The Fix: Check the Settings tab of your Merge node. Look for an option like “Wait for all inputs to arrive” and ensure it is enabled. (Note: In newer versions of n8n, this is the default behavior, but it’s worth verifying)

2)To diagnose exactly where the data is getting lost, please perform these two checks:

  • Check the AI Agent’s Output: Click on the AI Agent node and look at its Output tab. Does it actually show 1 item with the expected text?
  • Check the Merge Node’s Input Dropdown: In the Merge node’s Input panel (where you currently see Aggregate1 selected in the dropdown), click that dropdown and select the AI Agent.
    • If the AI Agent input is empty here​, then the data is not reaching the Merge node.
    • If the AI Agent input has data here​, but the Output panel still only shows 1 item, then the Merge node is failing to append.

3)Looking at your JSON, Aggregate1 is outputting a single item that contains an array called unique-identifier.

  • If the AI Agent is also returning a complex structure or an empty array [], n8n might treat it as “0 items” even if the node technically “executed.”
  • Test: Replace the AI Agent node temporarily with a simple Edit Fields (Set) node that outputs a basic piece of text (e.g., {"test": "hello"}). If the Merge node suddenly shows 2 items, the issue is with the specific output format of your AI Agent.

Try 1 first. If it does solve the issue, proceed to 2 and so on. Does that help?

  1. I tried by pinning the data in LLM node. not worked. so problem not of timing. there was no wait for all in settings too.

2)I tried entering a simpler input but it is only taking 1 of them ( the one which I am executing manually at last) .

  1. As you can see aggregate value is been shown in previous nodes while it is ouputing set fields data.
  1. Unpin everything.
  2. Click the big “Execute Workflow” button at the bottom of the screen.

What do you see?

Or try this:

  1. Pin the data in Aggregate1 (already done).
  2. Pin the data in Edit Fields1 (click the pin icon on that node as well).
  3. Now, click “Execute Step” on the Merge node.

What do you see?

I see, it works that way. But I just want to test it till merge node and had pinned stuff to save LLM tokens. Any idea why it did not work when node executed manually ?

In n8n, the Merge node doesn’t just “look” at the data bubbles sitting on the previous nodes. Instead, it merges data that arrives during the same execution run​.

When you execute nodes manually one-by-one (clicking “Execute Node” or “Execute Step”):

  1. You are creating fragmented “mini-executions.”
  2. When you manually execute the Merge node, it sees the data from the node you just ran (Edit Fields1) as the active trigger.
  3. Even though Aggregate1 is pinned and you can see the data in the input preview, that data is not “active” in the current execution path that triggered the Merge node.

This is why you noticed it only takes the one you executed last—the Merge node is treating the other input as if it hasn’t “arrived” yet in this specific manual run.

hmm… Visually I have seen that when you execute merge node manually , it executes all paths joining it but was passing data of just one. That is why I was confused. Above is the picture of when I executed merge node manually. and below is a pic of fresh diagram with no prior executions to show that no prior executions were manipulating merge. It showed both paths executed ( first one got earlier and waited for second) and when second also got executed it showed output of path 1 only.

Though thanks for help.

Since you want to save LLM tokens, the “Pinning Strategy” is actually the best way to do it.

The ideal testing workflow for your case:

  1. Run the LLM node once​.
  2. Pin the output of the LLM node (or the Edit Fields node following it).
  3. Now you can delete the connection to the LLM node or just leave it pinned.
  4. You can now execute the Merge node, the Code node, or any subsequent nodes 100 times, and n8n will keep using that pinned “cached” data instead of calling the LLM again.

In short: If a node is not pinned and not part of the current active execution chain, the Merge node cannot “reach back” and grab data from a previous manual run.