How to Prevent Concurrent Runs in Power Automate Desktop for SAP
Question details
Design a reliable Power Automate Desktop RPA solution for SAP that prevents overlapping desktop flow runs and manages 24-hour email response delays without continuous running.

- Product
- Power Automate Desktop
- Device & OS
- Windows Server 2019
- Scenario
- Multiple emails arriving simultaneously triggering overlapping SAP automation runs, and the need to wait 24 hours for email responses before proceeding.
- Observed behavior
- Automations conflict if multiple instances control the same SAP session concurrently, and keeping a desktop flow running continuously for 24 hours is highly inefficient and prone to timeouts.
Ensure you have administrator access to your Power Automate environment, the appropriate Windows Server 2019 machine groups configured, and active SAP GUI scripting enabled.
Use Cloud Flows and Queues to Control Concurrency
Implement a cloud flow to monitor the mailbox and use a queue system to manage desktop flow execution one at a time.
To prevent multiple instances from opening or controlling the same SAP session simultaneously, the automation architecture must enforce a strict concurrency limit of one.
By utilizing a centralized queue (like a SharePoint list or Dataverse table), you can safely store pending requests and process them sequentially.
In your cloud flow trigger or desktop flow action settings, click the three dots (...), select 'Settings', toggle 'Concurrency Control' to 'On', and set the degree of parallelism to 1.
Use the 'Add a new row' action in Dataverse or 'Create item' in SharePoint to store incoming email requests and set their initial processing status to 'Pending'.
Configure your desktop flow to fetch the oldest 'Pending' item from the queue, update its status to 'In Progress', execute the SAP transaction, and finally mark it as 'Completed' or 'Failed'.

Implement a Multi-Bot Architecture
Distribute queued SAP transactions across multiple virtual machines to scale up processing safely.
Manage 24-Hour Email Delays with Scheduled Flows
Avoid keeping desktop flows running for 24 hours by storing request details and checking them later with a scheduled cloud flow.
Streamline Your Business Workflows with WPS Office
While Power Automate manages your complex SAP executions and email routing, handling the resulting automation logs, data exports, and reports requires a robust office suite. WPS Office is a highly compatible, lightweight, and free alternative to Microsoft Office, making it perfect for reviewing automation data outputs on Windows Server environments.
- 1. Download and Install: Visit the official WPS Office website and download the installer to your Windows Server or local workstation.
- 2. Open Automation Logs: Launch WPS Spreadsheet to open CSV or XLSX files generated by your Power Automate data extraction tasks.
- 3. Format and Share Data: Use the built-in formatting tools to review SAP data and export the findings directly as a PDF report.

Frequently Asked Questions
Why shouldn't I keep a Power Automate desktop flow running for 24 hours?
Keeping a desktop flow running continuously locks up the machine's resources, prevents other critical automation tasks from executing, and dramatically increases the risk of the flow failing due to temporary network interruptions or session timeouts.
Can multiple desktop flows control the same SAP session at the same time?
No, allowing multiple desktop flow instances to interact with the same active SAP user session simultaneously will cause application conflicts, severe data entry errors, and potential session crashes. A concurrency limit is strictly required.
What unique identifiers should I use to track email responses in a scheduled flow?
You can accurately track asynchronous email responses by matching the original Message ID, the Conversation ID, a specific structured Subject Line, or a custom reference number generated and injected into the email body during the initial request.




