Queue item status is failed need to retry the same activity and change the status back to successful

I have a lot of transactions happening every two mins in queue some will be successful some will be faulted. In the failed one there is a comment on why it failed depending on the comment i need to run it again. i can get the transactions using get queue item but changing status back to success and in progress from failed. what are the best options for it.

1 Like

I believe, One of the option to be followed is Get Queue Items : Use the “Get Queue Items” activity to retrieve items from the queue. You can filter the items based on their status (e.g., “Failed”).

Hi

Hope the below steps would help you resolve this

  1. Use the “Get Queue Items” activity to retrieve the failed transactions from your queue. You can filter them based on their status (e.g., “Failed”).
  2. Loop through the list of failed transactions using a “For Each” activity.
  3. Inside the loop, check the comment associated with each failed transaction to determine whether it should be reprocessed. You can use an “If” activity to make this decision.
  4. If the comment indicates that the transaction should be reprocessed, use the “Set Transaction Status” activity to change the status of the transaction back to “In Progress” or “New,” depending on your queue configuration. You can also update any other relevant information in the transaction, if needed.
  5. Implement the logic to reprocess the transaction. This may involve calling the necessary processes or activities to correct the issue that caused the failure in the first place.
  6. Once the reprocessing is complete, use the “Set Transaction Status” activity again to mark the transaction as either “Successful” or “Failed,” depending on the outcome of the reprocessing.
  7. Continue looping through the list of failed transactions until you’ve processed all the ones that need to be reattempted.

Or

U can use auto retry mechanism in queues
The auto retry mechanism in UiPath queues works by automatically retrying failed transactions until they are successful or reach the maximum number of retries.

To enable the auto retry mechanism, you need to set the Auto Retry property to Yes for the queue. You can also set the Max # of retries property to specify the maximum number of retries for each transaction.

When a transaction fails, UiPath will automatically retry the transaction after a certain delay. The delay between retries is specified by the Retry interval property.

If the transaction fails after all of the retries have been exhausted, UiPath will mark the transaction as failed and the transaction will be removed from the queue.

Check this doc for more details

https://docs.uipath.com/orchestrator/standalone/2020.10/user-guide/managing-queues-in-orchestrator#

Let us know for any further clarification

Cheers @Ajith209

Hi Palaniyappan, I am using the same logic. But set transaction activity or postpone transaction activity is not working as it is throwing an error “Set Transaction Status: Invalid transition from a final status. Error code: 1866”. it is saying success and failure is the final state and there is no way to change it from that.

1 Like

Hi, That is what i am doing but not able to change status

See this typically occurs when you try to change the status of a queue item that is already in a final state (e.g., “Successful” or “Failed”). This error indicates that you’re attempting to transition a transaction that has already completed, and it cannot be moved to another status.

To resolve this issue, you should ensure that you are only attempting to change the status of transactions that are currently in an “In Progress” or “Failed” state.

Check for the different status in queues here
This will help u to understand how to reprocess

@Ajith209

Hello @Ajith209

  1. Retrieve queue items regularly.
  2. Check if a transaction failed.
  3. Examine the failure comment.
  4. Decide to retry or skip based on the comment.
  5. Retry by changing status and reprocessing if needed.
  6. Maintain detailed logs and alerts.
  7. Implement retry limits and error handling.
  8. Test, ensure security and compliance, and plan for scalability.

Thanks & Cheers!!!

changing status is where the issue is coming. not able to change failed transactions to inprogress

Thanks for your reply, But my actual issue is that only. i need to retry something that is in failed state. i can get the item by using get queue item but i am not able to change the status

1 Like

One way to achieve this would be to use the Postpone Transaction Item activity.

To retry failed transactions in a queue based on the comments and change their status to “Success” and “In Progress,” you can implement the following workflow in UiPath:

  1. Use the “Get Queue Items” activity to fetch all the failed queue items.
  2. Loop through the retrieved queue items using a “For Each” activity.
  3. Within the loop, use a conditional statement to check the comment associated with each queue item.
  4. If the comment meets the condition that requires a retry, proceed with the following steps:
  • Use the “Set Transaction Progress” activity to change the transaction status to “In Progress.”
  • Implement the necessary logic to address the issue that caused the failure and retry the transaction.
  • If the retry is successful, use the “Set Transaction Progress” activity again to mark the transaction as “Success.”

@Ajith209

will it be possible to add comments in postpone activities?

U can change the status only when it is moved to retried
If auto retry is enabled for the queue then it changes automatically for that queue item
If auto retry is not enabled for that queue then we need to do the revision status manually to retried and then u will be able to change it

You can even find the same here in the image

Upon that change it creates a new queue item

Hope it clarifies

Cheers @Ajith209

@Ajith209

Why not use queue retry option which will add the failed items automatically back as new if it fails with system exception and those can be tried again

In the queue in orchestrator click on edit you will see the auto retry option

Also once status is set to successful or failed it cannot be changed again in queues

Cheers

You could set a comment by using Set Transaction Progress, but only when you are reprocessing the item.

Let us know if u need further clarification on this @Ajith209

immediately retrying won’t work as there are some dependency and time is a big factor. this is something that runs 24*7 and retrying something that we already know is going fail is a waste of time. That is why we are not using auto retry. The ideal scenario is to check for exception and only perticular case we need to retry.

Hi Palaniyappan,

This doesn’t fit the requirement as in my scenario there are certain exceptions only i need to retry. For example i can use postpone activity while it is in progress status and set it as new. but i should be able to add a comment and check if this is a particular exception then only retry is needed. I cannot use excel to check the exception also has to be done in queue only

1 Like

If auto retry is not preferred then Try changing the status for those failed items as RETRY manually in orchestrator and new item will get created for this queue items in your queue

Click on three dots do the failed queue item and click retry
image

@Ajith209

Just to add, you could probably add a comment using the Orchestrator api as well.