What happens when a software robot encounters an error?
Updated:
A robot may encounter an unavailable portal, a changed form, an unreadable document or invalid login credentials. The processing status should expose the failure and make clear what the robot already did. Stopping the program alone does not identify completed items or those requiring intervention.
A dangerous failure occurs when the robot continues with incorrect data or repeats an operation that already succeeded. A missing amount must not become zero. A portal outage must not be reported as an empty report. Design these responses alongside the ordinary workflow.
Identify the cause and scope first
The same “try again” button cannot handle every problem. Classify situations by what is known about the cause and outcome:
| Situation | Appropriate next step |
|---|---|
| Temporarily unavailable service before a write | Wait and retry a safe step within a defined limit. |
| Missing or ambiguous value | Pass the item for review without inventing a value. |
| Changed form or missing field | Stop the affected workflow and verify where the robot writes. |
| Invalid access or changed permissions | Resolve access with the system owner, avoiding unlimited login attempts. |
| Lost response after a write was submitted | Mark the outcome unknown and check the target system before repeating it. |
Distinguish a single-item problem from a shared environment failure. One unreadable invoice need not block other independent documents. However, continuing the whole batch may be unsafe if login fails or the robot cannot reliably identify the target form.
When retries help and when they hurt
A retry can help with a temporary failure. Before enabling it, define the repeated step, attempt limit, waiting time and action after attempts are exhausted. Waiting generally cannot repair invalid input.
Power Automate’s documentation distinguishes error handling for individual actions and whole blocks. A block retry starts from the beginning of the block. Check whether this would repeat writes that have already completed.
Immediate retries by several robots can worsen overload. AWS explains bounded retries, backoff and random variation in waiting time to spread attempts over time. Set limits according to the service and acceptable processing time. Exceeding a limit needs an explicit status and handover, rather than an endless loop.
Handling an unknown write outcome
Consider an illustrative case: the robot submits invoice F-104, but the response is lost. The invoice may have been created even though the robot sees an error. Clicking “Save” again could create a second record.
First look up the outcome using the agreed identifier, which must also distinguish suppliers. Check the amount, currency and other decisive values. One correct record allows processing confirmation to be recovered. Conflicting records, several matches or unreliable lookup require manual review. An immediately empty result may not prove failure if new records take time to appear.
If an API supports idempotency, the same intent can be repeated under its rules without another write. AWS describes request identifiers for this purpose. The target API must provide the protection. Check its validity period and use of the same data. A local “sent” flag alone cannot guarantee that an external system will not create a duplicate.
Screen-based automation may have no such protection. Verify the result in the application and hand unclear cases to a person. Safe retry requirements also influence the choice between RPA and an integration interface.
Retain the state of every item
A run record needs more than a date and the last error message. For each item, retain the input identifier, last confirmed step, status, attempt count and result reference. State must survive a process restart.
A practical model can distinguish pending, in-progress, confirmed, handed-over and unknown-write-outcome items. These are suggested record states, rather than universal tool status names. A confirmed item is not processed again during recovery. Review an in-progress item according to the point where execution stopped.
Writing to the target application and storing local state may not be one transaction. A crash between them requires reconciling the records with the target system. Concurrent runs must also be prevented from claiming the same item simultaneously. A completed-item list alone does not solve this problem.
What a person needs at handover
“The robot failed” is insufficient to take over the work. The responsible person needs:
- run and item identifiers, time and the last confirmed step,
- an understandable reason for stopping and whether the write outcome is unknown,
- previous attempts and a reference to any related target record,
- the authorised next step and the risk of repeating an operation,
- the case owner and how to confirm manual completion.
Technical records may contain a detailed error or screenshot. Store them with appropriate access and retention. Alerts should exclude passwords, tokens and unnecessary personal data. Review screenshots before sharing and mask sensitive content where needed.
When a worker completes an item manually, update the robot’s records. Otherwise, a later run may consider it incomplete and process it again.
Monitor runs that never started
An absence of error messages does not prove successful operation. A scheduled run may never have started, may be waiting for its environment or may be stuck before completion.
Check expected triggering, actual start, completion and processed-item counts. Alert on an exceeded agreed duration and an unfinished batch too. Power Automate’s run overview distinguishes request time from actual start and run duration from queue waiting. This distinction is useful in custom monitoring as well.
Compare the batch status with item states. A program can finish technically successfully while handing every document to a person. The operational overview needs to show this outcome.
Resuming processing safely
During an incident, first stop unsafe writes and preserve records. Identify affected items and remove the cause. Verify unknown outcomes in the target system before resuming. Mark manually corrected items so they are not executed again.
Resume with a controlled portion of the batch and check its output before releasing the remainder. At the end, reconcile inputs with confirmed results, manual cases and unresolved items. Totals alone are insufficient if a duplicate replaced a missing item. Check identities and result contents too.
Failures to include in testing
Before deployment, prepare invalid input, an unavailable service, a changed form, a lost response after writing and a crash before state is stored. Also check restart, concurrent claiming of the same item and manual completion. Verify resulting data, processing records and alert delivery in each case.
For robots operating websites, web application test automation can help. A technical fix still needs verification of the working outcome. The aim is to know what completed, what remains open and how to continue safely.
If a robot already runs, inspect its most recent failed or interrupted run. Can its state be recovered from the records without guessing? If not, add records and a recovery procedure before expanding the automation. Get in touch to discuss a particular case.