List - Aggregate
Type identifier:
list:aggregateCategory: List Operations
Description
Aggregates list data using count, countDistinct, sum, avg, min, and max. Supports optional grouping and can return either the first aggregate row or the full result list.
To count or total stored Records, without loading them into the flow first, use Object - Query with a select/groupBy shape: it aggregates in the database, over every matching Record and over relationships. Use this node for lists the flow already holds.
Input Handles
Handle | Data Type | Required | Description |
|---|---|---|---|
|
| Yes | Source list to aggregate |
Output Handles
Handle | Data Type | Description |
|---|---|---|
|
| Aggregation output ( |
Configuration Options
Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
| Yes |
| Display label for the node |
|
| No |
| Optional source schema identifier |
|
| Yes (runtime) |
| Input handle definition for source list |
|
| No |
| Grouping fields and output aliases |
|
| Yes |
| Aggregation operations |
|
| No |
| Return first row object instead of full array |
Supported Aggregation Functions
countcountDistinctsumavgminmax
Behaviour
Execution Flow
- Validates that
sourceexists and at least one aggregation is configured. - Reads the list from the
sourceinput. - Validates source is a non-null array.
- Groups rows by
groupByfields (or a single group when ungrouped). - Computes all configured aggregation functions per group.
- Returns first row (
firstOnly: true) or all rows (firstOnly: false).
Aggregation Details
count: number of rows in group.countDistinct: unique value count forsourcePath; withoutsourcePath, same ascount. Duration values that compare equal count as one value, soP1M,P30DandPT720Hare a single distinct value.sum: numeric sum; returns0when no numeric values are present.avg: numeric average; returnsnullwhen no numeric values are present.min/max: numeric min/max. When the field holds no numeric values, durations are compared instead, using the same 30-day rule as filtering and sorting — see Schema Field Types Reference — Sorting and Filtering. The duration is returned exactly as stored, so a minimum ofP1Mcomes back asP1Mrather thanP30D; values that tie fall back to the stored text. Returnsnullwhen neither numeric nor duration values are present.
Edge Cases
Scenario | Behaviour |
|---|---|
Empty source array with no | Returns one aggregate row (for example |
| Throws |
Source resolves to | Throws |
Source resolves to non-array | Throws |
No aggregations configured | Throws |
Examples
Count All Rows
{
"type": "list:aggregate",
"data": {
"label": "Count All",
"groupBy": [],
"aggregations": [{ "id": "agg1", "function": "count", "alias": "count" }],
"firstOnly": true
}
}Possible output:
{ "count": 42 }Grouped Sum
{
"type": "list:aggregate",
"data": {
"label": "Total by Category",
"groupBy": [{ "id": "grp1", "path": "category", "alias": "category" }],
"aggregations": [{ "id": "agg1", "function": "sum", "sourcePath": "amount", "alias": "total" }],
"firstOnly": false
}
}Possible output:
[
{ "category": "A", "total": 120 },
{ "category": "B", "total": 85 }
]