Split in Batches
Split in Batches
Section titled “Split in Batches”Walk through a list a fixed number of items at a time, running the steps in its Loop branch once for each batch, then continue from Done when the list is exhausted.
What it does
Section titled “What it does”Give it a list and a batch size. On each pass it hands the next slice of the list to its Loop branch and waits for that branch to finish before taking the next slice. When every item has been processed it stops looping and control moves to the Done branch.
Where the Loop node repeats until a condition goes false, Split in Batches repeats until it has walked the whole list — you don’t write a condition, you point it at the data.
When to use it
Section titled “When to use it”- Process a large list in manageable chunks — e.g. send 10 rows at a time to an API that rejects big payloads.
- Page through results without holding everything in memory at once.
- Run a per-item action (enrich, notify, write a record) where the body should see one small group at a time.
Inputs and settings
Section titled “Inputs and settings”| Setting | Notes |
|---|---|
| Items | The list to split into batches, e.g. {{ $input.rows }}. A single (non-array) value is treated as one batch of one; an empty or missing list goes straight to Done. |
| Batch size | How many items to hand the body each pass. Default 1. |
- Loop — runs once per batch. Wire the end of the branch back into the node’s Loop Back input so the next batch runs.
- Done — runs once, after the last batch, when the list is exhausted.
What the body receives
Section titled “What the body receives”On each pass, the Loop branch’s $input is the current batch state:
| Field | Meaning |
|---|---|
batch | The items in this batch — use {{ $input.batch }}. |
batchIndex | Zero-based number of the current batch. |
isLast | true on the final batch. |
items | The full original list. |
The Done branch also receives items, so {{ $input.items }} gives you the original list to continue with.
Example
Section titled “Example”Splitting 7 rows with a batch size of 3 runs the body three times — [0,1,2], [3,4,5], [6] — and then continues from Done.
flowchart LR
S["Split in Batches"] -- Loop --> B["Call API with $input.batch"]
B -- Loop Back --> S
S -- Done --> N["Continue with $input.items"]
Good to know
Section titled “Good to know”- Runs are bounded. As a safety net the node stops after 1000 passes even if the list is longer, matching the Loop node’s cap, so a runaway can’t freeze the tab.
- Durable pagination. If a run is paused (or the tab is closed) mid-loop, its batch position is saved with the run and resumes at the right batch — you don’t restart from the first batch.