Attended vs Unattended Desktop Flows

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 10 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Module: Design Automations

Section: Power Automate Features and Capabilities

Lesson: Attended vs. Unattended Desktop Flows

Introduction: Understanding the Automation Landscape

In the world of robotic process automation (RPA), the way a software robot interacts with your computer determines not just how the work gets done, but how much that work costs, how it scales, and how it impacts the daily life of your employees. When we talk about Power Automate Desktop (PAD), we are essentially talking about digital workers that can mimic human actions—clicking buttons, typing text, scraping data from websites, and interacting with legacy desktop applications. However, these digital workers do not all operate under the same rules.

The distinction between "Attended" and "Unattended" automation is the cornerstone of any enterprise automation strategy. An attended flow is like an assistant sitting at your desk; it waits for your signal and works alongside you to complete a specific task. An unattended flow, conversely, is like a background service that runs in a dedicated, virtualized environment without any human intervention. Understanding which of these modes to choose is critical because it dictates your licensing costs, your hardware requirements, and the governance model you must adopt. If you choose the wrong mode, you might find yourself with a process that is either too expensive to maintain or one that creates a bottleneck in your office operations.

This lesson explores the technical, operational, and strategic differences between these two modes. We will look at how they function, when to deploy each, and the common pitfalls that automation developers face when moving from a proof-of-concept phase to a full-scale production rollout.


Not read yet

Defining Attended Automation

Attended automation is designed for processes that require human judgment, real-time input, or security verification that only a human can provide. In this mode, the Power Automate flow is triggered directly by a user from their local machine. The user initiates the process, perhaps by clicking a button in a Power Automate console or a desktop shortcut, and the robot performs the repetitive parts of the task while the user continues to monitor or participate in the workflow.

Think of a customer service representative who needs to update a customer's address across three different legacy systems. Instead of the representative manually logging into each system, copying the data, and pasting it, they trigger an attended flow. The robot opens the systems, performs the data entry, and then stops, allowing the representative to verify the final result before hitting "save." This keeps the human in the loop, which is essential for sensitive data or high-stakes transactions.

Key Characteristics of Attended Flows

  • User-Triggered: The process begins only when a human user initiates it.
  • Shared Workspace: The robot shares the screen, keyboard, and mouse with the user.
  • Human-in-the-loop: The flow can pause to ask for input (e.g., a message box asking "Is this address correct?").
  • Context-Aware: The flow can easily access the user's local files, specific browser profiles, or active desktop applications.

Callout: The "Co-pilot" Philosophy Attended automation is best viewed as a co-pilot relationship. Just as a co-pilot assists a pilot by handling routine navigation tasks while the pilot manages the overall flight path, the attended robot handles the "robotic" aspects of a task—copying, pasting, and navigating menus—while the human handles the decision-making and quality assurance. This maximizes productivity without removing the human's ability to oversee the process.


Not read yet

Defining Unattended Automation

Unattended automation represents the "lights-out" scenario. These flows run on dedicated machines, often virtual machines (VMs) hosted in a cloud environment or a private server room. Because no human is sitting at these machines, the process is entirely automated from start to finish. Once a trigger occurs—such as a new email arriving in an inbox or a scheduled time being reached—the robot wakes up, logs into the machine, executes the task, and then logs out or returns to an idle state.

Unattended automation is the holy grail for high-volume, repetitive tasks. If you have a process that generates 5,000 invoices every night at 2:00 AM, you do not want a human to be there to trigger it. You want an unattended robot that runs overnight, processes the data, sends the reports, and reports any errors in the morning. This requires a much higher level of stability in your code, as there is no human present to click "Cancel" if a pop-up window appears unexpectedly.

Key Characteristics of Unattended Flows

  • System-Triggered: The process starts based on a schedule, a queue item, or an API call.
  • Dedicated Environment: The robot runs in a virtual environment, isolated from human activity.
  • High Reliability: Error handling must be robust because there is no one there to fix a "stuck" window.
  • Scalability: You can spin up multiple virtual machines to handle large volumes of work in parallel.

Not read yet

Comparison: Attended vs. Unattended

Feature Attended Automation Unattended Automation
Primary User Human worker (at their desk) System/Server (back-end)
Execution Triggered by user interaction Scheduled or event-driven
Environment User's local machine Dedicated VM / Server
Licensing Per user Per bot (unattended capacity)
Best For Tasks requiring human judgment High-volume, routine tasks
Error Handling Human can intervene in real-time Must be fully automated/resilient

Technical Implementation: A Practical Example

To understand how these work in practice, let’s look at a simple automation task: extracting data from an Excel spreadsheet and inputting it into a web-based CRM.

The Attended Approach

In an attended flow, you might build a flow that includes a "Display input dialog" action. This allows the human to specify which file to process.

