For Each
Runs on: Shared (backend or chatbox overlay).
Runs the rest of the flow once for each item in a list. Each iteration emits the current item and its zero-based position. Iterations run one after another. Only the first 1000 items are processed. The rest are skipped silently.
Use it to handle each value individually, such as sending a personalized message to each raffle entrant or updating a per-user variable.
Inputs
| Name | Type | Description |
|---|---|---|
list | list | The list to iterate over. Any list type works, but a single value can't be connected. The item type sets the type of the Item output. |
Outputs
| Name | Type | Description |
|---|---|---|
Item | any | The current element. |
Index | number | The zero-based position of the current item. |
Done | list | Fires once after the last iteration, carrying the whole list. Use it to continue after the loop, for example to announce "Congrats to all winners!" once every winner has been messaged. |
Example
A flow variable holds the usernames of giveaway entrants. Connect it to For Each, and connect Item to a chat message effect saying "Congratulations, [username], you've been selected!"