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?
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 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.