Articles on: Blocks Creator
This article is also available in:

πŸŸ₯ Repeat

πŸŸ₯ Repeat



The Repetition block allows you to repeat an action or a flow a determined number of times, consecutively and linearly (equivalent to a For loop in programming).


This block is particularly useful for avoiding manual duplication of nodes in a graph, whether to generate visual elements, distribute objects, or execute repetitive network calls.


πŸ“₯ Entries


  • count (Number): Integer defining the total number of loop executions. For example, a value of 3 will repeat the action three times.


πŸ“€ Outings


  • index (Number): Indicates the number of the current iteration (1, 2, 3, etc.). Useful for incremental operations or lists.
  • loop (Stream): Main flow of the loop. Everything connected to it runs on each iteration.
  • completed (Stream): Stream triggered once all iterations are completed. Allows the flow to continue after the loop.


πŸ’‘ Example of use


Scenario: Generate a grid of squares for a board game


  1. A game requires a grid of 4x4 squares for a level.
  2. The Repetition block is configured with count at 16 (4x4).
  3. The loop (Stream) output is connected to a case creation block, which places each case at a calculated position based on index (ex: x = index % 4, y = index // 4).
  4. At each iteration, a new box is generated and positioned automatically.
  5. Once the 16 iterations are completed, completed (Stream) activates a validation block to move on to the next stage of the game.


βš™οΈ Technical Details

  • Variable management: Outputs like index are updated asynchronously. In the event of delays (API, heavy calculations), check the consistency of the data.
  • Special case: If count is set to 0, the loop flow is skipped and completed is triggered immediately.

Updated on: 04/03/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!