Conditional While Loop block in RunMacro
Desktop ModeBrowser ModeRunMacro RunnerRunMacro 3.5+
While Loop repeatedly executes child commands as long as a variable condition remains met, protected by a safety iteration cap.
Dialog & quick setup

- Add a Control Flow › While Loop command to your workflow.
- Select the target variable to monitor (e.g.
{status}). - Select comparison operator (
!=,==,<,contains...) and enter the target value. - Set the Safety Cap (Max Iterations) threshold (e.g. 100) to protect against infinite loops.
- Place target commands inside the block. Terminate with End Loop. Save.
Options reference
Modes & when to use
Desktop Mode
Browser Mode
RunMacro Runner
Best for
- Polling an asynchronous operation whose completion duration is variable (e.g. while {status} != "Done").
- Processing sequential queue items until a pointer or balance threshold is reached.
- Retrying an operation sequence while checking success conditions after each cycle.
Use an alternative when
- Iterating through collections of files or list items (For Each is much better).
- Repeating an action a predetermined fixed number of times (use Loop instead).
Before you run
- The monitored variable is initialized prior to entering the loop.
- A defined termination condition exists so the loop does not exhaust its safety cap unintentionally.
Example workflow
Example: Poll until processing status changes to "Ready"
- Initialize variable {status} = "Processing".
- Insert While: {status} != "Ready", Max Iterations = 50.
- Inside: Re-read status from UI, Delay 1000ms.
- Close with End Loop. When {status} equals "Ready", the loop exits immediately.
Expected result: Enclosed commands repeat on each cycle until the condition evaluates to false, then flow advances past End Loop.
Tips & limitations
Ensure at least one command inside the While block updates the monitored variable (or introduces an appropriate Delay).
Avoid disabling or setting excessive Max Iterations thresholds on unattended server automations.
- If the variable is never updated inside the block, the loop will consume all iterations up to the safety cap.
- Cycle interval timing depends entirely on the execution speed and delays of child commands inside the block.
Applies to RunMacro 3.5+ · Desktop Mode & Browser Mode & RunMacro Runner · Windows 10/11
