← Back to blog

n8n Aggregate node: build and inspect a team-update payload

Use the n8n Aggregate node to collect mock team updates, retain required fields, test missing values and inspect a payload before an optional email step.

A pink tray holds team-update slips beneath a magnifying glass, with a closed envelope farther away.

Checked against the cited sources on .

Prepare the n8n Aggregate node exercise

The n8n Aggregate node can collect team updates into one list for inspection. In this tutorial, you will build a payload with an updates field, examine incomplete records and decide what should happen when there are no updates. Aggregate collects data; it does not write a prose summary.

You need access to an editable n8n workflow. An existing working Gmail credential is needed only for the optional sending step; credential setup and email-body rendering are outside this exercise. n8n's documentation does not state an applicable version or plan, so check the controls available in your workspace.

Our view is that defining an acceptable payload before adding email is the most useful starting point. For this exercise, our suggested acceptance rule is that every update must contain a nonempty owner, status and update.

Sources: n8n-docs/docs/integrations/builtin/core-nodes/n8n-nodes-base.aggregate.md at main · n8n-io/n8n-docs · GitHub, Message Operations | Nodes | n8n Docs

1. Create controlled team updates

Use fictional records so you can recognize exactly what reaches Aggregate. n8n supports creating test datasets with Code or Edit Fields and editing node output. Follow these steps to prepare the illustrative input.

  1. Use Add first step to add a Manual Trigger.
  2. Use the Add node connector to add Edit Fields after the trigger.
  3. Execute Edit Fields to obtain output you can edit.
  4. Open OUTPUT → JSON → Edit, replace the output with the illustrative array below, and select Save.

Use this illustrative JSON array in the output editor: [{"owner":"Mira","status":"on track","update":"Draft ready"},{"owner":"Jon","status":"blocked","update":"Waiting for access"}]. Saving edited output pins it. Mocking, output editing and pinning are development tools; pinned data is unavailable in production executions.

Sources: n8n-docs/docs/build/understand-workflows/workflow-components/work-with-nodes.md at main · n8n-io/n8n-docs · GitHub, n8n-docs/docs/build/work-with-data/pin-and-mock-data.md at main · n8n-io/n8n-docs · GitHub

2. Collect records and inspect the result

Slips gathered into a container under a magnifying glass represent n8n Aggregate node collection and inspection.
The illustration shows the collection-and-inspection sequence used in this section.

Add Aggregate after Edit Fields. Configure the n8n Aggregate node using the settings below, then select Execute step to inspect its output before adding any email action.

Initial Aggregate configuration
SettingValuePurpose
Aggregate modeAll Item DataCollect item data into one list
Put Output in FieldupdatesName the collected list
IncludeAll fieldsRetain every input field

For the illustrative input, the expected collected payload is {"updates":[{"owner":"Mira","status":"on track","update":"Draft ready"},{"owner":"Jon","status":"blocked","update":"Waiting for access"}]}. Check that both records appear inside updates and retain their required fields.

Next, change Include to Specified Fields and enter owner,status,update in Fields To Include. Execute the step again and inspect the retained fields. This selects fields; treat acceptance of their values as a separate review.

Sources: n8n-docs/docs/build/understand-workflows/workflow-components/work-with-nodes.md at main · n8n-io/n8n-docs · GitHub, n8n-docs/docs/integrations/builtin/core-nodes/n8n-nodes-base.aggregate.md at main · n8n-io/n8n-docs · GitHub, Work with nodes

3. Test missing and null fields

Three record sleeves show complete colored inserts, an open gap and a blank insert.
Complete, missing and null inputs are separate test cases to inspect.

Edit the pinned input to omit Jon's update field, save it and execute Aggregate again. Then repeat with "update":null. Inspect each result against the suggested acceptance rule. n8n's documentation does not establish every missing-field representation in All Item Data mode, so record what your workflow produces.

For a separate comparison, switch to Individual Fields and aggregate update. Keep Missing And Null Values adds null entries for missing or null inputs; with it off, null or empty values are ignored. When aggregating multiple individual fields, use Rename Field and distinct Output Field Name values, such as owners and updateTexts.

We'd keep whole records for this exercise because the owner, status and message belong together. Separate arrays deserve extra care when missing entries can change their alignment.

Sources: n8n-docs/docs/build/work-with-data/pin-and-mock-data.md at main · n8n-io/n8n-docs · GitHub, n8n-docs/docs/integrations/builtin/core-nodes/n8n-nodes-base.aggregate.md at main · n8n-io/n8n-docs · GitHub, Aggregate | Nodes | n8n Docs

4. Observe no-update handling

An empty collection basket sits beside a blank placeholder card for the no-update test.
An empty collection and a placeholder item require different interpretations.

Restore All Item Data mode in the n8n Aggregate node before testing no updates. Use the following suggested empty-dataset fixture to replace the pinned normal dataset for this test. n8n's documentation does not establish Aggregate's native zero-input result; observe whether it runs and what output is available.

  1. Select Unpin in the Edit Fields output banner, then disconnect Edit Fields from Aggregate.
  2. Add a Code node and connect Manual Trigger → Code → Aggregate in place of the normal dataset path.
  3. Choose JavaScript and Run Once for All Items in Code. Replace its code with return []; and leave Always Output Data off.
  4. Run the workflow with Gmail still disconnected. Inspect Code's output to check that the fixture produced zero items.
  5. Inspect the same execution to see whether Aggregate executed and whether it has output. Do not treat output from an earlier run as this test's result.

Always Output Data returns an empty item when a node produces no data. That placeholder is different from an empty updates list and must not count as a valid team update. Inspect it before aggregation.

As an editorial policy for this exercise, skip email when there are no acceptable updates. If you add an If branch, choose exists, is empty or is not empty comparisons for the actual data type. Multiple conditions can use AND or OR.

Sources: n8n-docs/docs/build/understand-workflows/workflow-components/work-with-nodes.md at main · n8n-io/n8n-docs · GitHub, n8n-docs/docs/build/work-with-data/pin-and-mock-data.md at main · n8n-io/n8n-docs · GitHub, Work with nodes, If | Nodes | n8n Docs

5. Troubleshoot before optional email

Keep Gmail disconnected or deactivated during testing. Use this review checklist when records disappear or the payload is incomplete.

After inspection passes, optionally connect a configured Gmail node with a working credential. Select Resource Message and Operation Send, then enter the recipient, subject, email type and a reviewed message body. Execute step supports inspecting an upstream node first; it does not enforce an approval gate.

Sources: n8n-docs/docs/build/work-with-data/pin-and-mock-data.md at main · n8n-io/n8n-docs · GitHub, n8n-docs/docs/integrations/builtin/core-nodes/n8n-nodes-base.aggregate.md at main · n8n-io/n8n-docs · GitHub, Work with nodes, n8n-docs/docs/build/understand-workflows/workflow-components/work-with-nodes.md at main · n8n-io/n8n-docs · GitHub, Message Operations | Nodes | n8n Docs

Put this into practice

Hands-on n8n challenges

Pick a challenge and build a working workflow in your own n8n environment, with five progressive tips per challenge.

Try a hands-on challenge

For your team

Custom n8n training programs for one team or department, run on your own n8n instance with your own tools and data.

Training for your team

n8n skills assessment

A free quiz of about 20 minutes: 30 questions in 10 skill areas and a level from Beginner to Expert. On AI Adoption Score, another project by the author of this site.

Get your n8n level