I dont understand the code node until now. Why the developer makes it so complicated? For example there is no built in method to get exact value sent by previous node. Instead just simple variable “$input”, We need to use “$input.all()[0].json” just to get that value. I guess theres many people strugle to grasp how “code node” works too.
And why there should be “Run Once for All Items” and “Run Once for Each Item” If we can use the javascript looping to do all of this in this node. Thats just make it so confusing.
Can you explain what is the purpose of “Run Once for All Items” and “Run Once for Each Item” ? If everything can be done using vanilla javascript loop inside this node?
The Run Once for All Items means if there are 5 items before the Code node, then it will be executed only once and contain the info about every 5 items ($input.all() method )
The Run Once for Each Item means if there are 5 items before the Code node, then it will be executed 5 times. One time per every item. And it will contain only that item ($input.item property)