Blocks & Flow EditorCommon
array loop
Iterate over array elements and execute connected blocks for each item
The array loop block iterates over an array, sending each element to the loop body until all items are processed. When the array ends, the flow exits from the end array output.
Configuration
| Field | Description |
|---|---|
| Name | Optional display label. Defaults to the array expression if empty. |
| Key | Variable that stores the current array index. Must be a msg, flow, or global property. Auto-generated name if left blank (e.g. al{blockId}). |
| Array | The array to iterate. Set to a msg, flow, or global property containing the array (e.g. msg.rows). Cannot be msg.payload directly. |
| Set key variable to … when exiting | Reset the key variable when the loop ends. Choose null, undefined, or empty string. Useful when nesting multiple loops. |
Outputs
| Port | Label | Description |
|---|---|---|
| Upper | end array | Fires when all elements have been processed — connect post-loop logic here |
| Lower | (loop body) | Fires for each element — connect blocks that run per item. msg.payload contains the current element |
Notes
- On first entry, the Key variable must be
null,undefined, or empty string — otherwise the index is not reset to 0 - Do not modify the key or array inside the loop in ways that prevent termination — this can cause an infinite loop
- Wire the loop body back into the array-loop input to continue iteration
msg.payloadon the lower output is the current array element