Work Queues transform single-machine RPA scripts into enterprise-grade automation systems. Learn how to distribute jobs across machine groups, track every item through its full lifecycle, and build exception handling that tells you exactly what failed and why — not just that something went wrong.

Picture this: your automation team has built a solid desktop flow that processes vendor invoices by pulling data from a legacy ERP, validating amounts against a SQL database, and posting approved records to your accounting system. It works beautifully on one machine. Then someone asks why it takes six hours to process 2,000 invoices when you have eight bot machines sitting idle. That's the moment when simple "run a desktop flow on a schedule" thinking breaks down — and orchestration becomes the real job.
Scaling unattended RPA isn't about making individual flows faster. It's about designing a system where work is distributed intelligently, every item's fate is tracked, failures are caught and handled without human intervention, and you can audit the entire operation at the end of a run. Power Automate's Work Queues feature, introduced as a generally available capability in 2024, gives you the primitives to build exactly that system: a persistent, Dataverse-backed queue that your machine group drains in parallel, with built-in state tracking for every item.
By the end of this lesson, you'll be able to design and implement a production-grade orchestration framework using Work Queues. Specifically:
What you'll learn:
Before diving in, you should be comfortable with:
A Power Automate Premium license (or Process license) is required. Work Queues are a Dataverse feature, so your environment needs Dataverse enabled.
Let's establish a mental model before touching any configuration, because the most expensive mistakes in RPA orchestration come from architectural misunderstandings rather than coding errors.
A properly designed orchestration system has three distinct layers:
Layer 1 — The Queue (Persistence & State): Work Queues live in Dataverse. Each queue item holds your input payload (a JSON blob), a processing state, retry count, expiry timestamp, priority, and an optional notes field. The queue is the source of truth for what work needs doing and what has already happened. Nothing is in memory; everything is persisted.
Layer 2 — The Dispatcher (Cloud Flow): A cloud flow — triggered by a schedule, an HTTP request, a SharePoint file arrival, or any other cloud trigger — is responsible for populating the queue with items. The dispatcher knows nothing about which machine processes an item; that's not its job. Its job is to create well-formed queue items and set appropriate metadata.
Layer 3 — The Worker (Desktop Flow + Machine Group): A desktop flow running unattended on a machine group repeatedly dequeues one item, processes it, marks the outcome, and loops. Because the machine group can run multiple concurrent sessions, multiple workers drain the queue simultaneously.
This separation of concerns is deliberate and important. The dispatcher doesn't need to know machine capacity. The worker doesn't need to know where items came from. The queue is the contract between them.
Every queue item moves through a defined state machine. Understanding these states prevents the most common bugs:
The distinction between ITException and BusinessException matters tremendously for operations. IT exceptions warrant retry; business exceptions usually need human review. Building your flows to set the right exception type is what separates a maintainable production system from a pile of "Exception" statuses that nobody understands a week later.
Key insight
The queue doesn't retry items automatically. Retry logic is your responsibility — either by re-queuing the item from a cloud flow that monitors exceptions, or by having the worker re-queue certain failure types directly. Work Queues give you the primitives; you design the policy.
The dispatcher is typically a cloud flow. Let's walk through a realistic scenario: you have a SharePoint list of vendor invoices approved for payment. Each night at 11 PM, the dispatcher reads all unprocessed invoices and enqueues them for your bot fleet to process.
In Power Automate, navigate to Monitor > Work Queues (you may find this under the left navigation's More section depending on your tenant configuration). Click New work queue.
Configure:
VendorInvoiceProcessingLeave the default retry policy for now — we'll revisit this after understanding how retry works in context.
Create a scheduled cloud flow that runs at 11 PM. The flow needs these actions:
Get invoice data: Use the SharePoint "Get items" action to retrieve all items where ProcessingStatus equals Approved and QueuedForBot equals No. This prevents double-queuing if the flow runs again before the previous batch finishes.
Loop through invoices and create queue items: Inside an Apply to Each action, add the Add item to work queue action (available in the Work Queues connector). Configure it:
VendorInvoiceProcessing from the dropdown{
"InvoiceId": "@{items('Apply_to_each')?['ID']}",
"VendorCode": "@{items('Apply_to_each')?['VendorCode']}",
"InvoiceNumber": "@{items('Apply_to_each')?['InvoiceNumber']}",
"Amount": "@{items('Apply_to_each')?['Amount']}",
"DueDate": "@{items('Apply_to_each')?['DueDate']}",
"PO_Reference": "@{items('Apply_to_each')?['POReference']}"
}
1 (high); otherwise 2 (normal). An expression like if(lessOrEquals(dayDifference(utcNow(), items('Apply_to_each')?['DueDate']), 3), 1, 2) works here.480 (8 hours). If the item hasn't been processed by 7 AM the next morning, it expires rather than being processed during business hours when the ERP is busy with users.Mark invoices as queued: After successfully creating the queue item, update the SharePoint item to set QueuedForBot to Yes. This prevents re-queuing on subsequent runs.
Warning
Don't use "Apply to each" with parallelism to bulk-create queue items at high speed if you're enqueuing thousands of items. The Work Queues API has throttle limits. Use batching with delays between chunks of 100-200 items to avoid hitting Dataverse API limits and failing your dispatcher run.
After the dispatcher runs, navigate to Monitor > Work Queues, click your queue, and verify items appear in Queued status. You can inspect each item's input payload directly in the portal. This verification step is worth building into your dispatcher as well — the last action can run a "Get work queue" action and write the item count to a monitoring log or send a summary Teams message.
The worker desktop flow is where the real automation lives. Its structure follows a disciplined pattern: get an item, process it, handle success, handle failure, repeat. Let's build this out in full.
Your desktop flow should be organized into subflows for maintainability. If you haven't explored subflows yet, Subflows and Reusable Logic in Power Automate Desktop covers the design principles that apply directly here.
The main flow should look like this at a high level:
Main:
→ Initialize environment (open apps, log in)
→ LOOP:
→ Dequeue next item
→ IF item exists:
→ Process item (call subflow)
→ Mark item outcome
→ ELSE:
→ Break loop (queue empty)
→ Clean up (close apps, log out)
Use the Dequeue item from work queue action. Configure:
VendorInvoiceProcessingWorkQueueItemWhen this action runs successfully and an item is available, WorkQueueItem contains the full queue item object. When no items are available (queue is empty or all remaining items are locked by other workers), the action will return a null-ish result — specifically, the WorkQueueItem variable will be empty. You need to check this:
# After dequeue action:
IF WorkQueueItem = $nothing OR WorkQueueItem['Id'] = ''
GOTO CleanupLabel
END IF
The dequeue action also atomically sets the item's state to Processing and locks it. No other worker in your machine group will receive the same item. This is the fundamental concurrency guarantee you get for free.
The queue item's input is a JSON string stored in WorkQueueItem['Input']. Parse it into usable variables:
# Convert JSON to custom object
SET %JsonPayload% TO WorkQueueItem['Input']
CONVERT JSON text to custom object: %JsonPayload% → %InvoiceData%
# Extract individual fields
SET %InvoiceId% TO %InvoiceData['InvoiceId']%
SET %VendorCode% TO %InvoiceData['VendorCode']%
SET %InvoiceNumber% TO %InvoiceData['InvoiceNumber']%
SET %Amount% TO %InvoiceData['Amount']%
SET %DueDate% TO %InvoiceData['DueDate']%
Tip
Always validate required fields immediately after parsing. If InvoiceId or VendorCode is empty or null, that's a business exception — the work item was malformed at creation. Mark it as a BusinessException right here with a clear reason ("Missing required field: VendorCode") rather than letting the flow crash deeper in processing where the error message will be cryptic.
Call your processing subflow — let's call it ProcessInvoice. This subflow encapsulates all the ERP navigation, validation, and posting logic.
CALL subflow ProcessInvoice (InvoiceId: %InvoiceId%, VendorCode: %VendorCode%, Amount: %Amount%)
→ Returns: %ProcessingResult%, %ProcessingNotes%
Inside ProcessInvoice, you're doing the actual automation: launching the ERP, navigating to the vendor payment screen, entering invoice data, and submitting. The pattern for applications like this is well-covered in Automating Legacy Windows Applications with UI Automation in Power Automate Desktop — the key point here is that your subflow should return structured results, not just succeed or fail.
Define an On Block Error at the subflow level that catches any unhandled exception, sets ProcessingResult to "FAILURE" and ProcessingNotes to the error message, and allows the flow to continue (not terminate). This keeps control in Main where you decide what to do with the failure.
After ProcessInvoice returns, evaluate the result and mark the queue item accordingly:
IF %ProcessingResult% = 'SUCCESS'
# Update queue item to Processed
UPDATE work queue item %WorkQueueItem['Id']%
Status: Processed
Notes: %ProcessingNotes%
ELSE IF %ProcessingResult% = 'BUSINESS_ERROR'
# Mark as BusinessException - needs human review
UPDATE work queue item %WorkQueueItem['Id']%
Status: Exception
Exception type: BusinessException
Exception reason: %ProcessingNotes%
ELSE IF %ProcessingResult% = 'IT_ERROR'
# Mark as ITException - candidate for retry
UPDATE work queue item %WorkQueueItem['Id']%
Status: Exception
Exception type: ITException
Exception reason: %ProcessingNotes%
END IF
The Update work queue item action in Power Automate Desktop accepts the item ID and the new state. For exceptions, you must provide both the exception type and a human-readable reason. Make that reason specific: "ERP login timeout after 3 attempts" is useful; "Error" is not.
Warning
If your desktop flow crashes or is terminated externally before marking an item's outcome, the item remains in Processing state indefinitely. Work Queues don't automatically time out processing items — you need to build a cleanup cloud flow that periodically scans for items stuck in Processing beyond a reasonable duration (say, 30 minutes for a flow that should finish in under 5) and transitions them to ITException. This is a critical operational safeguard for production deployments.
With the dispatcher and worker flow built, the machine group configuration is what determines your actual throughput. This is where the multiplier effect comes from.
A machine group pools multiple machines. When a cloud flow triggers a desktop flow run on a machine group, Power Automate's gateway selects an available machine. For work queue-based orchestration, the pattern is different: you don't trigger one cloud flow run per queue item. Instead, you trigger a fixed number of worker cloud flow runs (matching your machine capacity), and each worker processes items in a loop until the queue is empty.
This distinction is crucial. If you trigger one cloud flow run per queue item, you create a thundering herd problem — hundreds of simultaneous runs contend for machines, the gateway queues them, your orchestration overhead dominates, and latency per item goes up. The loop-until-empty pattern is dramatically more efficient.
Create a second cloud flow — the worker launcher. This runs immediately after (or concurrently with) the dispatcher. Its job: trigger N parallel desktop flow runs on your machine group, where N equals the number of bot sessions you want active.
# Worker Launcher Cloud Flow
Trigger: HTTP request (called by dispatcher as its final step)
# Determine concurrency based on machine group capacity
SET workerCount = 8 # Match to your machine group session count
# Launch N concurrent workers using Do Until + Parallel Branch
# Or use a simpler approach: Apply to Each with range(1, workerCount)
Apply to each [item in range(1, 8)]:
Run a flow built with Power Automate Desktop:
Desktop flow: VendorInvoiceWorker
Run mode: Unattended
Machine group: InvoiceProcessingGroup
Set the Apply to Each action's concurrency control to on, with Degree of parallelism equal to your machine group size. This launches all workers simultaneously, each claiming its own machine session.
Key insight
The number of concurrent runs you launch should match your machine group's configured maximum sessions, not the number of physical machines. A four-machine group with two sessions per machine supports eight concurrent workers. Setting this correctly is what gives you linear throughput scaling. For the full configuration guide on session counts and machine group sizing, see Deploying Unattended Desktop Flows at Enterprise Scale: Machine Group Load Balancing, Queue Management, and Run Concurrency Strategies in Power Automate.
Each worker desktop flow runs its loop independently. The inner loop in your worker looks like this:
LOOP
# Try to dequeue an item
Dequeue item from work queue 'VendorInvoiceProcessing'
→ WorkQueueItem
# If nothing returned, queue is empty - we're done
IF WorkQueueItem IS NOTHING
EXIT LOOP
END IF
# Process the item
CALL ProcessInvoice(...)
# Mark outcome (success or exception)
UPDATE work queue item ...
END LOOP
Each worker runs this loop until Dequeue returns nothing, then exits cleanly. The workers naturally spread across the available queue items without central coordination — the queue's locking mechanism handles everything.
A realistic 2,000-invoice batch on eight workers processing one item every 45 seconds means: 8 workers × 80 items per worker × 45 seconds = approximately 60 minutes total. Compare that to 2,000 items × 45 seconds single-threaded = 25 hours. That's the value of this architecture.
Exception handling in a work queue system has three dimensions: detecting failures correctly, categorizing them meaningfully, and driving the right recovery action. Let's work through each.
Inside your ProcessInvoice subflow, build a structured error classification rather than a single catch-all handler:
On Block Error in ProcessInvoice:
# Capture the error
SET %ErrorMessage% TO %LastError.Message%
SET %ErrorType% TO 'IT_ERROR' # Default to IT
# Classify the error
IF %ErrorMessage% CONTAINS 'duplicate invoice'
SET %ErrorType% TO 'BUSINESS_ERROR'
SET %ProcessingNotes% TO 'Duplicate invoice detected: ' + %InvoiceNumber%
ELSE IF %ErrorMessage% CONTAINS 'amount exceeds approval limit'
SET %ErrorType% TO 'BUSINESS_ERROR'
SET %ProcessingNotes% TO 'Amount ' + %Amount% + ' exceeds single-approval limit'
ELSE IF %ErrorMessage% CONTAINS 'vendor not found'
SET %ErrorType% TO 'BUSINESS_ERROR'
SET %ProcessingNotes% TO 'Vendor code ' + %VendorCode% + ' not found in ERP master data'
ELSE IF %ErrorMessage% CONTAINS 'login' OR %ErrorMessage% CONTAINS 'timeout'
SET %ErrorType% TO 'IT_ERROR'
SET %ProcessingNotes% TO 'Infrastructure failure: ' + %ErrorMessage%
ELSE IF %ErrorMessage% CONTAINS 'Connection refused'
SET %ErrorType% TO 'IT_ERROR'
SET %ProcessingNotes% TO 'Network/connection failure: ' + %ErrorMessage%
END IF
SET %ProcessingResult% TO 'FAILURE_' + %ErrorType%
Continue flow execution
This classification has real operational value. When your team reviews the queue at 7 AM, they see:
Without classification, all 18 failures look the same and diagnosis takes ten times longer.
Approach 1: Re-queue in the Desktop Flow
For IT exceptions that might resolve if retried immediately (brief network blip, momentary app freeze), you can re-queue the item directly from the worker:
IF %ErrorType% = 'IT_ERROR' AND %RetryCount% < 3
# Requeue the item with incremented retry metadata
SET %RetryPayload% TO %OriginalPayload%
SET %RetryPayload['RetryCount']% TO %RetryCount% + 1
SET %RetryPayload['OriginalItemId']% TO %WorkQueueItem['Id']%
Add item to work queue 'VendorInvoiceProcessing'
Input: %RetryPayload%
Priority: 1 # Elevated for retry
# Mark original as processed (with note it was retried)
UPDATE work queue item %WorkQueueItem['Id']%
Status: Processed
Notes: 'Requeued for retry attempt ' + (%RetryCount% + 1)
ELSE
# Exhausted retries or business error - park it
UPDATE work queue item %WorkQueueItem['Id']%
Status: Exception
Exception type: %ErrorType%
Exception reason: %ProcessingNotes%
END IF
Note
Store RetryCount in the input payload itself so the retry metadata persists across queue item boundaries. The queue item doesn't have a native retry counter you can increment directly from the desktop flow — you manage that field in your JSON payload.
Approach 2: Re-queue from a Monitoring Cloud Flow
A more robust pattern uses a cloud flow that runs periodically (every 30 minutes or at the end of the batch) to inspect exception items and re-queue ITExceptions:
Cloud flow: RequeueITExceptions
Trigger: Recurrence (every 30 minutes)
1. List work queue items where:
- Queue: VendorInvoiceProcessing
- Status: Exception
- Exception type: ITException
- RetryCount (from parsed notes/input) < 3
2. For each eligible item:
a. Parse original input
b. Increment retry counter in payload
c. Add new queue item with updated payload
d. Update original item status to Processed (with note: "Requeued")
This approach keeps retry logic in the cloud, where you have better visibility and control. It also works even if the desktop flow crashes mid-run and can't re-queue itself.
As mentioned in the warning above, items left in Processing state due to crashes are a silent killer. Here's the cleanup cloud flow:
Cloud flow: CleanupStuckProcessingItems
Trigger: Recurrence (every 15 minutes)
1. List work queue items where:
- Status: Processing
- Modified (timestamp) < utcNow() - 30 minutes
2. For each stuck item:
a. Update status to Exception
b. Exception type: ITException
c. Reason: 'Item stuck in Processing state - likely desktop flow crash or machine restart'
d. Optionally: re-queue if retry count allows
3. Send alert to Teams or email with count of recovered items
The 30-minute threshold should be set to 2–3x your typical item processing time. If your flow processes one invoice in 45 seconds, a 10-minute timeout is generous. If some items take 5 minutes, use 20 minutes.
Building the automation is half the job. Making it observable is what keeps it running in production.
The Work Queues section in Power Automate Monitor gives you:
For daily operations, train your team to check this dashboard first thing in the morning after overnight batch runs. The visual breakdown of Processed vs. Exception counts is your first signal of whether something needs attention.
For enterprise deployments, the native monitor isn't enough. Build a Power BI or Power Pages dashboard that queries Dataverse directly. The Work Queue Items table in Dataverse is called flowsession_workqueueitem (always verify the actual table name in your environment via the maker portal's table browser, as it may vary).
A Power BI dataset connecting to Dataverse can show:
This level of visibility is what allows you to spot trends — maybe IT exceptions spike every Wednesday morning because a scheduled maintenance window on the ERP runs at 2 AM, right when your bots are working. That's an insight you act on by either adjusting your batch timing or making the bot aware of the maintenance window.
For deeper monitoring techniques applied specifically to desktop flows at scale, Monitoring and Troubleshooting Desktop Flow Runs at Scale covers the cloud-side observability patterns that complement the queue-level monitoring here.
Tip
Add a custom ProcessingDuration field to your output notes by recording a timestamp at the start of ProcessInvoice and calculating elapsed seconds at the end. Store this in the queue item notes. Dataverse lets you query and aggregate this, giving you real per-item performance data that the native monitor doesn't surface.
Wire up alerts so the right people know when things go wrong. A cloud flow that runs at the end of your batch window and counts exception items works well:
Cloud flow: BatchCompletionAlert
Trigger: Scheduled (7 AM - end of overnight window)
1. Count queue items by status:
- Processed count
- BusinessException count
- ITException count
- Still Queued count (didn't get processed - capacity issue?)
2. Calculate exception rate = exceptions / (processed + exceptions)
3. IF exception rate > 0.05 (5%)
Send Priority: High alert to operations channel
Include: exception breakdown, link to queue monitor
ELSE IF exceptions > 0
Send normal summary to log channel
ELSE
Send success notification
Five percent is a reasonable default threshold, but calibrate it to your process. A payment posting workflow with 2% exception rate might be acceptable (some invoices will always need human review). A data extract workflow should run at near-zero exceptions.
Work Queues support priority values as integers. By convention, lower numbers mean higher priority (1 beats 2). Design your priority scheme before you build the dispatcher:
The Dequeue item action always dequeues the highest-priority (lowest-number) available item first, then oldest-first within the same priority level. This FIFO-with-priority behavior is automatic — you don't need to implement it.
One trade-off: if you continuously enqueue Priority 1 items, your Priority 3 items may never get processed. This is called starvation. For long-running queue-based systems, build a promotion mechanism: a cloud flow that runs every 2 hours and bumps items that have been queued longer than 4 hours up by one priority level.
A single work queue per process type is clean, but real enterprises need multiple queues. Consider an architecture where:
InvoicePriority1Queue handles urgent invoices, reserved for 2 dedicated machinesInvoiceStandardQueue handles normal invoices, spread across the remaining 6 machinesInvoiceBackfillQueue handles historical reprocessing, only runs when other queues are emptyYou implement this by having worker flows check queues in order: attempt to dequeue from Priority1Queue, if empty fall through to StandardQueue, if empty fall through to BackfillQueue. This gives you workload isolation without separate machine fleets.
Key insight
Work Queues don't have native queue routing or worker affinity. You build routing logic in your worker flow. The simplicity of this is also its limitation — complex routing scenarios (say, certain items must run on specific machines that have particular software installed) require you to manage machine-to-queue affinity yourself, usually through naming conventions and multiple targeted cloud flow triggers.
The JSON input payload is your contract between the dispatcher and the worker. Design it thoughtfully:
Include everything the worker needs — nothing it doesn't. The worker should never need to query a database to retrieve data that the dispatcher already had access to. If the dispatcher read from SharePoint, include all relevant fields in the payload. Database round-trips from the worker to look up data slow processing and add failure points.
Include context, not just keys. Don't just include InvoiceId: "12345". Include InvoiceNumber: "INV-2024-12345" and VendorName: "Acme Corp" too. When this item appears in exception notes, human reviewers can immediately identify it without looking anything up.
Include a schema version field. Add "PayloadVersion": "2.1" to your JSON. When you evolve the payload structure, the worker can check the version and handle both old and new formats during transition. Without this, deploying a dispatcher change while old-format items are still in the queue breaks your worker.
Keep payloads small. Dataverse has limits on field sizes, and large payloads slow queue operations. If you need to pass a large data structure (a full purchase order with 50 line items), store it in SharePoint or Blob Storage and pass only the reference URL in the queue item.
Unattended workers that log into ERPs, SAP, or web applications need credentials. Never hardcode them in the desktop flow, and never store them in the queue payload. Use Azure Key Vault or the Power Automate Desktop credential manager. For a comprehensive treatment of this, see Handling Credentials Securely in Desktop Flows: Sensitive Variables and Azure Key Vault.
One pattern specific to work queue workers: retrieve credentials once at session startup (before the loop begins), store them in flow variables, and reuse throughout the session. This avoids a Key Vault API call on every item, which both improves performance and reduces your Key Vault transaction costs.
Build the following system end-to-end. Use Notepad as a stand-in for your "ERP" so you don't need any specific application installed.
You have a CSV file with 20 employee expense reports, each with an EmployeeId, Amount, and Category. Your task: build an orchestrated system that processes each expense through a "validation" desktop flow (which opens Notepad, types a processing entry, and saves the file), tracks outcomes in a work queue, and handles failures.
Create a work queue named ExpenseReportProcessing in your Power Automate environment. Enable input validation and prioritization.
Create a cloud flow triggered manually (Instant cloud flow, manually triggered). The flow should:
EmployeeId, Amount, and CategoryCreate a desktop flow named ExpenseReportWorker with these subflows:
"Processing expense for Employee %EmployeeId%, Amount: %Amount%", wait 2 seconds, close Notepad. Return ProcessingResult = 'SUCCESS'.Amount contains the value 999, set ProcessingResult = 'BUSINESS_ERROR' with reason "Magic test amount triggers rejection." This lets you see exception handling in action.Create a second cloud flow that launches 2 concurrent instances of ExpenseReportWorker on a machine group (or a single machine if you're testing). The launcher should be called by your dispatcher as its final step.
After running the full system:
Stretch goal: Build the cleanup cloud flow that marks any item stuck in Processing for more than 10 minutes as an ITException. Test it by pausing your desktop flow mid-run using a breakpoint in the desktop flow designer.
New builders assume Dequeue item raises an error when the queue is empty. It doesn't — it just returns nothing. If you don't check for an empty result before trying to access WorkQueueItem['Input'], your flow crashes with a "variable doesn't exist" error that looks like a bug in your processing logic. Always null-check the dequeue result immediately.
If your machine group supports 4 concurrent sessions and you launch 10 workers, 6 workers queue up waiting for machines. Meanwhile, the first 4 workers drain the queue. The late-arriving workers find an empty queue and exit immediately, wasting startup overhead. Match worker count to session capacity precisely.
Exception reason: "Error occurred". This is useless. A week from now, nobody knows what failed or why. Enforce a standard format: [ErrorType] in [Component]: [SpecificMessage]. Example: [ValidationError] in ERP VendorLookup: Vendor code VND-9981 returned 404 from master data API. This takes 30 seconds to implement and saves hours of investigation.
The dispatcher's job is to create queue items, not to decide how to process them. Avoid the temptation to add processing logic to the dispatcher ("if the amount is over $10,000, skip it"). Business rules belong in the worker's classification logic, where they can be updated without changing how items enter the queue.
Setting no expiry means queue items accumulate forever if your bots go down. A 10,000-item backlog from last week will mix with today's items and confuse your priority scheme. Always set an expiry appropriate to your business SLA. Items that expire appear in a special Expired status and don't block the queue.
Symptom: Your worker processes the same item repeatedly, creating duplicate postings in your ERP.
Cause: You're successfully dequeuing the item but failing to mark it as Processed before the next dequeue call. If you accidentally call Dequeue again inside your processing logic (maybe in a subflow that also has a dequeue call), or if your item marking is inside a branch that gets skipped, the item stays in Queued status and gets picked up again.
Fix: Add logging immediately after each dequeue that records the item ID. Add logging immediately before each UPDATE work queue item call. Compare the logs — you'll find where the state update is being missed.
Work queue actions in Power Automate Desktop run under the connection established in your desktop flow connection. If you're seeing access denied errors, check:
You've built a complete mental model of work queue-based RPA orchestration: the three-layer architecture (queue, dispatcher, worker), how to populate and configure a queue with realistic business-aware settings, how to build a worker that correctly transitions item states through the full lifecycle, and how to run multiple workers in parallel across a machine group.
The difference between this architecture and "trigger a flow on a schedule" is immense. You now have:
Where to go from here:
Harden your exception handling by going deeper on the On Block Error patterns in desktop flows — Error Handling in Desktop Flows: On Block Error, Retry Policies, and Recovery Screenshots is the essential companion to this lesson.
Apply this to real legacy systems. Invoice processing on an older ERP? See Automating Legacy Windows Applications with UI Automation in Power Automate Desktop. SAP-specific orchestration? Automating SAP GUI Interactions with Power Automate Desktop: Navigating Transactions, Extracting Table Data, and Handling Session Errors covers the session management details that matter when SAP is your target system.
Build a full enterprise framework. The patterns here are the foundation. The complete reference for 24/7 production bot fleets — including dynamic scaling, dead letter queue handling, and cross-environment deployment — is in Building a Resilient Unattended RPA Orchestration Framework in Power Automate Desktop: Queue-Driven Job Dispatch, Machine Load Balancing, and Automated Recovery for 24/7 Production Bot Fleets.
Establish monitoring discipline. A well-built orchestration system that nobody monitors is a time bomb. Make Monitoring and Troubleshooting Desktop Flow Runs at Scale your next read.
The real payoff of work queue orchestration isn't just speed — it's confidence. You can walk away from an overnight batch knowing that every item either got processed or got a meaningful exception that tells you exactly what happened and why. That's what production-grade RPA looks like.
Power Automate Desktop & RPA