Title: Queue Item Stuck in “In Progress” After Bot Crashes - How to Auto-Reset?

Question:
My REFramework bot processes Orchestrator Queue items. When the bot crashes mid-transaction (network issue, app crash, robot service stops), the queue item stays stuck in “In Progress” status and never gets retried.
What’s the best way to automatically handle orphaned queue items when the bot crashes before completing Set Transaction Status? Should I create a separate monitoring workflow to reset stuck items, or is there a built-in Orchestrator mechanism for this?

Hey @Priyesh_Shetty,

Orchestrator already handles this automatically. If the bot crashes and the job ends as faulted or stopped, Orchestrator marks the queue item as Abandoned and retries it based on the queue retry settings. You normally don’t need a separate workflow to reset stuck items. Just make sure the queue has retries enabled and REFramework exceptions are handled properly.

Hope this solves your problem.

Thanks & Happy Automation

Hi @Priyesh_Shetty

You do not need to create a separate monitoring workflow.
UiPath Orchestrator already has a built-in mechanism to handle queue items that remain In Progress when a robot crashes before Set Transaction Status

When a job stops unexpectedly (robot crash, network issue, service stop)-
1.Orchestrator detects the job termination
2.After the queue timeout / retry interval, the item is automatically released
3.The item is moved back to New or Retried based on the Queue Retry settings
You will make sure that

  1. Auto Retry is enabled in Orchestrator in Queues
  2. Max Retry Number is configured
  3. RE Framework throws a System Exception when crashes occur
    so Robot can then pick it up.
    Hope this one is helpful , Let me know if you still face the issue.

Cheers & Happy Automations

@Priyesh_Shetty

Unfortunately there is no automatic or inbuilt mechanism for this. Follow this approach and add it in the Init state so any stuck transactions will be reset to New and will be processed as normal transactions.

1 Like

Hi @Priyesh_Shetty

First, use Get Queue Items to capture the items that are “In Progress” in the queue, filtering them through the QueueItemStates property.

Then, loop through the items with For Each doing a Postpone Transaction Item to “delay” the processing of each item by 1 millisecond, as shown in the example below. In this way, the bot will capture all queue items that are “In Progress” and postpone them by 1 millisecond. Thus updating the statuses to “New” and making the items available for consumption almost instantly.

Note: Don’t forget to change the For Each TypeArgument property to UiPath.Core.QueueItem.

You can also use set Transaction Status, here you can set application/business exception.

@Priyesh_Shetty

The item if left will automatically changed to abandoned after 24 hours

if you want to handle them other ways then you might need to create a separate logic to check abandoned items and add them back if needed

cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.