// Pseudo-code for Attended Flow
Display input dialog "Select Excel File"
Get file path from user
Launch Excel
Read data from path
For each row in Excel:
    Launch Web Browser
    Navigate to CRM
    Populate fields from Excel
    Display message "Please verify data for row: %CurrentRow%"
    If user clicks "Yes":
        Submit form
    Else:
        Skip row

In this example, the robot is dependent on the user. If the user is on a lunch break, the robot stops. This is perfect for verifying sensitive data but inefficient for bulk processing.

The Unattended Approach

In an unattended flow, we remove the "Display input dialog" and the "Display message" steps. Instead, we use a shared network folder or a queue.

// Pseudo-code for Unattended Flow
Get files from network folder "C:\Automation\Input"
For each file in folder:
    Launch Excel
    Read data
    Launch Web Browser (Headless or hidden)
    Navigate to CRM
    Populate fields
    Submit form
    Move file to "C:\Automation\Processed"
    If error occurs:
        Log error to central database
        Send email notification to admin

Note: When designing unattended flows, you must use "Headless" browser modes or ensure the browser is configured to run without requiring a physical display. Always include comprehensive logging, as you will not be there to see the screen if something goes wrong.


Not read yet

Best Practices for Development

Developing for attended and unattended modes requires different mindsets. When you are the one watching the robot, you might get lazy with your error handling. When the robot is running in a data center at 3:00 AM, that same laziness will result in failed processes and lost data.

1. Robust Error Handling

For unattended flows, never assume the application will be open. Your flow must include steps to check if the application is running, launch it if it is not, and verify that the correct window is in focus. Use the "On block error" feature in Power Automate to capture exceptions and trigger recovery steps, such as restarting the application or sending an alert to a Slack or Teams channel.

2. Environment Variables and Secrets

Never hardcode credentials or file paths. Use environment variables to store paths for development, testing, and production. For credentials, use the CyberArk or Azure Key Vault integration. An unattended robot should never have a password written in plain text within the flow logic.

3. Modular Design

Break your flows into smaller, reusable sub-flows. If you have a specific process for "Logging into the CRM," make that a separate sub-flow. If you need to update that process later, you only have to change it in one place, rather than updating every single flow that interacts with the CRM.

Tip: The "Golden Rule" of UI Automation Always prefer API-based automation over UI-based automation (clicking buttons). APIs are much faster and more reliable than clicking on interface elements. If a website offers an API, use the "HTTP" action in Power Automate to interact with it directly. UI automation should be your last resort when no other integration method exists.


Not read yet

Common Pitfalls and How to Avoid Them

Even experienced developers fall into traps when scaling their automations. Here are the most common mistakes:

The "Hardcoded Resolution" Trap

In unattended automation, the robot runs on a virtual machine. If you record your clicks based on a specific screen resolution (e.g., 1920x1080), and the virtual machine is set to a different resolution, the robot will click on the wrong parts of the screen.

  • The Fix: Always set the resolution of your virtual machines to a standard size, such as 1920x1080, and configure your Power Automate flows to work relative to window elements rather than absolute coordinate points.

Ignoring the Session Timeout

When a user logs out of their computer, the session is locked, and the UI becomes inaccessible. An unattended robot must be able to log itself into the machine, perform the task, and then either lock or leave the machine in a state that is ready for the next run.

  • The Fix: Work with your IT department to ensure the service account running the robot has the correct permissions to log into the VM and keep the session active without needing a physical monitor or keyboard.

Over-reliance on "Wait" Actions

Many beginners use "Wait 5 seconds" to ensure a page loads. This is a fragile way to build automation. If the network is slow, 5 seconds might not be enough, and the robot will fail. If the network is fast, you are wasting time.

  • The Fix: Use "Wait for element" or "Wait for window" actions. These tell the robot to proceed as soon as the element appears, making your flow faster and more reliable.

Not read yet

Scaling Your Automation Strategy

As your organization begins to deploy more bots, you will need a governance model. You cannot simply have everyone running flows on their own laptops. You need to transition from "Desktop Flows" (which are often experimental) to "Cloud Flows" that manage your desktop flows.

The Role of the Power Automate Gateway

The gateway is the bridge between the cloud and your on-premises machines. Whether you are running attended or unattended flows, the gateway allows the Power Automate cloud service to communicate with your desktop machine. For unattended flows, this is non-negotiable. It allows the cloud service to queue up jobs and distribute them across a pool of machines.

Machine Groups

Once you have more than one machine performing unattended tasks, use "Machine Groups." A machine group acts as a load balancer. If you have five machines in a group and a task comes in, the cloud service automatically assigns the task to the next available machine. This ensures that your automation processes do not backlog if one machine goes down for maintenance.

