Aggregate
Collapse multiple items into a single array or collect individual field values into separate arrays.
The Aggregate node takes an array of items and groups them into a single output. Use it to collect results from loops, batch API responses, or consolidate data before further processing.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
| sourcePath | string | Yes | Variable path to the source array (e.g., {{httpRequest_1.body.items}}). |
| mode | enum | No | allItemData (default) wraps all source items into a single array. individualFields collects specified fields from each item into separate arrays. |
| fields | string[] | When mode is individualFields | List of field names to extract from each item. Each field becomes its own array in the output. |
Modes
All Item Data -- Wraps every item in the source array into a single aggregated array. No transformation is applied; items are forwarded as-is.
Individual Fields -- Extracts named fields from each item and groups them into per-field arrays. For example, if you specify fields name and score, the output will contain aggregated.name as an array of all name values and aggregated.score as an array of all score values. Primitive items are wrapped as { value: item } so that field extraction still works.
Output
| Field | Type | Description |
|---|---|---|
| aggregated | array or object | In allItemData mode, the full source array. In individualFields mode, an object where each key is a field name mapped to an array of values. |
| itemCount | number | Total number of items in the source array. |
| fieldCount | number | Number of fields collected. Only present in individualFields mode. |
Example
A workflow fetches paginated API results using a Loop node. Each iteration returns 20 records. After the loop, the Aggregate node collects all records into a single array for a bulk database insert.
Source Path: {{loop_1.results}}
Mode: All Item DataThe output aggregated contains all records concatenated into one flat array.