Array Operations
Overview
The Array Operations node provides a comprehensive set of in-memory array transformations for workflow data. It operates on upstream arrays without hitting a database — pure JavaScript transforms applied to each row or the full dataset.
Category
Data — data/arrayOps
Operations
| Operation | Description |
|---|---|
| flatten | Flatten nested arrays into a single level |
| unique | Remove duplicate values from an array |
| chunk | Split an array into groups of a specified size |
| compact | Remove falsy values (null, undefined, 0, false, '') |
| zip | Combine multiple arrays element-by-element |
| unzip | Inverse of zip — split zipped arrays back apart |
| intersection | Return elements common to two arrays |
| difference | Return elements in array A that are not in array B |
| union | Combine two arrays, removing duplicates |
| groupBy | Group rows by a field value |
| sortBy | Sort rows by a field |
| reverse | Reverse the order of rows |
| slice | Extract a portion of the array by index range |
| sample | Return a random subset of rows |
| shuffle | Randomize the order of rows |
| pluck | Extract a single field from each row into a flat array |
Settings
| Setting | Type | Default | Description |
|---|---|---|---|
| operation | String | flatten | Which array operation to perform |
| field | String | — | Field name for groupBy, sortBy, pluck |
| size | Number | 10 | Chunk size for chunk operation |
| count | Number | 1 | Number of items for sample |
| start | Number | 0 | Start index for slice |
| end | Number | — | End index for slice |
Inputs & Outputs
- input1 — Upstream data array
- output1 — Transformed array
Use Cases
- Group orders by status — Use
groupBywith fieldstatusto bucket orders intopending,shipped,delivered - Deduplicate email lists — Use
uniqueon a plucked email field to remove duplicate addresses - Paginate results — Use
slicewith start/end to return a specific page of results - Randomize survey questions — Use
shuffleto randomize question order