Callout: Licensing Insights Licensing is often the most confusing part of Power Automate. Attended flows usually require a "Per User" license, meaning each person who triggers the flow needs a license. Unattended flows require a "Per Bot" license. This is a flat fee for the bot itself, regardless of how many people trigger it. Always consult with your internal IT procurement team early, as the cost difference between these two models can be significant at scale.


Not read yet

Step-by-Step: Setting Up an Unattended Environment

If you are moving from a single desktop flow to an unattended production environment, follow these steps:

  1. Provision the Virtual Machine: Work with your infrastructure team to create a dedicated VM. Ensure it has the necessary software installed and that it is not being used by a human.
  2. Install the Power Automate Runtime: Download and install the Power Automate machine runtime on the VM.
  3. Register the Machine: Log into the machine with the service account that will run the flows and register the machine in the Power Automate portal.
  4. Configure the Service Account: Ensure the service account has the minimum required permissions. Avoid using "Domain Admin" accounts; use a dedicated service account with access only to the necessary applications and folders.
  5. Create a Machine Group: Even if you only have one VM, add it to a machine group. This makes it easier to add more capacity later without having to rewrite your flow references.
  6. Test in "Headless" Mode: Disable the visual debugging tools and run the flow as a service to ensure it completes without any UI pop-ups.
  7. Monitor the Logs: Use the "Monitor" tab in the Power Automate cloud portal to review run history. Look for patterns in failures, such as specific times of day where network latency might be causing timeouts.

Not read yet

Advanced Troubleshooting: When Things Go Wrong

Even with the best planning, robots fail. The key is in how you handle that failure. A good automation developer builds "Self-Healing" flows.

Implementing a Retry Logic

If your flow fails to connect to a website, don't just stop. Build a loop that attempts the connection three times with a short pause in between. If it fails on the third attempt, then—and only then—send an email alert to the support team.

// Example of Retry Logic
Variable 'RetryCount' = 0
Loop while 'Success' is false AND 'RetryCount' < 3:
    Try:
        Navigate to URL
        'Success' = true
    Catch:
        'RetryCount' += 1
        Wait 10 seconds
If 'Success' is false:
    Send Email "Automation Failure: CRM Unreachable"

The Importance of Screenshots

In an unattended flow, you cannot see what is happening. Use the "Take screenshot" action inside your "Catch" block. Save the image to a temporary folder or attach it to your failure notification email. Seeing exactly what the screen looked like when the robot crashed is invaluable for debugging.


Not read yet

Comparison of Development Approaches

When deciding whether a process should be attended or unattended, use this quick reference guide:

Factor Favor Attended Favor Unattended
Data Sensitivity High (Human needs to verify) Low (Standardized, trusted data)
Complexity High (Requires human judgment) Low (Rule-based)
Volume Low/Medium High
Frequency Ad-hoc/On-demand Scheduled/Continuous
Application Stability Variable (Human can fix issues) High (Must be stable)

Summary and Key Takeaways

As we wrap up this lesson, it is important to remember that the choice between attended and unattended automation is not just a technical decision; it is a business decision. You are choosing how to allocate your human capital and your financial resources.

Here are the key takeaways to keep in mind:

  1. Human-in-the-loop is the defining feature of Attended Automation. Use this mode when the process involves subjective decisions, physical verification, or high-risk data that requires an audit trail of human approval.
  2. Unattended Automation is for scale and efficiency. It is designed for high-volume, repetitive tasks that run best without human interruption. It requires a stable, virtualized environment and robust, self-healing code.
  3. Environment matters. Never build unattended flows that rely on your local machine’s specific configuration or browser state. Use virtual machines, standard image configurations, and centralized credential management (like Key Vault) to ensure consistency.
  4. Error handling is the difference between a project and a product. A proof-of-concept might work on your laptop without error handling, but a production-ready unattended bot must be able to recover from network drops, application crashes, and unexpected pop-up windows.
  5. Start with the Process, not the Tool. Before you decide on attended vs. unattended, map out the process. If you find that the process relies on a human to "feel" if a document is correct, don't try to force it into an unattended flow. Start with an attended flow and automate the boring parts first.
  6. Governance is essential. As you scale, use Machine Groups and the Power Automate cloud portal to monitor your robots. Centralizing your logs and error notifications will save you hundreds of hours in maintenance time.
  7. Iterative Improvement. Automation is rarely "done." Treat your flows like software products. Gather feedback from the users, monitor performance metrics, and regularly look for ways to optimize the logic to make your robots faster and more reliable.

By mastering the differences between these two modes, you are not just building bots; you are building a resilient, scalable digital workforce that can handle the heavy lifting of your organization’s operations, freeing up your team to focus on the work that truly requires human intelligence.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.