Merging 2 or more arrays

Hi @sgw, from looking at this screenshot it seems you’re not actually merging the data. Instead, each branch coming in on your Code node would trigger a new execution of your Code node.

If you want to merge your items via the Code node rather than the designated Merge node you’d need to ensure you run your nodes in sequential order and only have one branch coming into the Code node.

For example:

This example uses a public mock API, so you can easily run it yourself without any additional setup.

You’ll notice how I am using the Execute Once option to prevent the HTTP Request nodes from making additional requests for each incoming item:

The code itself uses the $('HTTP Request 1: Fetch posts').all(); method to fetch all items from previous nodes. This method (and other relevant methods and variables) are documented here.

Hope this helps!