Block reference / Control flow

Repeat task

Run a stretch of blocks a set number of times, then carry on.

In both appsWarpX BrowserWarpX Phone

Use Repeat task when you need the same few steps several times and do not need a list, such as clicking a "Load more" button three times. Its bottom output, Repeat from, leads to the blocks to repeat, and the last of those connects back into the Repeat task. Once the count is reached, the run leaves by the top output.

The Repeat task block's settings, filled in as in the example below.

Settings

times

Typed straight into the block on the canvas; the block has no settings panel. How many times the blocks after Repeat from run. {{references}} work here, such as {{variables.pages}}.

Example3

Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.

What it hands on

Bottom output (Repeat from): taken each time until the count is reached. Top output: taken once, after the last repeat. The block passes the count on as its data.

Example: Click Load more three times before reading the list

  1. Start
  2. New tab
  3. Repeat task
  4. Click element
  5. Delay
  6. Get text
Where Repeat task sits in the example workflow.
  1. Add a New tab block with the list page's URL.
  2. Add a Repeat task block and type 3 into it.
  3. Connect Repeat from to a Click element block on button.load-more, then a Delay of 1500 ms.
  4. Connect the Delay block back into the Repeat task's input.
  5. Connect the Repeat task's top output to a Get text block on .item-title with Multiple on.

Good to know

  • The repeated blocks must lead back into the Repeat task's input. If they do not, they run once and the run ends at the last of them.
  • 0, or text that is not a number, still runs the repeat path once.
  • If Repeat from is not connected, the block leaves by the top output at once.
  • The count starts again after the block finishes, so it works inside an outer loop.
  • There is no counter to read inside the repeat. If you need one, use Loop data with Numbers and {{loopData.<id>}}.

See also

  • Loop data — Run the blocks after it once for each row, number, list item or element.
  • While loop — Keep running a stretch of blocks while a condition holds.
  • Delay — Pauses the run for a set number of milliseconds before the next block.