Cannot update a Queue Item to "Failed" - uniqueness of key?


I am having problems setting a QueueItem to “Failed” when a QueueItem already exists in an Orchestrator queue with the same content and is in a “Failed” status. Is this an issue with the uniqueness of the QueueItem key?

Basically, I have a control loop where I catch any exceptions and set a QueueItem to “Failed” status for reason “Application”. After this in my try-catch I add a “New” QueueItem with the same contents as the QueueItem that I just set to “Failed”. This works fine if that given combination of status and contents fails once, but if the “New” QueueItem I added were to hit an exception at some point during another run, the “New” QueueItem is not being set to “Failed” and another “New” QueueItem is still being inserted. So basically I might end up with 4 or 5 “New” QueueItems all with identical content after 4 or 5 runs that have hit an exception (perhaps for system timeout), and only 1 “Failed” QueueItem.

My only guess is that Orchestrator is only setting the very first instance of the QueueItem to “Failed” due to a lack of uniqueness of the key it uses.

Edited: I did a run through a Queue to inspect the “ItemKey” and “Id” for each QueueItem. It appears the “ItemKey” is unique, and “Id” should be sequential. So that makes me think its less likely to be a key issue. Anyone who works with UIPath, are you able to help with how the set transaction status activity is implemented?

Any help would be greatly appreciated :slight_smile: