BlocksLoops & Iterations
Loop
Iterate over an array or a specific number range to perform repeated actions.
The Loop block allows you to execute a sequence of actions multiple times. You can either iterate over a predefined number of times or process each element within an array.
When you add a Loop block, it automatically creates two connected helper blocks:
- Loop Iteration: The starting point for actions that should run in each cycle.
- After Loop: The point where execution continues once the loop has finished all cycles.
Configuration
| Field | Required | Description |
|---|---|---|
| Loop Type | ✅ | Choose between Loop over a Number Range (fixed iterations) or Loop over an Array (processes list items). |
| Array to Loop | — | (Array Type only) The variable containing an array or a raw JSON array (e.g., [1, 2, 3]) to iterate over. |
| Item Variable | ✅ | (Array Type only) The name of the variable that will store the current item during each iteration. Defaults to item. |
| Loop Count | ✅ | (Number Type only) The total number of times the loop should execute (Minimum: 1, Maximum: 3000). |
| Delay per Iteration (ms) | — | An optional pause (in milliseconds) to wait between each iteration. |
Available Loop Variables
During execution, the following variables are automatically available inside the loop:
{loop_index}— The current iteration index, starting at0.{loop_count}— The current iteration count, starting at1.{item}— (Default name) The value of the current array element (only for Array loops).
Custom Item Names
If you change the Item Variable field to user, you would access the current element using {user} instead of {item}.
Error Handling
MISSING_LOOP_TYPE— Triggered if the loop type is not selected.MISSING_LOOP_COUNT— Triggered when a number loop is missing the iteration count.INVALID_LOOP_COUNT— Triggered if the count is not a positive number.LOOP_COUNT_EXCEEDED— Triggered if the count exceeds the system limit.MISSING_ARRAY— Triggered when an array loop has no input data.INVALID_ARRAY— Triggered if the provided input cannot be parsed as an array.ARRAY_LENGTH_EXCEEDED— Triggered if the array has too many elements.MISSING_LOOP_ENTRY— Internal error if the loop iteration block is missing.MISSING_LOOP_EXIT— Internal error if the after-loop block is missing.EXECUTION_ERROR— Triggered if an unexpected error occurs during the loop cycles.
Example: Processing a User List
Imagine you have a variable {user_list} containing several user objects, and you want to log each username.
- Set Loop Type to
Loop over an Array. - Set Array to Loop to
{user_list}. - Set Item Variable to
current_user. - Connect a Console Log block to the Loop Iteration block.
- In the Log block, use
{current_user.name}to print the name. - Connect any final actions (like a Response) to the After Loop block.
The system will run the Log block for every user in the list, then move to the final Response once finished.
