Iterate

Splits an array into individual events. Each element becomes a separate downstream event.

Configuration

- iterate:
    name: split_records

Fields

FieldTypeDefaultDescription
namestringrequiredTask name.
iterate_keystringKey to extract the array from a JSON object. Without this, the entire event data is treated as an array.
depends_onlistUpstream task names.
retryobjectRetry configuration.

Output

FormatCrateDescription
JSONelement typeOne event per element from the iterated array. Each element becomes event.data for downstream tasks.

Examples

Split entire event (event data is an array):

- iterate:
    name: split

Input: [{id: 1}, {id: 2}, {id: 3}] produces three separate events.

Extract and split a nested array:

- iterate:
    name: split_records
    iterate_key: records

Input: {total: 3, records: [{id: 1}, {id: 2}]} produces two events from the records array.