3.2 Retry Mechanisms: Queue Retries vs. REFramework MaxRetryNumber
Key Takeaways
Queue Auto Retry is set on the queue (Failed items and Abandoned items options, Max # of retries 1-50); a Failed item with ErrorType Application becomes Retried and a new copy with RetryNo + 1 is added as New.
Business exceptions are never retried automatically; Abandoned items are retried only when the queue's Abandoned items option is selected.
MaxRetryNumber (Constants sheet) drives robot retries for non-queue data: the retry counter rises while io_TransactionNumber stays the same, so the same record is fetched again.
For queue items the template defers to Orchestrator even when MaxRetryNumber is above 0, which is why its description says it must be 0 with queues.
A System Exception retry passes through Initialization, which reopens the applications that SetTransactionStatus.xaml already closed.
3.2 Retry Mechanisms: Queue Retries vs. REFramework MaxRetryNumber
Core Concept: REFramework can retry a failed transaction in two places. Orchestrator Queue Auto Retry is configured on the queue and creates a new copy of an item that failed with an application (system) exception. Robot retry, controlled by
MaxRetryNumberon the Constants sheet ofConfig.xlsx, re-processes the same record inside the running job and is meant for data that does not come from a queue. Knowing which one applies, and what the template actually does with each, is a favorite exam topic.
Transient failures are normal in production: a web portal times out, a Citrix session lags, a database is briefly locked. A retry gives the transaction a second chance after the robot has reset its applications. The question is who owns that retry.
Mechanism 1: Orchestrator Queue Auto Retry
When you create or edit a queue in Orchestrator, the Auto Retry section controls retries. In current Automation Cloud Orchestrator it has two checkboxes:
- Failed items — retries items that fail with an application exception.
- Abandoned items — also retries items that were abandoned. When this is selected, the Max # of retries field appears, and it accepts a value from 1 to 50.
When the performer sets an item to Failed with ErrorType = Application and retries remain, Orchestrator does the following:
- The original item's status becomes Retried (not Failed), which records that a new attempt was created.
- Orchestrator adds a new item with status New that carries the same
SpecificContentandReference, and itsRetryNois one higher than the original's. - Any robot that calls Get Transaction Item can pick up the copy, according to the normal priority and deadline ordering.
- When the last allowed attempt also fails, that final item keeps the status Failed.
Two outcomes need special attention:
- Business exceptions. An item set to Failed with ErrorType = Business is never retried automatically, whatever the queue settings are, because the data itself is wrong.
- Abandoned items. An item left In Progress for about 24 hours becomes Abandoned. It is retried automatically only if the queue's Abandoned items option is on. Otherwise a reviewer can set the revision status Retried in Orchestrator, which adds a new copy. Manual retries do not count toward Max # of retries.
Changing Max # of retries affects only transactions that fail after the change; items that already failed are not retried retroactively.
Mechanism 2: Robot Retry with MaxRetryNumber
MaxRetryNumber is a row on the Constants sheet. Its description in the template reads, in effect, must be 0 if working with Orchestrator queues; if greater than 0, the robot retries the same transaction that failed with a system exception.
The logic sits in SetTransactionStatus.xaml (in recent template versions it is split into Framework\RetryCurrentTransaction.xaml). After a System Exception it decides between these branches:
| Situation | What the template does | Effect on the next cycle |
|---|---|---|
MaxRetryNumber = 0 | Logs the exception and increments io_TransactionNumber. | The next record (or the next queue item) is fetched. |
MaxRetryNumber > 0, the item is a QueueItem | Copies in_TransactionItem.RetryNo into io_RetryNumber, logs either "Retry" or "Max number of retries reached", then increments io_TransactionNumber. | The framework does not re-process the item locally. Orchestrator's queue retry (if enabled) supplies the copy. |
MaxRetryNumber > 0, not a queue item, retries remain | Increments io_RetryNumber and leaves io_TransactionNumber unchanged. | Get Transaction Data returns the same record again. |
MaxRetryNumber > 0, not a queue item, limit reached | Resets io_RetryNumber to 0 and increments io_TransactionNumber. | The framework moves on to the next record. |
' Simplified robot-retry decision for non-queue data (System Exception branch)
If io_RetryNumber < CInt(in_Config("MaxRetryNumber")) Then
io_RetryNumber = io_RetryNumber + 1 ' retry the same record
Else
io_RetryNumber = 0
io_TransactionNumber = io_TransactionNumber + 1 ' give up and move on
End If
Why the template says "must be 0" for queues
Because the template checks whether the transaction item is a QueueItem, a positive MaxRetryNumber does not make it re-run a queue item on the same robot. It only changes the log text, which is then driven by the queue item's RetryNo. The number of attempts is still decided by the queue's Max # of retries. Keeping MaxRetryNumber at 0 for queue-based performers keeps the logs honest and leaves one clear owner of the retry policy.
The real danger is a customized framework. If a team rewrites the retry logic so that queue items are also retried locally, each Orchestrator copy gets its own local retries. The attempts then multiply: with 2 local retries and 2 queue retries, one broken item can run (1 + 2) × (1 + 2) = 9 times. Design reviews should reject that combination.
Walkthrough: Queue Auto Retry = 2, MaxRetryNumber = 0
| Cycle | Item fetched | RetryNo | Outcome | Status afterwards |
|---|---|---|---|---|
| 1 | INV-100 (original) | 0 | System Exception (selector timeout) | Original becomes Retried; copy 1 added as New |
| 2 | INV-100 (copy 1) | 1 | System Exception again | Copy 1 becomes Retried; copy 2 added as New |
| 3 | INV-100 (copy 2) | 2 | System Exception again | Copy 2 stays Failed (no retries left) |
Between cycles the robot goes back through Initialization. io_TransactionNumber increases after each failure, because the framework always asks the queue for the next available item. The queue decides whether that is a retry copy or a different invoice.
Walkthrough: Excel rows, MaxRetryNumber = 2
Row 3 throws a System Exception. io_RetryNumber becomes 1 while io_TransactionNumber stays 3, so after re-initializing the applications, Get Transaction Data returns row 3 again. If row 3 fails twice more, the counter reaches the limit, resets to 0, and the framework moves to row 4.
Why the Retry Path Goes Through Initialization
After a System Exception, SetTransactionStatus.xaml takes a screenshot and tries CloseAllApplications.xaml, falling back to KillAllProcesses.xaml. The System Exception transition then returns to Initialization, where InitAllApplications.xaml opens fresh sessions and logs in again. The Config dictionary is already in memory, so InitAllSettings.xaml is skipped: its call sits inside an If Config Is Nothing first-run branch. The retry therefore runs against a clean application state instead of a frozen window or a half-submitted form.
An enterprise automation processes transactions from an Orchestrator Queue configured with Auto Retry set to 2. According to REFramework best practices, what value should be assigned to MaxRetryNumber in Config.xlsx?
2, to match the number of retries configured in the Orchestrator Queue
3, to provide an extra safety retry within the robot environment
1, so the robot retries once locally before deferring to Orchestrator
0, to disable framework-level retries and avoid conflicting exponential retry cycles
A developer builds an REFramework automation that processes rows from a local Excel spreadsheet (a non-queue transaction model) with MaxRetryNumber set to 2 in Config.xlsx. When the third row throws a System.Exception for the first time, how do the control variables change in RetryCurrentTransaction.xaml?
io_TransactionNumber increments by 1, and io_RetryNumber increments by 1
io_RetryNumber increments by 1, while io_TransactionNumber remains unchanged so that the same row is reprocessed
io_TransactionNumber resets to 0, and io_RetryNumber resets to 0
io_RetryNumber is set to 2 immediately, and io_TransactionNumber increments by 1
A queue has Auto Retry enabled with Max # of retries = 1. Queue item INV-7 fails with an application exception on its first attempt. What does Orchestrator show afterwards?
INV-7 is Failed and nothing else happens until an administrator retries it manually.
INV-7 is set back to New, and its RetryNo field increases to 1.
INV-7 is Abandoned because application exceptions end the item's lifecycle.
The original INV-7 is Retried, and a new INV-7 item with the same data and RetryNo 1 is added with status New.
Sections you finish are checked off in the contents.