> For the complete documentation index, see [llms.txt](https://docs.brigge.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brigge.ai/documentation/brigge-for-transformers/pipelines/pipeline-nodes/split-node.md).

# Split node

## Overview

The *Split* node extracts items from an incoming payload at a given point in the payload structure. Extracted items can be removed from the payload, or batched into separate payloads for onward processing.&#x20;

{% hint style="info" %}
If you choose to split items into separate payloads, each one is passed to the next step in the pipeline and processed in sequence.
{% endhint %}

A common use case is splitting a payload into single-item batches, so records are subsequently processed one at a time. Consider the example below:

{% code overflow="wrap" lineNumbers="true" %}

```json
{
  "timesheets": [
    { "id": 1, "name": "Alice Carter", "days_to_invoice": 3 },
    { "id": 2, "name": "Brian Foster", "days_to_invoice": 7 },
    { "id": 3, "name": "Diana Reyes", "days_to_invoice": 2 },
    { "id": 4, "name": "Marcus Lee", "days_to_invoice": 14 },
    { "id": 5, "name": "Priya Nair", "days_to_invoice": 5 }
  ]
}
```

{% endcode %}

Here, one payload contains five timesheet records. Using the `split` shape, we can extract each timesheet record into its own payload - so five payloads in all:

{% code overflow="wrap" lineNumbers="true" %}

```json
{ "id": 1, "name": "Alice Carter", "days_to_invoice": 3 }
```

{% endcode %}

{% code overflow="wrap" lineNumbers="true" %}

```json
{ "id": 2, "name": "Brian Foster", "days_to_invoice": 7 }
```

{% endcode %}

{% code overflow="wrap" lineNumbers="true" %}

```json
{ "id": 3, "name": "Diana Reyes", "days_to_invoice": 2 }
```

{% endcode %}

{% code overflow="wrap" lineNumbers="true" %}

```json
{ "id": 4, "name": "Marcus Lee", "days_to_invoice": 14 }
```

{% endcode %}

{% code overflow="wrap" lineNumbers="true" %}

```json
{ "id": 5, "name": "Priya Nair", "days_to_invoice": 5 }
```

{% endcode %}

## Configuring a split node

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2Fv6S12gwYnzfcE8FdzpL9%2FNode%20-%20split.svg?alt=media&amp;token=a672f99f-e9ae-4e21-857b-23ab6d75292d" alt=""><figcaption></figcaption></figure></div>

Configuration options for the `split` node are summarised below:

{% stepper %}
{% step %}
**Schema**

Select the schema associated with the payload structure you expect the `split` node to receive.

{% hint style="info" %}
You don't have to provide a schema, but it's useful for navigating the expected payload structure to set the `split element`.
{% endhint %}
{% endstep %}

{% step %}
**Split element**

The `split element` is the point at which you want to start splitting the payload.&#x20;

<details>

<summary>Example</summary>

<pre class="language-json" data-overflow="wrap" data-line-numbers><code class="lang-json">{
  "batch_ref": "20260601",
<strong>   "timesheets": [
</strong>    { "id": 1, "name": "Alice Carter", "days_to_invoice": 3 },
    { "id": 2, "name": "Brian Foster", "days_to_invoice": 7 },
    { "id": 3, "name": "Diana Reyes", "days_to_invoice": 2 },
    { "id": 4, "name": "Marcus Lee", "days_to_invoice": 14 },
    { "id": 5, "name": "Priya Nair", "days_to_invoice": 5 }
  ]
}
</code></pre>

Here, choosing to split this payload at the `timesheets` array element will create payloads (of your given batch size) from the array items.&#x20;

</details>

If you selected a schema in the previous step, use the dropdown data path to select the required data element to split - for example:

<div align="left"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FcTD8buxYRxOHjBjYjxpH%2FSplit%20-%20schema%20example%202.png?alt=media&amp;token=317241be-25e5-4cbd-880d-137d8fb99e73" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
Without a schema, you can enter a dot notation path to the required field manually.
{% endhint %}
{% endstep %}

{% step %}
**Split behaviour**

Define what action to take with extracted items:

<table><thead><tr><th width="224.4886474609375">Option</th><th>Summary</th></tr></thead><tbody><tr><td>Keep this</td><td>Batch the extracted items into payloads for onward processing. The number of payloads is determined by your specified <code>batch size</code>.</td></tr><tr><td>Remove this</td><td>Remove the extracted items before the payload moves on for processing. </td></tr></tbody></table>
{% endstep %}

{% step %}
**Batch size**

If you have chosen to keep extracted items, use this option to determine the number of items for each ongoing payload.&#x20;

<details>

<summary>Example</summary>

<pre class="language-json" data-overflow="wrap" data-line-numbers><code class="lang-json">{
  "batch_ref": "20260601",
<strong>   "timesheets": [
</strong>    { "id": 1, "name": "Alice Carter", "days_to_invoice": 3 },
    { "id": 2, "name": "Brian Foster", "days_to_invoice": 7 },
    { "id": 3, "name": "Diana Reyes", "days_to_invoice": 2 },
    { "id": 4, "name": "Marcus Lee", "days_to_invoice": 14 },
    { "id": 5, "name": "Priya Nair", "days_to_invoice": 5 }
  ]
}
</code></pre>

Here, choosing to split this payload at the `timesheets` array element will extract 5 items.

Setting `batch size` to 5, results in 1 payload containing 5 items:

{% code overflow="wrap" lineNumbers="true" %}

```json
[
  {
    "id": 1,
    "name": "Alice Carter",
    "days_to_invoice": 3
  },
  {
    "id": 2,
    "name": "Brian Foster",
    "days_to_invoice": 7
  },
  {
    "id": 3,
    "name": "Diana Reyes",
    "days_to_invoice": 2
  },
  {
    "id": 4,
    "name": "Marcus Lee",
    "days_to_invoice": 14
  },
  {
    "id": 5,
    "name": "Priya Nair",
    "days_to_invoice": 5
  }
]
```

{% endcode %}

Setting `batch size` to 1, results in 5 payloads, each containing 1 item:

{% code overflow="wrap" lineNumbers="true" %}

```json
[
  {
    "id": 1,
    "name": "Alice Carter",
    "days_to_invoice": 3
  }
]
```

{% endcode %}

</details>
{% endstep %}

{% step %}
**Unwrap single array**

When a `batch size` of `1` is set to create single-item payloads from an input array, the default output is to wrap each item in an array. For example:

<pre class="language-json" data-overflow="wrap" data-line-numbers><code class="lang-json"><strong>[
</strong>  {
    "id": 1,
    "name": "Alice Carter",
    "days_to_invoice": 3
  }
<strong>]
</strong></code></pre>

To remove the array, toggle the `unwrap single array` option to `on`. The resulting payload contains just the extracted element, for example:

<pre class="language-json" data-overflow="wrap" data-line-numbers><code class="lang-json">{
    "id": 1,
    "name": "Alice Carter",
    "days_to_invoice": 3
<strong>}
</strong></code></pre>

{% endstep %}

{% step %}
**Parent fields**

Use this option to inject parent field values into each split payload.
{% endstep %}
{% endstepper %}
