n8n aggregate node
n8n has a built-in tool called “Aggregate” that can be used to combine several items (or fields from several items) into a single item. When making reports, grouped recaps, or preparing batched payloads for APIs, the node is a must.
Before we start, if you are looking for help with a n8n project, we are taking on customers. Head over to our n8n Automation Engineer page.
What the Aggregate Node Does
Combine items: turns many items into one or a few grouped results.
Aggregate modes:
Individual Fields: aggregate specific fields with chosen operations.
All Item Data: collect entire items into an array within a single field.
Group-by capability: aggregate per unique value of a field (like grouping by customer, category, or date).

Node Parameters
Choosing Aggregate Mode
When configuring the node, start by selecting which Aggregate type you want:
Individual Fields
Aggregate specific fields independently (e.g., sum numbers, count unique values, collect strings).
Parameters:
Input Field Name: the field in the incoming items to aggregate.
Rename Field: toggle on if you want to give the aggregated result a different field name.
Output Field Name: required if renaming or aggregating multiple fields. Prevents overwriting.


All Item Data
Aggregate full items into one list inside a single field.
Parameters:
Put Output in Field: the field where the aggregated list should be stored (e.g.,
orders
).Include: choose what to include in the list:
All fields: include all input data.
Specified Fields: include only certain fields (comma-separated list in Fields To Include).
All Fields Except: include everything except listed fields (comma-separated list in Fields To Exclude).

Node Options (advanced configuration)
Both modes have extra options that give you more control:
Disable Dot Notation (Individual Fields)
Prevents referencing nested fields using dot notation (parent.child
). Useful if your field names contain dots.Merge Lists (Individual Fields)
If the field you’re aggregating is already a list, turning this on flattens lists into a single array instead of creating an array of arrays.Include Binaries (All modes)
Carry over binary data (files, images, etc.) into the aggregated output.Keep Missing And Null Values (Individual Fields)
By default, null/missing values are skipped. Toggle this on if you wantnull
placeholders in the aggregated results.

Typical Use Cases
Summarize a column: sum all
amount
fields from DB rows.Group orders by customer: collect all orders into one item per customer.
Batch API payloads: prepare a single array of items to send in one request.
Unique value counts: count distinct categories or tags.
Example 1
Let’s look at a basic example illustrating n8n aggregate node.
Here we return all the amount in a json data.
Lets start by adding the manual trigger node and adding the following json as dummy text.
[
{ "customer": "Alice", "orderId": 101, "amount": 50 },
{ "customer": "Bob", "orderId": 102, "amount": 30 },
{ "customer": "Alice", "orderId": 103, "amount": 20 }
]

Next, we add the aggregate node, and select Individual Fields as the field to aggregate.
Then, we select the amount (drag and drop in the amount into the Input Field Name).
Ensure you have executed the previous workflow so you can see the JSON data to drag and drop.
After executing the work flow, you should see the output with just the amount grouped in a list.

Full flow

Example 2
Here we look at another example grouping all the data into a single list.
We start by adding the code node.
copy and paste the javascript return code.
return [
{ json: { customer: 'Alice', orderId: 101, amount: 50 } },
{ json: { customer: 'Bob', orderId: 102, amount: 30 } },
{ json: { customer: 'Alice', orderId: 103, amount: 20 } },
];

Next, we add the aggegate node.
Parameters:
Aggregate: we select “All Item Data (into a Single List)
Put Output in Field: we type in any output name we want. In this example we type in Payments.
Include: Here, we select All Fields Except. This is useful for excluding the fields we dont want to aggregate.
Fields To Exclude: Here we can type the field we want to exclude in this case “customer” or we can drag and drop it provided we have executed the previous node.

Full flow

After excecuting the flow, we get the following output
[
{
"Payments": [
{
"orderId": 101,
"amount": 50
},
{
"orderId": 102,
"amount": 30
},
{
"orderId": 103,
"amount": 20
}
]
}
]
Example 3
Let’s do another example where we group all the Artist from a google sheet data.
Here, we get data from google sheet.
I alresdy have some data on my google sheet. all i did was use the Get row(s) in sheet node

Next we connect the aggregate node.
Then we set the following parameters:
Input Field Name: Band

Full flow

After execution, we should have the following output:
[
{
"Artist": [
"Nine Inch Nails",
"Rivers of Nihil",
"Matt Maeson",
"City and Colour",
"Gojira",
"Mastodon",
"The Glorious Sons",
"Invent Animate",
"Billy Strings",
"Queens of the Stone Age"
]
}
]
Example 4
In this example, we go one step further by adding another node after the aggregate node to perform a sepcific task.
First lets return our data with code node

Next, we aggregate. i.e we select the amount as the input field name (either by typing it or draging and dropping it after executing the previous node).

Next we use a code node to perform some basic calculations and return the result.
We select Python as the language and write the following code:
We sum the amounts: sum(amounts)
We get the min amount: min(amounts)
We get the max amount: max(amounts)
We get the average amount: total / len(amounts) if amounts else None
# Access the first input item
data = items[0]['json']
# Get the list of numbers from the "amount" key
amounts = data['amount']
# Basic statistics
total = sum(amounts)
min_val = min(amounts)
max_val = max(amounts)
avg = total / len(amounts) if amounts else None
# Return as a new n8n item
return [{
"json": {
"total": total,
"min": min_val,
"max": max_val,
"avg": avg
}
}]

Full flow

After execution, we get the following output:
[
{
"total": 100,
"min": 20,
"max": 50,
"avg": 33.333333333333336
}
]
Final thought
The Aggregate node in n8n is a powerful way to reshape and summarize data. It can either group items by a field (great for reports, counts, and totals) or collect all incoming items into a single structured list (perfect for bundling results before sending them to another system like an API or email).
Its flexibility makes it one of the most useful “data wrangling” tools in n8n — turning raw streams of items into organized, consumable outputs. Whether you’re building dashboards, preparing data for APIs, or just simplifying multiple records, the Aggregate node is often the glue that makes workflows more intelligent and efficient.
Thank you for reading this article. Make sure to check out our other n8n content on the website. If you need any help with n8n workflows we are taking on customers so reach out