Develop RPA solutions
The authoring surface
Power Automate for desktop gives you actions, subflows, variables and a UI element repository. The recorder is a starting point only: recorded selectors often rely on screen position and break the moment resolution, theme or layout changes. Prefer stable attributes such as AutomationId, name or control type, and keep the repository tidy so one selector edit fixes every action that uses that element.
Variables, subflows and control flow
Declare variables in the variables pane, choosing the correct data type (text, number, datatable, custom object, list). Anything a cloud flow must supply must be created as an input variable; anything returned must be an output variable on the subflow. Use If, For each and Loop actions for control flow, and pass data between subflows explicitly rather than relying on globals.
Making it robust
Wrap risky steps in an On block error block and choose the behaviour: retry a set number of times, or continue and handle the error. Log meaningful messages with Log message or Write to text file so a failed run can be diagnosed without re-running. Use Wait for window content or Wait for UI element with a timeout instead of a fixed Delay; fixed delays are the most common cause of flaky automation.
Debugging
Set breakpoints, run from a selected action, step through, and inspect variables while paused. Console logs and the recorded video of an unattended run are the fastest route to the failing step.
Worked example
A run fails with "UI element not found" at step 12 only on some machines. Diagnosis: the recorded selector uses screen coordinates. Fix: rebuild the selector on AutomationId, and place a Wait for UI element (timeout 30s) before the Click. Rule of thumb: if a selector mentions position or uses image fallback, treat it as a defect to be replaced.