Skip to content
Agentic Workflowdocs
v0.9.0Install free

nodes / builtin / flow

Split in Batches

Loop over a list a batch at a time, running the body once per batch

Flow ExtensionWeb app

Work through a list a few items at a time, running the same steps once per batch.

Split in Batches works like Loop, but instead of a condition you give it a list. It has two inputs and two outputs:

  • Input (top): where the data first comes in.
  • Loop Back (bottom input): connect the last step of the repeated part here.
  • Loop (output): gets the next batch; the steps to repeat start here.
  • Done (output): runs once, after the last batch.

On each pass it sends the next Batch size items out of Loop and waits for them to come back through Loop Back before sending the next ones. With 7 items and a batch size of 3, the steps run three times, with items 1-3, 4-6 and 7, then the workflow continues from Done.

  • An empty list goes straight to Done. A single value that is not a list counts as one batch of one item.
  • As a safety limit, the node stops after 1,000 passes, even if items are left.
  • If the run pauses in the middle (for example on a Wait For Approval inside the loop), it resumes at the right batch.
  • Send rows to an API 10 at a time because it rejects large requests.
  • Ask for an approval or show a form once per item (batch size 1).
  • Slow down: add a Wait inside the loop so a site or API isn’t hit too fast.

Most nodes already run once per item, so you don’t need Split in Batches just to handle every item of a list. To repeat until a condition changes, use Loop.

SettingTypeWhat it does
Items (required)ValueThe list to split into batches.
Batch size NumberHow many items to emit per pass. Default: 1
Collect results ToggleOutput everything that came back through Loop Back, in order, on Done. Default: Off
One entry per item ToggleUsed with Collect results: a pass that returns a list adds its items one by one. Off: one entry per pass. Default: On
Fail if the pass limit is reached ToggleFail the step when 1,000 passes end the split before every item was processed. Default: Off

Set Items to an expression that returns a list, for example {{ $input.data.contacts }} after an Http Request. If your data arrives as many separate items, gather them into one list first with Aggregate.

Turn on Collect results to get, on Done, everything that came back through Loop Back during the passes, in order, as results (one entry per item, or per pass). Without it, Done only carries the last data, as before. Up to 10,000 entries (about 2 MB) are kept; beyond that the list is cut, resultsTruncated is set and the run log warns you. Nested loops each keep their own results.

The node stops after 1,000 passes. When that happens before every item was processed, it says so (a warning, and stoppedEarly, processed and total on each pass). Turn on Fail if the pass limit is reached to make it fail the step instead, so a cut-short run can’t pass for a complete one.

  • Done
  • Loop

Each output item has these fields:

FieldTypeWhat it holds
done True/falseTrue once every item has been emitted
batch ListThe items of this pass
batchIndex Number
isLast True/false
items ListEvery item being split
processed NumberHow many items have been emitted so far
total NumberHow many items there are to split
stoppedEarly True/falseTrue on the Done pass when the pass limit stopped the split before the end
results ListWith Collect results: what came back through Loop Back on every pass
resultsTruncated True/falseTrue when Collect results stopped at its limit
Shape of an output item
{
"done": true,
"batch": [],
"batchIndex": 0,
"isLast": true,
"items": [],
"processed": 0,
"total": 0,
"stoppedEarly": true,
"results": [],
"resultsTruncated": true
}

In the repeated steps, read the current batch with {{ $input.batch }}. batchIndex counts batches from 0, and isLast is true on the final batch. From Done, {{ $input.items }} still gives you the whole list.

None. This node needs no connection and has no slots for other nodes.

Send contacts to an API 25 at a time:

  1. Http Request gets https://api.example.com/contacts, which returns { "contacts": [...] }.
  2. Split in Batches with Items {{ $input.data.contacts }} and Batch size 25.
  3. From Loop: a second Http Request, POST to https://api.example.com/contacts/bulk with {{ $input.batch }} in the JSON body, then Wait with Amount 2 and Unit Seconds. Connect the Wait to Loop Back.
  4. From Done: Show Notification says All contacts sent.
  • The steps run only once. The last repeated step is not connected to Loop Back, so the node never gets asked for the next batch. Connect it to the bottom input, not the top one.
  • It goes straight to Done. Items resolved to an empty list or to nothing. Check the expression in the run’s input for this node; it must point to a list.
  • Nothing runs after the loop. Connect the next steps to Done, not to Loop.
  • It stopped before the end of a very long list. The node stops after 1,000 passes. Raise Batch size so the list fits in fewer passes.
  • Loop: repeat while a condition holds.
  • Split Out: turn a list field into separate items, without looping.
  • Wait: pause between batches.
  • Aggregate: gather items back into one list.
Edit page

Last updated:

Was this page useful?
Ask Aria about Split in Batches