π₯ 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
3will 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
- A game requires a grid of 4x4 squares for a level.
- The Repetition block is configured with count at
16(4x4). - 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). - At each iteration, a new box is generated and positioned automatically.
- 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
Thank you!
