Skip to main content

Aggregate

Groups items and performs aggregation operations like SUM, AVG, COUNT, and more.

Overview​

The Aggregate node collects all input items and produces summary results. Use it to:

  • Calculate totals and averages
  • Group data by categories
  • Find minimum and maximum values
  • Count items or distinct values
  • Collect values into arrays or objects

Parameters​

ParameterDescriptionRequired
Group ByFields to group items byNo
AggregationsList of aggregation operationsNo
Include Group FieldsAdd group keys to outputNo
Fuzzy CompareCase-insensitive, trimmed groupingNo

Group By​

When specified, items are grouped by the values of these fields. Each unique combination produces one output item.

Leave empty to aggregate all items into a single result.

Aggregations​

Each aggregation specifies:

PropertyDescription
Input FieldThe field to aggregate (or * for whole item)
OperationThe aggregation function
Output FieldName for the result
OptionsOperation-specific settings

Aggregation Operations​

OperationDescriptionOptions
SUMTotal of numeric values-
AVGAverage of numeric values-
MINMinimum value-
MAXMaximum value-
COUNTNumber of items-
COUNT_DISTINCTNumber of unique values-
JOINConcatenate string valuesdelimiter (default: ", ")
COLLECT_ARRAYGather values into arraydistinct, flatten
COLLECT_OBJECTBuild object from key-value pairskeyField
FIRSTFirst value in group-
LASTLast value in group-

Default Behavior​

If no aggregations are specified, the node collects all items into a single array using COLLECT_ARRAY.

Output​

One item per group (or one item if no grouping):

Input items:

[
{ "category": "A", "amount": 100 },
{ "category": "A", "amount": 200 },
{ "category": "B", "amount": 150 }
]

Group By: category Aggregation: SUM of amount as total

Output:

[
{ "category": "A", "total": 300 },
{ "category": "B", "total": 150 }
]

Examples​

Total All Items​

Sum all amounts without grouping:

  1. Leave Group By empty
  2. Add Aggregation:
    • Input Field: amount
    • Operation: SUM
    • Output Field: grandTotal

Output: { "grandTotal": 450 }

Group by Category​

Calculate totals per category:

  1. Group By: category
  2. Enable Include Group Fields
  3. Add Aggregations:
    • SUM of amount as total
    • COUNT as count

Collect Unique Values​

Get all unique tags:

  1. Add Aggregation:
    • Input Field: tag
    • Operation: COLLECT_ARRAY
    • Output Field: allTags
    • Options: distinct: true

Join Names​

Create comma-separated list:

  1. Add Aggregation:
    • Input Field: name
    • Operation: JOIN
    • Output Field: nameList
    • Options: delimiter: ", "

Multiple Aggregations​

Calculate statistics per region:

  1. Group By: region
  2. Add Aggregations:
    • SUM of sales as totalSales
    • AVG of sales as avgSales
    • MIN of sales as minSale
    • MAX of sales as maxSale
    • COUNT as orderCount

Build Lookup Object​

Create a mapping from items:

  1. Add Aggregation:
    • Input Field: *
    • Operation: COLLECT_OBJECT
    • Output Field: lookup
    • Options: keyField: "id"

Output: { "lookup": { "1": {...item1...}, "2": {...item2...} } }

Tips​

  • Aggregate runs once for all items (single execution mode)
  • Use "Fuzzy Compare" for case-insensitive grouping
  • COUNT doesn't need an input field
  • Empty groups are not included in output
  • Null values are typically excluded from calculations
  • Use COLLECT_ARRAY with flatten: true (default) to flatten nested arrays