KeyRoutines
StepFreeflow.break

Stop a repeating loop early in a Windows 11 routine

Stop repeating ends the Repeat it's inside and carries on with whatever comes after it. Use it when you've found the item you were looking for or a check says there's no point going round again.

How it works

  • It has no settings; drop it inside a Repeat, usually inside an If.
  • When it runs, the innermost Repeat ends at once and the routine continues after it.
  • Outside a Repeat, or inside an At the same time lane within one, it fails, and the editor warns you about it before you run.

Routines that use it

Stop at the first match

Go through the items from List files and stop repeating as soon as Compare values finds the file name you want.

Wait for a window, but not forever

Repeat a short Delay and stop repeating once Window exists says the app's window is open.

Give up after errors

Count failures with Set variable and leave the loop when the count reaches three.

Good to know

  • Only works directly inside a Repeat, not from a parallel lane.

Questions

What's the difference between Stop repeating and Stop routine?
Stop repeating only leaves the current loop and the routine keeps going. Stop routine ends the whole run.
Which loop does Stop repeating end when loops are nested?
It ends the innermost Repeat, the one it sits in directly.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.