Type identifier:
list:aggregateCategory: List Operations
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.
Handle | Data Type | Required | Description |
|---|---|---|---|
|
| Yes | Source list to aggregate |
Handle | Data Type | Description |
|---|---|---|
|
| Aggregation output ( |
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 |
countcountDistinctsumavgminmaxsource exists and at least one aggregation is configured.source input.groupBy fields (or a single group when ungrouped).firstOnly: true) or all rows (firstOnly: false).count: number of rows in group.countDistinct: unique value count for sourcePath; without sourcePath, same as count. Duration values that compare equal count as one value, so P1M, P30D and PT720H are a single distinct value.sum: numeric sum; returns 0 when no numeric values are present.avg: numeric average; returns null when 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 of P1M comes back as P1M rather than P30D; values that tie fall back to the stored text. Returns null when neither numeric nor duration values are present.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 |
{
"type": "list:aggregate",
"data": {
"label": "Count All",
"groupBy": [],
"aggregations": [{ "id": "agg1", "function": "count", "alias": "count" }],
"firstOnly": true
}
}Possible output:
{ "count": 42 }{
"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 }
]