Overview
This lesson is part of the n8n AI Automation - Zero to Hero course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
What does the Aggregate node do in n8n?
The Aggregate node collapses multiple input items into a single output item so downstream nodes receive one record instead of many. It offers two modes: aggregate individual fields (pulling specific values, like order IDs, into a list) or merge all item data into one combined item. A workflow processing 41 pending orders produces exactly one item from the Aggregate node rather than 41, cutting email and Slack notification floods to a single summary message.
How to configure the Aggregate node to send one summary email instead of many
The Aggregate node inserts between your Switch node output and your action node. Disconnect the Send Email or Slack node from its current input, search the node palette for Aggregate, and drop it in the gap. In the node's configuration panel, choose Individual Fields mode, add the field you want to collect (for example, order_id), and rename the output field to something descriptive like pending_order_ids. Testing the step shows one output item containing a single list field holding all 41 order IDs, rather than 41 separate items.
In the downstream Send Email node, switch the body from a fixed value to an expression and drag the aggregated pending_order_ids field into the body. For the subject line, reference $now to append today's date automatically. Connect the Aggregate node's output to the email node and run the workflow: one email goes out listing every pending order ID, instead of 41 individual emails.
n8n's data model still wraps the Aggregate output in an outer list because every node receives a list of items. That outer list contains exactly one item, which itself holds the aggregated field as an inner list. This is expected behavior, not an error, and it is what prevents the downstream action node from iterating and firing once per original record.
Key Takeaways
- The Aggregate node always outputs one item regardless of how many items entered it: 41 pending-order records collapse into a single item with one
pending_order_idslist field. - Individual Fields mode collects specific named field values across all input items into a list; the all-items mode collapses every field from every item into one combined record.
- Inserting the Aggregate node between a Switch branch and a Send Email or Slack node is the direct fix for notification overload: the action node fires once on one item instead of once per record.
- The aggregated list can still contain duplicate values (the transcript shows
OD00001appearing multiple times), so the Remove Duplicates node is the recommended next step when unique values are required downstream. - A practical homework extension: add a second Switch condition checking both
order_priority = highandorder_status = pending or processingso delivered, shipped, cancelled, and refunded orders never reach the operations-team notification branch.
Related Lessons
- Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths
- Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro
- Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data
- Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast
- Lesson 16: How to connect Google Forms & Webhook Node in n8n | Google Forms Integration
Next Steps
Continue your n8n journey with the full n8n AI Automation - Zero to Hero course.