Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 38 ยท Desktop Flows

Power Automate Desktop and Desktop Flows

Meet Power Automate for desktop: what a desktop flow is, how it differs from a cloud flow, the designer layout, subflows, and when robotic process automation is the right tool.

Cloud flows work with services that have an API: email, SharePoint, Teams. But much office work happens in programs that have no API at all: an old accounting application, a government website with a login form, a spreadsheet macro, a PDF someone must retype. Desktop flows automate those by doing what a person does: clicking buttons, typing into fields, reading text from the screen. This approach is called robotic process automation (RPA).

This lesson introduces Power Automate for desktop (often called PAD), the Windows application where desktop flows are built and run. The product runs only on Windows, so this site cannot run it. The descriptions below are in words, and the runnable examples are stand-ins that model the ideas.

Cloud flows versus desktop flows

Cloud flow Desktop flow
Runs on Microsoft's servers A Windows computer
Built in Browser designer The Power Automate for desktop app
Talks to Connectors and APIs Windows apps, browsers, files, UI elements
Triggered by Events, schedule, button A person, or a cloud flow
Best for Services with an API Legacy apps, screen work, local files

The two work together. A cloud flow can start a desktop flow on a machine, pass it inputs, and receive outputs, so an event in the cloud (a new invoice email) can drive work in a Windows application (typing the invoice into the old system).

Prefer an API when one exists

RPA is powerful but fragile. A desktop flow depends on what the screen looks like. If the vendor moves a button or renames a field, the flow can break. Use this order of preference:

  1. A connector or API call (stable, fast, runs in the cloud).
  2. Web automation with browser actions, if only a website exists.
  3. UI automation of a desktop program, if there is no other way.
  4. Image or coordinate clicking, as a last resort.
flowchart TB
    Q{"Is there a connector<br/>or API?"} -->|"Yes"| C["Cloud flow with the connector"]
    Q -->|"No"| W{"Is it a website?"}
    W -->|"Yes"| B["Browser automation<br/>in a desktop flow"]
    W -->|"No"| U["UI automation<br/>of a Windows app"]

The deeper down this chart you go, the more maintenance the flow needs.

The designer

When you open Power Automate for desktop and create a flow, the window has these parts:

  • Actions pane (left): hundreds of actions grouped by category (Variables, Conditionals, Loops, Flow control, Mouse and keyboard, UI automation, Browser automation, Excel, File, Folder, Text, Date time, System, Message boxes, Run application and more). Search it, then drag an action into the workspace or double-click it.
  • Workspace (center): the numbered list of actions, in order. Each action opens a dialog with its parameters.
  • Variables pane (right): every variable, including input and output variables used to pass data in and out.
  • UI elements pane and Images pane: the screen elements and pictures your flow clicks and looks for, stored once and reused. See recorders and UI elements.
  • Subflows tab: a desktop flow can hold several named subflows. The one called Main runs first; others are called with Run subflow.

Press Run to test from the designer. The flow can run step by step with Run next action, and the toolbar has a Stop button. Errors appear in the error pane, with the action number.

A first flow, in words

Suppose you must copy the names from a text file into a form in some application. The actions would be, in order:

  1. Read text from file (the File group) into a variable %FileContents%.
  2. Split text on new lines into a list %Names%.
  3. For each CurrentItem in %Names%:
    • Click UI element in window (the "New customer" button).
    • Populate text field in window with %CurrentItem%.
    • Click UI element in window (Save).
  4. Display message "Done".

Variables are written between percent signs. The designer inserts them with the button. Chapter 6's next lessons cover variables and data and running desktop flows from the cloud.

Stand-in: the shape of the loop

Here is the same logic in JavaScript, with the "clicks" replaced by printed messages. It is a model of the flow, not the real thing.

JS Stand-in: the names flow, as code

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Where files live and who owns them

Desktop flows are saved to the cloud (in an environment, see environments and solutions) when you sign in, so you can run them from a cloud flow and share them. Without signing in you can still build local flows for personal use. Sign in with a work or school account to get the full set of features.

Good habits from day one

  • Name every action's variables clearly (%InvoiceNumber%, not %Var3%).
  • Use Comment actions to explain blocks.
  • Split long flows into subflows, one per task ("Login", "Enter one invoice", "Logout").
  • Close the programs you open, even when something fails (see error handling for how).
  • Never type passwords into a flow as plain text; use secure inputs (covered in the cloud lesson).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main reason to choose a desktop flow over a cloud flow?

    RPA is for systems you can only operate through their user interface.
  2. 2. Which is the preferred order when automating something?

    Stable interfaces first; screen-based methods break when screens change.
  3. 3. How do variables appear inside a desktop flow action's text field?

    Desktop flows use %VariableName%. The @{...} form belongs to cloud flows.
  4. 4. Which subflow runs first in a desktop flow?

    Main is the entry point; other subflows run when called with Run subflow.

Summary

  • Desktop flows (RPA) drive Windows apps and websites through the screen when no API exists.
  • Power Automate for desktop is the Windows app for building and testing them; cloud flows can start them.
  • Prefer connectors, then browser automation, then UI automation; screen-based flows are more fragile.
  • The designer has an actions pane, a numbered workspace, variables, UI elements and subflows; %Var% is the variable syntax.

Next: Recorders and UI Elements