Array Group By
Description
Section titled “Description”The Array Group By node takes an array of objects and groups them by the value of a specified field (dot-notation supported). The result is an object where each key is a unique value found in the field, and its value is the sub-array of matching elements.
For example, given 10 records with country values of ES, FR, and ITA, the node returns 3 sub-arrays, one per country, plus metadata (_groups, _groupCount, _total).
It supports nested fields (address.country), variables from other nodes in the source field, and an optional array format (_groupsArray) for use with the Iterator node.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| source | text | No | Dot-notation path to the array within the data. If empty, uses data directly. Example: items, result.rows |
| groupBy | text | Yes | Dot-notation path of the field to group by. Example: country, address.country, status |
| outputFormat | select | No | object (default): only the grouped object. array: also adds _groupsArray for iteration with Iterator |
Output
Section titled “Output”Default (outputFormat: object)
Section titled “Default (outputFormat: object)”{ "ES": [ { "name": "Ana", "country": "ES" }, { "name": "Luis", "country": "ES" } ], "FR": [ { "name": "Pierre", "country": "FR" }, { "name": "Marie", "country": "FR" } ], "ITA": [ { "name": "Marco", "country": "ITA" } ], "_groups": ["ES", "FR", "ITA"], "_groupCount": 3, "_total": 5, "_ungrouped": 0}With outputFormat: array
Section titled “With outputFormat: array”Adds the _groupsArray field for iteration:
{ "ES": [...], "FR": [...], "ITA": [...], "_groups": ["ES", "FR", "ITA"], "_groupCount": 3, "_total": 5, "_ungrouped": 0, "_groupsArray": [ { "key": "ES", "items": [...], "count": 2 }, { "key": "FR", "items": [...], "count": 2 }, { "key": "ITA", "items": [...], "count": 1 } ]}Usage Examples
Section titled “Usage Examples”Group by country
Section titled “Group by country”{ "label": "Group by Country", "groupBy": "country"}Group by nested field
Section titled “Group by nested field”{ "label": "Group by Province", "groupBy": "address.province"}Array from a previous node + Iterator format
Section titled “Array from a previous node + Iterator format”{ "label": "Group Orders", "source": "orders", "groupBy": "status", "outputFormat": "array"}Then connect to an Iterator on _groupsArray to process each group independently.
Group by status with cross-node reference
Section titled “Group by status with cross-node reference”{ "label": "Group by Status", "source": "{{@SqlQuery.rows}}", "groupBy": "status"}Output Fields
Section titled “Output Fields”| Field | Description |
|---|---|
{key} | Sub-array of elements for each unique value found |
_groups | Array with the names of all found groups |
_groupCount | Total number of distinct groups |
_total | Total number of elements in the original array |
_ungrouped | Number of elements that had no value in the groupBy field (grouped under __sin_valor__) |
_groupsArray | (Only with outputFormat: array) Array of {key, items, count} for iteration |
- Records without a value in the
groupByfield are grouped under the key__sin_valor__ - The
sourcefield supports dynamic variables:{{@NodeName.field}},{{#N.field}} - Does not require credentials
- Compatible with the Iterator node using
_groupsArrayto process each group as a separate flow - If the input is not an array, returns an error with a descriptive message
Related Nodes
Section titled “Related Nodes”- Array Filter — filter array elements by condition
- Iterator — iterate over each group independently
- Key Filter — filter by exact value list
- Edit Fields — transform fields before grouping