Summarize
Group items by one or more fields and compute aggregation statistics like sum, average, min, max, count, and concatenate.
The Summarize node groups an array of items by specified fields and computes aggregation functions on each group. It is the logic-node equivalent of a SQL GROUP BY with aggregate functions.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
| sourcePath | string | Yes | Variable path to the source array (e.g., {{httpRequest_1.body.orders}}). |
| groupBy | string[] | No | Array of field names to group by. When empty, all items are treated as a single group. |
| aggregations | AggregationRow[] | Yes | One or more aggregation definitions (see below). |
Aggregation Row
Each aggregation row defines one computation to perform per group.
| Property | Type | Required | Description |
|---|---|---|---|
| field | string | Yes | The field name to aggregate on. |
| operation | enum | Yes | One of: count, countUnique, sum, avg, min, max, concatenate. |
| outputKey | string | No | Custom key for the result. Defaults to {operation}_{field} (e.g., sum_amount). |
| separator | string | No | Separator string for the concatenate operation. Defaults to ", ". |
Operations
- count -- Total number of items in the group.
- countUnique -- Number of distinct values (compared by JSON serialization).
- sum -- Numeric sum. Non-numeric values are skipped.
- avg -- Numeric average. Non-numeric values are skipped.
- min -- Smallest numeric value. Returns
nullif no numeric values exist. - max -- Largest numeric value. Returns
nullif no numeric values exist. - concatenate -- Joins all values into a single string using the configured separator.
Output
| Field | Type | Description |
|---|---|---|
| results | array | Array of result objects. Each object contains the group-by field values plus one key per aggregation. |
| groupCount | number | Number of distinct groups. |
| totalItems | number | Total number of items in the source array. |
Example
Given an orders array, group by region and compute the total revenue and order count per region.
Source Path: {{httpRequest_1.body.orders}}
Group By: ["region"]
Aggregations:
- field: revenue, operation: sum, outputKey: totalRevenue
- field: id, operation: count, outputKey: orderCountThe output results array will contain one object per region:
[
{ "region": "US", "totalRevenue": 5200, "orderCount": 42 },
{ "region": "EU", "totalRevenue": 3100, "orderCount": 28 }
]