Split Out
Unwind a nested array field so that each array element becomes its own item in the output.
The Split Out node takes an array of objects where one field contains a nested array, and "unwinds" that nested array so each element becomes a separate item in the output. This is similar to MongoDB's $unwind operator. Use it to flatten nested structures before processing each sub-item individually -- for example, splitting order line items out of orders, or tags out of articles.
Configuration
Source Array
| Field | Type | Required | Description |
|---|---|---|---|
| Source Array | template string | Yes | Variable path to the array of objects containing the nested array, e.g. nodes.httpRequest_1.body.orders |
The source must resolve to an array. If it resolves to a non-array value, the node fails with a NOT_ARRAY error.
Array Field
| Field | Type | Required | Description |
|---|---|---|---|
| Array Field | text | Yes | Property name on each item that contains the nested array to split out (e.g. tags, lineItems, attachments) |
Include Siblings
| Field | Type | Required | Description |
|---|---|---|---|
| Include siblings | toggle | No | When enabled, each split item is an object containing the unwound value plus the parent object's other fields. When disabled, each split item is just the unwound value itself. Defaults to off. |
Output
| Field | Type | Description |
|---|---|---|
| items | array | The flattened array with one entry per nested element |
| count | number | Total number of items in the output array |
Example
An API returns orders, each with a lineItems array:
[
{ "orderId": "A1", "customer": "Alice", "lineItems": ["Widget", "Gadget"] },
{ "orderId": "A2", "customer": "Bob", "lineItems": ["Sprocket"] }
]- Add a Split Out node.
- Set Source Array to
nodes.httpRequest_1.body.orders. - Set Array Field to
lineItems. - Enable Include siblings.
The output at nodes.splitOut_1.items becomes:
[
{ "orderId": "A1", "customer": "Alice", "lineItems": "Widget" },
{ "orderId": "A1", "customer": "Alice", "lineItems": "Gadget" },
{ "orderId": "A2", "customer": "Bob", "lineItems": "Sprocket" }
]With Include siblings off, the output would be just ["Widget", "Gadget", "Sprocket"].
See the Logic Nodes overview for a full list of available nodes.