Skip to content

Split In Batches

Overview

The Split In Batches node divides an incoming array into fixed-size chunks and emits each chunk sequentially or in parallel downstream, enabling rate-limited or parallelized processing of large lists. Use it when a downstream node (such as an AI model call or external API) has throughput limits, or when fan-out parallelism over a list is needed. Each emitted batch retains the original item order within the chunk. The node tracks batch index and total count so downstream nodes can detect the final batch and merge results.

Configuration

FieldTypeRequiredDescription
batchSizenumberYesNumber of items per batch. Must be a positive integer. Downstream nodes receive exactly this many items per emission, except the final batch which may be smaller.
modeenumYesProcessing mode. 'sequential' emits one batch at a time and waits for downstream completion before emitting the next. 'parallel' emits all batches simultaneously.
inputPathstringNoDot-notation path into the input object to locate the array to split (e.g. 'data.results'). Defaults to the root value if the input itself is an array.
continueOnEmptybooleanNoWhen true, the node emits a single empty batch and continues execution if the input array is empty. When false (default), execution halts without emitting.

Inputs

PortTypeDescription
inputarray or objectThe data payload containing the array to split. If the root value is an array it is used directly; otherwise provide inputPath to locate the array within the object.

Outputs

PortTypeDescription
batchobjectEmitted once per chunk. Contains 'items' (the batch array), 'batchIndex' (zero-based), 'totalBatches' (total chunk count), and 'isLast' (boolean).
doneobjectEmitted once after all batches have been processed. Contains 'totalItems' and 'totalBatches' for downstream aggregation or merge nodes.
errorobjectEmitted if the resolved input is not an array or if batchSize is invalid. Contains 'message' and 'inputPath' for debugging.

Example

json
{
  "nodeType": "split_in_batches",
  "config": {
    "batchSize": 10,
    "mode": "sequential",
    "inputPath": "data.lensOutputs",
    "continueOnEmpty": false
  }
}