EXECUTION_FLOW, id 1101) walks a JSON array on the previous command’s data field, one element at a time. Each iteration runs the nested body: allowlisted PARSE commands, optionally ending with one sink. With a sink, each element is published as its own sink payload; without one, For only transforms and collects the results. For does not create Items or set children.
Command Type
Command Type:EXECUTION_FLOW
Command Type ID: 1101
Input
data from the previous command must already be a JSON array. For has no selector of its own.
Parameters
There is no selector field and no operator-configurable iteration cap. The cap is 1000 elements.
Locals
Each iteration binds these local variables (they do not write tostate):
JSONata 1022 receives the current item as its input. The same names are also available in
local_variables (${local.item}, ${local.index}, ${local.parent}) and in the JSONata environment.
Copy envelope fields you still need (for example a bookmaker id) into state before you extract the array onto data.
Output
For returns the same shape as HTTP parallel 1002 / 1004:error after For to separate failed elements from results, the same way as failed requests in HTTP parallel 1002.
For does not create Items and does not set children. Hash, miss, and retry stay on the listing Item. To fan out into children, add an explicit PARSE after For.
Commands after For are allowed, including another PARSE over aggregatedResults or another sink. A sink inside the body and a sink after For is two deliveries of related data.
Iteration rules
Publish counts in this table assume the body ends with a sink. Without one, the same rules decide the job status, and nothing is published until a sink after For.
Iterations are sequential: one body in flight per For job. Wall time is about N × body duration.
Timings (Test Step and ClickHouse)
For does not introduce a second clock. Test Step badges and ClickHouse timings read the sameJobResult.commandTimings rows as every other command:
- Wrapper row: command type
execution_flowfor the For command itself - Body rows: paths
.body.N(N is the command index inside the body) - Across iterations, body rows with the same path are coalesced: durations sum; start is the earliest; end is the latest
Usage Examples
Extract events[], then For (JSONata + RabbitMQ sink)
Synthetic listing envelope:
data, then iterate:
data is { "aggregatedResults": [ ... ] } with one entry per event; failed events hold an error entry.
Extract HTTP parallel aggregatedResults
After HTTP parallel 1002 or 1004, data looks like { "aggregatedResults": [ ... ] }. Put the inner array onto data before For:
Common Use Cases
- Per-event JSONata: Write 1022 against one listing event instead of the whole envelope
- One sink message per event: Publish independent records without creating child Items
- HTTP parallel follow-on: Extract
aggregatedResults, then For each response payload - Transform only: Leave the sink out of the body and sink
aggregatedResultsonce after For - Partial listings: Keep the job VALID when some events fail, with each failure and its input in
aggregatedResults
Related Commands
- If-Else - Conditional command lists (same
EXECUTION_FLOWfamily, id 1100) - JSONata - Per-item transform (id 1022); also the extract onto
databefore For - Json Path - Extract an array from a nested envelope
- RabbitMQ Sink - Typical sink at the end of the For body
- HTTP Parallel Request - Output shape
{ data: { aggregatedResults } }(id 1002) - HTTP Parallel Request - Got - Same output shape (id 1004)