Skip to content
Tutorials Center
My learning

Topics

Lesson 28 of 38 ยท Desktop Flows

Attended, Unattended and Cloud-Triggered Desktop Flows

Run desktop flows from the cloud: attended and unattended modes, the machine runtime and connections, passing inputs and outputs, sessions, queues of work, and licensing questions.

A desktop flow that only runs when you press Run in the designer saves you time, but the real payoff comes when a cloud flow starts it automatically: an email arrives, the cloud flow extracts the data, and a desktop flow types it into a legacy system while you do something else. This lesson explains the two run modes (attended and unattended), what a machine needs to run flows, how inputs and outputs travel, and how to design for the realities of sessions, failures and licensing.

The pieces depend on Windows machines and licenses, so nothing here runs on this site. The steps are described in words, and the examples are stand-ins that model the decisions.

The pieces

flowchart LR
    CF["Cloud flow<br/>(trigger + data)"] -->|"Run a flow built with<br/>Power Automate for desktop"| MR["Machine runtime<br/>on a Windows PC or VM"]
    MR --> DF["Desktop flow<br/>clicks, types, reads"]
    DF -->|"output variables"| CF

The cloud flow sends inputs; the desktop flow runs on a registered machine and returns outputs.

  1. The desktop flow is built and saved from Power Automate for desktop (see the overview).
  2. The machine is a Windows computer or virtual machine with the machine runtime installed and registered with your environment. The machine runtime is part of the Power Automate for desktop installation.
  3. A connection in the cloud flow ties it to that machine and to a Windows account, in one of two connection types: directly to machine (the modern, simpler option) or through an on-premises data gateway (older setups).
  4. The action: Run a flow built with Power Automate for desktop (Desktop flows connector). You select the connection, the desktop flow, and the run mode.

Attended and unattended

Attended Unattended
Who is signed in A person is already signed in to Windows, with an unlocked session Nobody; the service signs in with stored Windows credentials
Screen The flow takes over the visible desktop A separate hidden session
Use for Assisting a person, tasks started on demand Overnight or high-volume batch work
Typical trigger Button flow or a cloud flow while the user is present Schedule or event
Licensing A per-user plan with attended RPA An unattended RPA add-on per bot (check current licensing)

In attended mode the flow uses the desktop of the signed-in user, so it can fail if the session is locked or the user is mid-task. In unattended mode Windows creates a session for the flow: you supply the Windows account (name and password) in the connection, the machine must be able to start a session (not locked out, with no pending blocking prompts), and by default only one unattended desktop flow runs per machine at a time, so further runs wait in a queue.

Licensing and limits change often. Treat the numbers and plan names in training material (including this lesson) as a starting point and check Microsoft's current licensing guide before you design a production process.

Passing data in and out

The desktop flow's input variables show up as fields in the cloud action; fill them from dynamic content (an invoice number, a file path, a name). Output variables come back as dynamic content you can use in the next cloud action: a confirmation number, a status, the text read from a screen. Pass small values, not whole files; put files on shared storage (SharePoint, OneDrive, a network share) and pass the path or link. Sensitive inputs (passwords) should be marked as sensitive and, ideally, come from a secure store such as Azure Key Vault through an environment variable, not typed into the flow.

JS Stand-in: inputs and outputs of a desktop flow run

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

No output.

Designing for the real world

  • Idempotent work. A run can be retried after a failure, so entering the same invoice twice must be safe, or the flow should check "does this record already exist?" first. See flow patterns.
  • Start from a known state. Close leftover windows at the beginning, and open the target application fresh.
  • Handle the unattended session. Screen resolution and scaling in an unattended session may differ from your development screen; test with the same settings. Avoid clicks by coordinates.
  • Time limits. Cap the runtime of a desktop flow with a timeout in the cloud action and make sure the cloud flow's reaction to a timeout is defined (retry policies and timeouts).
  • Update-proof sign-ins. Passwords expire; an unattended run that suddenly fails because the Windows password changed is a classic Monday-morning incident. Use a service account with a managed rotation process and monitor failures.
  • Security. The account used must have only the rights the flow needs. Treat the machine like a production server: patch it, restrict who can log in, and keep secrets out of logs.

Queues of work with a cloud flow

Because one machine runs one unattended flow at a time, large volumes need design:

  • One run per item, letting runs queue up, is simple but slow and uses the run queue.
  • One run per batch, passing a list or a file path, reduces start-up overhead. The desktop flow loops over rows itself.
  • Machine groups (a pool of machines in one group) let the service pick a free machine and run flows in parallel.
JS Stand-in: how many machines for a workload?

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

No output.

When the desktop flow fails

The cloud action shows the run's status and, for failures, an error such as the machine being unavailable, the session failing to start, or a flow error inside the desktop flow. Use run-after settings on the next action to react (error handling). In the desktop flow itself, use On block error to capture the error message and return it through an output variable, so the cloud flow can report something useful. Run history in the portal shows each desktop flow run with its logs and, for unattended runs, per-action details.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the key difference between attended and unattended mode?

    The unattended service creates a session with the supplied Windows account; attended borrows an existing session.
  2. 2. Which action starts a desktop flow from a cloud flow?

    That action of the Desktop flows connector takes a connection, a flow and a run mode.
  3. 3. Why is idempotent design important for desktop flows?

    Failures and retries happen; the flow should check for existing records or be safe to repeat.
  4. 4. How should large files be passed between a cloud flow and a desktop flow?

    Inputs and outputs are meant for small values.

Summary

  • A cloud flow starts a desktop flow on a registered machine through a connection, with inputs and outputs.
  • Attended mode uses an existing signed-in session; unattended signs in with stored credentials and typically runs one flow per machine at a time.
  • Design for repeats, known start states, session differences, timeouts and credential changes.
  • Scale with batches and machine groups, and always verify current licensing.

Next: Run After and Try/Catch Patterns