Code nodes Data handling

Hello to the community,

I am new to n8n having some years of experience with make, controling a decent amount of scenarios there. But as I am not a programmer sometimes I have my difficulties to understand details.

I try to establish my first scenario within n8n, and I used a some code nodes to handle some data. The code was transformed to my desired output idea by js and with the help of chatgpt.

Now my kind of general question is related to the data handling of the code node in general.

I can see that switched to the JSON view, each part of the node (input or output) shows JSON code, but the representation is kind of dynamic. So if I switch to 10 items per page, I get a 10 objects containing JSON, when I increase the items per page, the outputs item count that I can copy is accordingly higher.

During the programming with chatgpt there were always problems with the data structure, since my view and also the copyable code was an array, but the code node did often reject the code saying the variable wasn’t an array.

This leads me to the point, that I don’t understand, how data is represented from code node, when I can see it as an array in my editor, but same data is codewise somehow other represented since I will alaways have some related errors.

is there any helpful explanation, how I can see, what code node really represents while it is showing me the data in a JSON Array format?

  • n8n version: 1.72.1
  • Database Postgres:
  • n8n EXECUTIONS_PROCESS setting (default):
  • Running n8n via (railway => N8N (w/ workers)):
  • Operating system: MacOS

Thx in adavnce

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:

Actually I found the expression editor, which helped to fiddle around variables. So finally I found something helping me a step further.

The only problem lasts form me is:

how can I post all items from the input, instead of a single one?

You could loop through all of them and POST defining a batch size number: Loop Over Items (Split in Batches) | n8n Docs

Hope this helps!

1 Like

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