Skip to content

Repeat Task

Repeat the execution of a node or multiple nodes a specified number of times. This can be an integer value or a value from a function, such as {{$randint(1,2)}}, which generates a number between 1 and 2 and repeats that many times.

Practical Example

Here, I want to repeat the mouse scroll action to view videos after searching on YouTube

Repeat task block example

To achieve this, first, I will configure the Scroll element node to scroll through the videos. I will set it to scroll a random distance between 500 and 600 as follows

Repeat task block example

Next, connect to the Repeat Task node. I will configure the number of times to repeat the action randomly using the {{$randint(2,5)}} function instead of a fixed integer

Repeat task block example

Then, I will connect the Repeat from point output to the Scroll element node to reuse the scroll node for the desired number of times. After repeating the specified number of times, the process will continue with the nodes at the remaining output.

The node cluster will look like this

Repeat task block example

Finally, when running this node cluster, the process scrolls through the videos as I desired

Repeat task block example