Loop over items

Iterate over a collection or numeric range

The Loop over items block repeats actions for each element of a collection (list, set, string, dict) or for a numeric range—similar to a for ... in ... loop in Python.

Block outputs

Loop body

Blocks that run on each iteration. Variables from the block settings (item, index, etc.) are available here.

After loop (exit)

Blocks that run after all iterations finish.

Loop kinds

list / set

Iterate over items in a sequence

  • loop_overVariable holding the collection
  • variable_for_itemVariable for the current item
  • variable_for_indexVariable for the current index
str

Iterate over characters in a string

  • loop_overVariable holding the string
  • variable_for_charVariable for the current character
  • variable_for_indexVariable for the current index
dict

Iterate over key/value pairs in a dictionary

  • loop_overVariable holding the dictionary
  • variable_for_keyVariable for the current key
  • variable_for_valueVariable for the current value
  • variable_for_indexVariable for the current index
range

Iterate over a numeric range

  • startRange start (number or variable)
  • stopRange end (number or variable)
  • stepStep (defaults to 1)
  • variable_for_itemVariable for the current value

Example workflow

Send a message to every user in a list

  1. 1.Create a variable user_ids containing a list of user IDs.
  2. 2.Add a Loop over items block, choose type list, set loop_over = user_ids, variable_for_item = current_user.
  3. 3.Connect Action → Send messages to the Loop body output. Use {{current_user}} in the recipient field.
  4. 4.When the loop finishes, wire any final blocks to the After loop output.

Important notes

Variables created inside the loop body remain visible on later iterations of the same loop.
Variables from the block parameters (item, index, key, value, etc.) are overwritten each iteration.
For range, stop is exclusive—same as Python range().
Step in range may be negative to iterate backward.
Nested loops are supported—place another Loop over items block inside the loop body.