Lists, Loops, and Filters: Loop Over Items, Filter, Aggregate
- Use the Filter node to remove unwanted items from a list based on field conditions
- Configure Loop Over Items with a batch size and Wait node to handle rate-limited API calls
- Use the Aggregate node to collapse multiple items into a single item or array
Everything Is a List
Almost every real workflow works with lists of data — 50 rows from a spreadsheet, 200 results from an API, 30 emails from an inbox. n8n processes these as multiple items flowing through your workflow simultaneously. Three nodes are indispensable for controlling this: Filter, Loop Over Items, and Aggregate.
Filter: Keep Only What You Need
The Filter node examines every item and removes the ones that don't match your conditions. Items that pass the filter flow to the next node; everything else is discarded.
Configure it the same way as the IF node — choose a field, an operator, and a value. The difference is that the IF node sends non-matching items to the False output; the Filter node drops them entirely. Use Filter when you simply don't need certain items and don't want to handle them separately.
Example: from a list of 200 customer records, keep only those where {{ $json.status }} equals "active". Your downstream nodes now process only the 43 active customers instead of all 200.
Loop Over Items: Process in Batches
By default, n8n sends all items through a node at once in parallel. This is efficient, but it breaks with services that have rate limits — an API that allows only 10 requests per second will return errors if you send 200 requests simultaneously.
The Loop Over Items node (formerly called "Split in Batches") solves this by processing items in fixed-size batches, one batch at a time. Set the Batch Size to the number of items to process per iteration. Connect a Wait node after your processing step to pause between batches.
Pattern for rate-limited APIs:
- Loop Over Items (batch size: 10)
- Your API call node
- Wait node (pause: 1 second)
- Back to Loop Over Items
The loop automatically repeats until all items are processed, then the workflow continues to the next section.
Aggregate: Combine Many Items Into One
Sometimes you start with 50 items and need to send them all to an API that expects a single JSON array — not 50 separate calls. The Aggregate node collapses multiple items into one.
Two aggregate modes:
- Individual Fields — collect the values of specific fields from all items into arrays. If you have 5 items each with an "email" field, you get one item with an "email" array containing 5 values.
- All Item Data — wrap all items into a single array stored in one output item. The whole list becomes one JSON object you can pass to an API in a single request.
The Aggregate node is the opposite of a trigger or Google Sheets node that expands rows — it compresses back to one. Together these three nodes — Filter, Loop Over Items, Aggregate — give you full control over list processing in any workflow.
- Filter removes non-matching items entirely; unlike IF, there is no second output — dropped items are gone
- Loop Over Items processes items in fixed batches — always pair it with a Wait node to enforce pauses between batches when rate limits apply
- Aggregate combines many items into one — use 'All Item Data' to create a single array for APIs that expect one JSON body instead of many requests