Understanding expressions: mapping $json, $node and items without code
The biggest n8n learning hurdle explained: what items, $json and $node mean and how to map values by drag and drop without code.
How n8n loops through items automatically, how the Loop Over Items node works, and which batch size makes sense for performance and rate limits.
n8n usually processes multiple records entirely on its own: a node takes in a list of items, runs its logic for each individual item, and returns the results again as a list. For most workflows, you therefore do not need an explicit loop at all. But as soon as an external service only allows a few requests per second, a node only processes the first item, or a paginated API without a known number of pages needs to be queried, automatic processing is no longer enough. This is exactly what the Loop Over Items node in n8n is for, formerly known as Split in Batches.
In this article, we show you how automatic looping works in n8n, how the Loop Over Items node works in detail, and what you should watch out for regarding batch size and performance so that your workflows run stably and without rate limit errors.
According to the n8n documentation on looping n8n nodes generally accept any number of items, process them, and return the results again. For example, if you connect a data store node with five customer records to a Slack node, n8n automatically sends five individual messages, one per record. You do not need to build your own loop for this, the engine handles it in the background.
If you instead want to process only the first item of an incoming record, you activate the Execute Once option in the node settings under the Settings tab. This makes the node ignore all further items and only process the first record, which is useful, for example, for one-off notifications.
For all cases where automatic processing is not enough, n8n provides the Loop Over Items node . The node stores the original input data and returns a fixed number of items on each run through the loop output. Once all batches have been processed, it combines the processed data and returns it through the done output.
Two settings are central here:
In practice, you use expressions such as {{$("Loop Over Items").context["noItemsLeft"]}} to check whether items remain, or {{$("Loop Over Items").context["currentRunIndex"]}} to read out the current run index and use it as a stop condition in an IF node.
According to the documentation, some nodes fundamentally only process the first item or all items at once, instead of iterating cleanly. These include, among others, CrateDB, Microsoft SQL, MongoDB, and TimescaleDB for insert and update operations, the Code node, and the Execute Workflow node in "Run Once for All Items" mode, the HTTP Request node for manual pagination, the Redis Info operation, and the RSS Read node. For these exceptions, you build the loop manually: you connect the output of a node back to a previous node and add an IF node that checks a clear stop condition.
Batch size directly determines how stable and how fast a workflow runs. A small batch size, for example 1 to 5 items per run, is easy on external APIs with strict rate limits but increases the overall runtime, because n8n has to process more individual runs. A large batch size speeds up the workflow but increases the risk that a service responds with a 429 error or that the workflow is harder to trace if an error occurs in the middle of a large batch. In practice, it is best to test with a moderate batch size and observe the execution times as well as any error responses from the target service before increasing the value further.
Especially for production workflows with many external calls, it is worth combining Loop Over Items specifically with wait times between batches so that APIs are not overloaded and you retain control over execution. If you want to not only build your n8n workflows but also operate them reliably over the long term, we support you at NordFlux as part of our n8n automation with exactly these performance and rate limit questions, so that your digital workers run reliably.
Automatic looping happens on its own for almost every n8n node: the node processes each incoming item individually and passes on the result list without you having to configure anything for it. The Loop Over Items node only comes into play when you want to explicitly split processing into controlled chunks, for example to comply with rate limits or to serve nodes that can only process one item at a time.
An infinite loop usually occurs when the Reset option is enabled but no stop condition is checked. In this case, build in an IF node that evaluates, for example, the expression {{$("Loop Over Items").context["noItemsLeft"]}}, and route the workflow into the done branch instead of back into the loop once the end is reached.
There is no blanket number, because every service has its own rate limits. As a starting point, small values between 1 and 10 items per batch are suitable, which you then gradually adjust based on the actual response times and any error messages from the target service.
No, most n8n nodes process multiple items automatically without additional configuration. Only for a limited number of exception nodes, for example certain database nodes or the HTTP Request node for manual pagination, do you need to build the loop yourself with the Loop Over Items node or a back-connected IF node.
Yes, using the context properties of the Loop Over Items node, such as currentRunIndex, you can identify the current run, and references to earlier nodes in the workflow also allow you to incorporate data from previous steps. For more complex intermediate storage across multiple runs, an additional Set or Code node that collects intermediate results is recommended.
Founder of NordFlux. Spent four years automating processes at enterprise scale at Dräger, and now brings that depth to the mid-market — pragmatic and with full data sovereignty.
Certifications
The biggest n8n learning hurdle explained: what items, $json and $node mean and how to map values by drag and drop without code.
How approval steps in n8n prevent AI agents from sending emails or placing orders without human confirmation.
How to make n8n workflows robust against 429 errors using the Wait node, Batching, Retry on Fail, and pagination.
Batch size and the reset option look minor, but they decide whether your workflow runs stable or fails against API limits. NordFlux takes over managed operation of your n8n workflows and sets up batching, performance, and error handling correctly from the start. In our first conversation, we check your critical workflows for exactly these pitfalls.