Unexpected behaviour with code node $input.all()

We encountered a really frustrating issue during a client-facing call. A code node that had worked perfectly around 400 times suddenly failed. After debugging, I realized the problem is with n8n’s internal function $input.all(), which, for some strange reason, only returns the first item instead of all items (as shown in the attached image).

Interestingly, if I insert an IF node (set to always true) between the last node (let’s call it outputNode, which outputs 49 items) and the code node, and reference the data like this: $("outputNode").all(), everything works fine. But without the IF node, it breaks.

Has anyone else faced this? Any idea why this is happening?

Thanks in advance!

Information on your n8n setup

  • n8n version: 1.75.2
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
2 Likes

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

I ran into the same problem on n8n cloud.
I connected two input nodes to Code node and check the successful data generatation, however, $input.all() returns only one item from the first input.

It sounds like you’ve encountered an unexpected behavior with the code node. I always double check to see if the latest n8n version is installed. Additionally, testing the workflow in a different environment or using a different approach to retrieve all items might help aIt seems like the issue might be related to the configuration of the code node or how the data is being passed to it. Our team is growing and hiring, so if you’re interested in working with us, it’s a great time to get involved and learn from the folks on our team.

Hi!!
I am just practicing again with n8n. I am doing this in a local environment.
Did anyone find an answer to this issue? I have several inputs node but in the “code node” I have only the parameters for the first one , although I have used $inpu.all() to get all of them.


I would like to get the data from the Add Quotation Row node.
Then I can adjust in javascript the code.

I have just found a work around. I think it should be easier. I have used the merge node and then with code and a map function I filter the options
I was able to send the quotation as an attachment and this is calculated based on paremeters in the google sheet.

I know I can reduce the number of nodes with chagpt but I think this approach will reduce the cost.

Hi folks,

I’m getting this same bug. There are 40 input items, but $input.all() only returns 1.

This seemed to have broken recently.