Merge node typeVersion 3 is not working properly

I am at course level 2, doing the Merging and splitting data | n8n Docs

Describe the problem/error/question

After adding the merge node to the workflow, it does not produce the desired outcome.
However, if I copy and paste the workflow from the example on that course page, it works as expected. So I downloaded both workflow JSON and compared the merge node, find that the difference is the version, In the example, the version is 2.1 and the merge node in my n8n is 3. I have n8n version 1.55.3

What is the error message (if any)?

no error message. just gives no desired output: this is what shown


here is the workflow:

This is the desired out put demonstrated by typeVersion 2.1 of the merge node which if I click on the + sign, I do not get that version


here is the working example workflow that uses an older merge node typeVersion 2.1:

(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: 1.55.3
  • **Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu

@dishui , the problem is not with Merge node but rather the returned value in Code node. Change it to

const myObject = [
  {
    name: "Jay Gatsby",
    language: "English",
    country: {
      code: "US",
      name: "United States"
    }
  },
  {
    name: "José Arcadio Buendía",
    language: "Spanish",
    country: {
      code: "CO",
      name: "Columbina"
    } 
  }
];

return myObject;

That is, use return myObject; in place of $input.all();.

When using $input.all(); you are not returning anything in this case. As a result, there is no data to merge with.

3 Likes

Thanks for a sharp eye

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.