Methods for Running Desktop Flows
Earn 25 points (50 with Pro) in two steps
- ① Read through the lesson — each section gets a ✓ as you scroll through it.
- ② When every section has a ✓, tap Complete lesson.
0 of 12 read · keep scrolling
✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro
Methods for Running Desktop Flows in Power Automate
Introduction: The Power of Desktop Automation
In the modern digital workplace, many essential business processes remain "trapped" in legacy applications that lack modern Application Programming Interfaces (APIs). These systems might be desktop-based accounting software, older web portals that don't support cloud connectors, or complex Excel-based reporting tools. Power Automate Desktop (PAD) acts as the bridge between these legacy systems and the cloud, allowing you to automate human-like interactions—mouse clicks, keystrokes, and data entry—on your local computer.
Understanding how to trigger, manage, and execute these desktop flows is the difference between a brittle, manual automation and a reliable, enterprise-grade system. Whether you are running a simple task on your own machine or orchestrating thousands of complex transactions across a fleet of virtual machines, the execution method determines the scalability, security, and reliability of your design. This lesson explores the various methods for running desktop flows, providing you with the technical depth required to choose the right approach for your specific automation needs.
Not read yet
Understanding Desktop Flow Execution Modes
Before diving into specific methods, it is vital to distinguish between the two primary modes of execution: Attended and Unattended. These modes are not merely settings; they represent fundamentally different architectural approaches to automation.
Attended Execution
Attended automation is designed to run on a user's workstation. In this scenario, the automation acts as a digital assistant. The human user triggers the flow, perhaps by clicking a button in a Power Automate cloud flow, and the automation performs tasks while the user is physically present at the machine. This is ideal for tasks that require human judgment, sensitive data entry that requires verification, or processes that are too complex to be fully automated from start to finish.
Unattended Execution
Unattended automation runs in the background on dedicated machines or virtual machines without any human intervention. These flows are typically scheduled or triggered by events (such as an email arriving or a database update) and run entirely autonomously. This is the gold standard for high-volume, repetitive tasks that need to run 24/7. Because no human is present to handle errors or interface hiccups, unattended flows require much more rigorous error handling and logging compared to attended flows.
Callout: Attended vs. Unattended Comparison
Feature Attended Automation Unattended Automation Primary User The individual human operator The system/automated trigger Execution Environment Local user workstation Dedicated server or VM Error Handling Human can intervene in real-time Must be fully automated/resilient Use Case Data entry, complex UI tasks Batch processing, report generation Licensing Per-user license Per-bot (unattended) license
Not read yet
Method 1: Manual Triggering from the Desktop Console
The most straightforward way to run a desktop flow is via the Power Automate Desktop console. This is the method most developers use while building and testing their workflows.
Step-by-Step Execution
- Open the Power Automate Desktop application on your machine.
- Locate the flow you wish to run in your "My flows" list.
- Click the "Play" icon (the triangle button) next to the flow name.
- If the flow requires input variables, a pop-up window will appear asking you to provide the necessary values before the flow begins.
- The console will display the status of the flow, showing you which action is currently being executed.
Best Practices for Manual Testing
When running flows manually, always use the "Run from here" feature if you are debugging a long process. By right-clicking on a specific action and selecting "Run from here," you can bypass the initial steps of a flow to test a specific logic block without waiting for the entire process to complete. Furthermore, always keep an eye on the "Flow variables" pane during manual runs to ensure that the data being captured or transformed matches your expectations in real-time.
Not read yet
Method 2: Triggering via Cloud Flows (The Hybrid Model)
The most common way to operationalize desktop flows is to connect them to the cloud. By creating a cloud flow (in the Power Automate web portal), you can trigger your desktop flows using hundreds of available connectors—such as Office 365, SharePoint, SQL Server, or even HTTP requests.
Configuring the Desktop Flow Action
To run a desktop flow from the cloud, you must use the "Run a flow built with Power Automate for desktop" action. This action requires a connection to a machine or a machine group.
- Create a new Cloud Flow in the Power Automate web portal.
- Add the "Power Automate for desktop" connector.
- Select the "Run a flow built with Power Automate for desktop" action.
- Define the connection: Provide the credentials for the machine where the desktop flow resides.
- Select the specific desktop flow you want to trigger.
- Map the input variables from your cloud flow to the desktop flow’s input fields.
Why Use This Method?
This method allows you to create a "trigger-based" architecture. For example, you can set up an Outlook trigger that watches for an email with an attachment. When the email arrives, the cloud flow automatically triggers the desktop flow, passes the attachment path to it, and the desktop flow processes the document into a legacy ERP system. This creates a seamless bridge between modern email services and legacy desktop software.
Note: When connecting to a machine, ensure the "Power Automate machine runtime" application is running on the target machine and is signed in with the same account used to create the connection in the cloud.
Not read yet
Method 3: Scheduling Desktop Flows
Sometimes, you don't need a trigger event like an email; you simply need a process to run at 2:00 AM every Tuesday to generate a report. Scheduling is a native capability of cloud flows that orchestrates your desktop automation.
Implementation Steps
- Create a "Scheduled cloud flow" in the Power Automate web portal.
- Set your recurrence (e.g., every day at 8:00 AM).
- Add the "Run a flow built with Power Automate for desktop" action as described in the previous section.
- Save the cloud flow.
By utilizing the cloud scheduler, you offload the responsibility of "remembering" to run the task to the cloud infrastructure. This is significantly more reliable than trying to use Windows Task Scheduler, as the cloud platform provides centralized monitoring, retry policies, and failure notifications. If the scheduled flow fails, you can configure it to send an email or a Teams message to your IT department immediately.
Not read yet
Method 4: Command Line Execution (Advanced)
For developers and system administrators who need to integrate desktop flows into external systems (like a custom web application, a CI/CD pipeline, or a legacy batch script), Power Automate allows you to trigger flows via the command line.
The Execution Command
The PAD.Console.Host.exe executable allows you to launch flows programmatically. The basic syntax is:
PAD.Console.Host.exe "FlowName" [arguments]
Practical Example: Integrating with a Python Script
Imagine you have a Python application that processes data and needs to hand off the final step to a desktop flow. You can use the subprocess module in Python to trigger the automation:
import subprocess
# Define the path to the PAD host
pad_path = r"C:\Program Files (x86)\Power Automate Desktop\PAD.Console.Host.exe"
flow_name = "Process_Invoice_Batch"
# Execute the flow
try:
result = subprocess.run([pad_path, flow_name], capture_output=True, text=True)
print("Flow execution finished with exit code:", result.returncode)
except Exception as e:
print("Failed to trigger flow:", e)
Warning: Security Considerations
Using command-line execution requires caution. Because you are essentially exposing a way to trigger automation from the OS level, ensure that the user account running the script has the minimum necessary permissions. Never hardcode credentials in your scripts; instead, use environment variables or secure credential managers to handle the authentication tokens required for the machine runtime.
Not read yet
Best Practices for Reliable Execution
Running desktop flows is not just about getting them to start; it is about ensuring they complete successfully every time. Desktop environments are notoriously "noisy" and unpredictable.
1. Implement Robust Error Handling
Never assume an action will succeed. Always wrap critical blocks of actions (like UI interaction) in "On block error" containers. Within these containers, define a strategy:
- Retry: Attempt the action again after a 5-second delay.
- Log: Write the failure to a text file or database.
- Notify: Send an email alert to the administrator.
2. Use UI Selectors Wisely
The most common cause of desktop flow failure is a "selector not found" error. This happens when an application updates or a window takes longer to load than the script expects.
- Use "Wait for window" or "Wait for element" actions before interacting with a UI.
- Use relative selectors rather than absolute ones whenever possible.
- If an application is slow, increase the default timeout settings in the action configuration.
3. Maintain Machine Health
If you are running unattended flows, ensure the machine is properly configured:
- Disable Windows Updates from forcing a reboot during business hours.
- Ensure the screen resolution is consistent (or use a virtual machine with a fixed resolution).
- Prevent the machine from entering "Sleep" or "Hibernate" mode.
- Keep the machine logged out, but ensure the Power Automate service is active.
4. Monitor via the Cloud Portal
Even if you run flows locally, always use the Power Automate portal to monitor your "Desktop flow runs." This gives you a centralized dashboard to see which flows are running, which have failed, and how long they are taking to execute. Use this data to identify performance bottlenecks.
Callout: The Importance of "Wait" Actions
Many beginners make the mistake of using "Wait" actions with hardcoded time values (e.g., "Wait 10 seconds"). This is a common pitfall. If the application loads in 2 seconds, you have wasted 8 seconds. If it loads in 12 seconds, your flow crashes. Instead, use "Wait for element" or "Wait for window" actions. These are dynamic; they proceed the exact millisecond the target element appears, making your flows both faster and more resilient.
Not read yet
Common Mistakes and How to Avoid Them
Mistake 1: Leaving the "Run as" User Logged In
For unattended flows, many people leave their personal user account logged into the machine. This is a security risk and can lead to unexpected behavior if the user account locks or if pop-ups from other applications interfere with the automation.
- Solution: Always use a dedicated Service Account for unattended automation. This account should have no personal browser history, no open applications, and minimal permissions.
Mistake 2: Ignoring "UI Automation" vs. "Browser Automation"
Power Automate provides specific actions for browsers (Chrome, Edge, Firefox) and generic UI automation for desktop apps. A common mistake is using generic UI click actions on a web page inside a browser.
- Solution: Always use the browser-specific actions (e.g., "Click link in web page") for web applications. These actions are much more stable because they interact with the browser's DOM rather than the visual coordinates of the screen.
Mistake 3: Hardcoding File Paths
Using paths like C:\Users\JohnDoe\Desktop\File.xlsx will cause the flow to fail the moment it moves to a different machine or a server.
- Solution: Use environment variables or system variables. For example, use
%UserProfile%\Desktop\File.xlsxto ensure the flow dynamically finds the correct file path regardless of the logged-in user.
Mistake 4: Missing Error Handling in Loops
If you are processing a list of 100 items and item #45 fails, does the whole flow crash? Often, the answer is yes.
- Solution: Place your loop logic inside a "Try-Catch" block. If an item fails, log the error for that specific item, mark it as "Failed" in your tracking spreadsheet, and use the "Continue loop" action to move to the next item.
Not read yet
Industry Standards and Governance
When scaling desktop automation across an organization, you must implement governance. Automation is not just about building flows; it is about managing a digital workforce.
The Role of the Center of Excellence (CoE)
An effective automation strategy requires a Center of Excellence (CoE). This team defines the standards for how flows are built, named, and deployed. They ensure that:
- Every flow has a clear owner.
- Every flow has documentation explaining its purpose and its data sources.
- Sensitive credentials are stored in secure vaults (like Azure Key Vault) rather than hardcoded in the flows.
Version Control
Power Automate Desktop allows you to save flows, but it does not have a native "Git-like" branching and merging system for individual actions. To manage versions, adopt a naming convention: ProjectName_ProcessName_v1.0.0. Periodically export your flows as .msflow files and save them in a shared repository (like SharePoint or GitHub) as a backup.
Monitoring and Alerting
Industry standards dictate that you should never have a "silent failure." If a flow fails, it must trigger an alert.
- Set up "Flow failure" notifications in the Power Automate portal.
- Create a dedicated "Monitoring" cloud flow that runs daily to check the health of all desktop machines in your fleet.
- Use Power BI to visualize your automation success rates. If a process has a 90% success rate, it is costing the business time in manual rework; your goal should be 99% or higher.
Not read yet
Quick Reference: Execution Options
| Execution Method | Best For | Complexity |
|---|---|---|
| Manual (Console) | Development, Testing, Ad-hoc tasks | Low |
| Cloud-Triggered | Real-time workflows, Email processing | Medium |
| Scheduled | Batch jobs, End-of-month reporting | Medium |
| Command Line (CLI) | Integration with legacy software/CI-CD | High |
Advanced Topic: Machine Groups and Load Balancing
As your automation footprint grows, you will inevitably reach a point where one machine cannot handle the volume of work. This is where "Machine Groups" become essential.
What are Machine Groups?
A machine group is a collection of machines that share the same configuration and authorized users. When you trigger a desktop flow to run on a machine group, the Power Automate platform automatically performs load balancing. It looks for the first available machine in the group and assigns the job to it.
Why Load Balancing Matters
Imagine you have a process that generates 500 invoices per hour. If you run this on a single machine, it might take 5 hours to complete. If you add 5 machines to a machine group, the platform can distribute these 500 tasks across all 5 machines, potentially reducing the execution time to 1 hour. This is the cornerstone of scaling your automation program.
Configuration Steps
- In the Power Automate portal, navigate to "Monitor" > "Machines."
- Create a new "Machine group."
- Install the "Power Automate machine runtime" on every machine you want to include in the group.
- During installation, register each machine to the same Machine Group ID.
- In your cloud flow, instead of selecting a specific machine, select the "Machine group" as the target.
Not read yet
Frequently Asked Questions
Q: Can I run a desktop flow if the machine is locked? A: Yes, provided you are using an "Unattended" license and the machine is properly configured for unattended execution. The Power Automate service will manage the session independently of the lock screen.
Q: How do I handle pop-ups that appear randomly? A: Use "If window exists" or "If UI element exists" actions at the beginning of your loops. These conditional checks allow you to handle unexpected pop-ups (like "Update available" or "Save changes?") gracefully without failing the flow.
Q: What happens if the internet connection drops? A: Desktop flows rely on the cloud connection to receive the "Start" signal. If the connection drops during execution, the local flow will continue to run, but the status update will not be sent back to the cloud portal until the connection is restored. It is best practice to have a local logging mechanism (like a text file) as a fallback.
Q: Is it possible to pass variables from the desktop back to the cloud? A: Yes. You can define "Output variables" in your desktop flow. Once the flow completes, these variables are passed back to the cloud flow, where you can use them in subsequent steps (e.g., updating a database or sending an email with the result).
Not read yet
Key Takeaways
- Match the Execution Mode to the Requirement: Choose Attended for human-in-the-loop tasks and Unattended for high-volume, background processing.
- Prioritize Resilience: Use dynamic wait actions instead of hardcoded timers to ensure your flows can handle varying system speeds and application response times.
- Centralize Management: Always trigger your desktop flows from the cloud whenever possible. This gives you access to centralized logging, scheduling, and monitoring capabilities.
- Implement Defensive Coding: Assume your applications will fail. Wrap your interactions in error-handling blocks and design your flows to "self-heal" or notify you immediately upon failure.
- Scale with Machine Groups: When you need to increase throughput, use machine groups to automatically distribute the workload across multiple machines, preventing bottlenecks.
- Governance is Mandatory: Establish clear ownership, documentation, and security standards for your automation assets to ensure long-term maintainability and compliance.
- Use Service Accounts: Never run unattended automations using personal user credentials; always use dedicated, low-privilege service accounts to maintain security and consistency.
By mastering these methods and following these best practices, you move beyond simply "recording clicks" and begin building a professional, scalable, and reliable automation architecture. Desktop flows are a powerful tool, but their true value is realized only when they are orchestrated with the same rigor and discipline as any other enterprise software development project.
Not read yet
Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.
- Leveraging the Power Automate Ecosystem
- Leveraging the Power Automate Ecosystem Quiz5q
- Cloud Flows vs Desktop Flows
- Cloud Flows vs Desktop Flows Quiz5q
- Designing Desktop and Cloud Flow Automations
- Designing Desktop and Cloud Flow Automations Quiz5q
- Trigger Types for Cloud Flows
- Trigger Types for Cloud Flows Quiz5q
- Target Application and Browser Interactions
- Target Application and Browser Interactions Quiz5q
- Methods for Running Desktop Flows
- Methods for Running Desktop Flows Quiz5q
- Concurrent Flow Execution
- Concurrent Flow Execution Quiz5q
- Attended vs Unattended Desktop Flows
- Attended vs Unattended Desktop Flows Quiz5q
- HTTP Actions in Cloud and Desktop Flows
- HTTP Actions in Cloud and Desktop Flows Quiz5q
- Work Queues for Automation
- Work Queues for Automation Quiz5q
- Designing Custom Actions
- Designing Custom Actions Quiz5q
- Cloud Flow Calling Desktop Flow
- Cloud Flow Calling Desktop Flow Quiz5q
- Child Cloud Flows and Data Passing
- Child Cloud Flows and Data Passing Quiz5q
- External API Calls in Cloud Flows
- External API Calls in Cloud Flows Quiz5q
- Trigger Conditions and Concurrency
- Trigger Conditions and Concurrency Quiz5q
- Timeout and Retry Policies
- Timeout and Retry Policies Quiz5q
- Data Objects and Operations in Cloud Flows
- Data Objects and Operations in Cloud Flows Quiz5q
- Text Parsing JSON XML CSV
- Text Parsing JSON XML CSV Quiz5q
- UI Options in Desktop Flows
- UI Options in Desktop Flows Quiz5q
- Datatables Lists and Custom Objects
- Datatables Lists and Custom Objects Quiz5q
- Subflows in Desktop Flows
- Subflows in Desktop Flows Quiz5q
- External APIs in Desktop Flows
- External APIs in Desktop Flows Quiz5q
- Timeout and Retry in Desktop Flows
- Timeout and Retry in Desktop Flows Quiz5q
- Custom Actions in Desktop Flows
- Custom Actions in Desktop Flows Quiz5q
- Flow Control and Loops
- Flow Control and Loops Quiz5q
- Expressions in Cloud Flows
- Expressions in Cloud Flows Quiz5q
- Variable Actions for Flows
- Variable Actions for Flows Quiz5q
- Secure Input and Output Data
- Secure Input and Output Data Quiz5q
- Desktop Flow Priority and Queues
- Desktop Flow Priority and Queues Quiz5q
- Exception Handling Blocks
- Exception Handling Blocks Quiz5q
- Business Exception Error Handling
- Business Exception Error Handling Quiz5q
- Work Queues in Flows
- Work Queues in Flows Quiz5q
- Building a Custom Connector
- Building a Custom Connector Quiz5q
- Custom Connector Authentication
- Custom Connector Authentication Quiz5q
- Custom Connector Policy Templates
- Custom Connector Policy Templates Quiz5q
- Code in Custom Connectors
- Code in Custom Connectors Quiz5q
- Credential Management Practices
- Credential Management Practices Quiz5q
- On-Premises Data Gateway
- On-Premises Data Gateway Quiz5q
- Dataverse Solutions Components
- Dataverse Solutions Components Quiz5q
- Machine and Machine Group Requirements
- Machine and Machine Group Requirements Quiz5q
- Machine Registration Management
- Machine Registration Management Quiz5q
- Machine Group Management
- Machine Group Management Quiz5q
- Load Balancing Desktop Flows
- Load Balancing Desktop Flows Quiz5q
- Run Queue Operations
- Run Queue Operations Quiz5q
- Analyzing Flow Run History
- Analyzing Flow Run History Quiz5q
- Power Automate Analytics Dashboard
- Power Automate Analytics Dashboard Quiz5q
- Desktop Flow Monitoring
- Desktop Flow Monitoring Quiz5q
- Automation Performance Optimization
- Automation Performance Optimization Quiz5q
- Troubleshooting Flow Failures
- Troubleshooting Flow Failures Quiz5q
- Center of Excellence RPA Analytics
- Center of Excellence RPA Analytics Quiz5q
No PL-500 practice exam yet
Your points already work on 76 Amazon, CompTIA and Microsoft exams.
See the exams