IronFlowDocs

batch

Split an array into chunks of a specified size.

Parameters

source_keystringrequired
Context key holding the source array
output_keystringrequired
Context key where the array of batches will be stored
sizeintegerrequired
Number of items per batch. Must be greater than 0.

Context Output

  • {output_key} — an array of arrays, where each inner array contains up to size items. The last batch may contain fewer items.
  • {output_key}_count — number of batches produced

Example

flow:step("chunk", nodes.batch({
    source_key = "all_records",
    size = 50,
    output_key = "batches"
})):depends_on("fetch_records")

IronFlow documentation

Find the next step

Type a keyword to search the documentation.

to move · Enter to open · Esc to close