Skip to content

Automation reliability

Error handling in automation: what happens when a workflow fails?

A workflow is not reliable because the happy path works. Reliability is retries, duplicate prevention, exception queues, escalation and replay — the failure architecture most automation projects design last.

John M Granskou11 min read
Success path and failure pathRunSuccessDoneRetryReview queue
Error handling in automation: what happens when a workflow fails?

Automation demos always work. The form is submitted, the record appears, the notification arrives, everyone agrees it is impressive. What the demo never shows is the morning the payment provider is slow, the credentials expired overnight, and four hundred events arrived twice.

Every automation eventually encounters an exception

Not because it was built badly, but because it depends on systems it does not control. Networks are unreliable, third-party services have incidents, credentials expire, and people enter data nobody anticipated.

Treating exceptions as surprises leads to a system that works for six weeks and then requires an emergency. Treating them as expected leads to a system that degrades visibly and recovers on its own.

The happy path is only part of the workflow

Most workflow diagrams show a single line from trigger to outcome. The real workflow branches at every step where something external is involved, and those branches are where reliability is decided.

The right-hand branch is the part that is usually specified last, and the part that determines whether anyone trusts the system.

Common automation failures

FailureWhat happenedRight response
Service unavailableThe other system is down or unreachableRetry with increasing gaps; alert if it persists
Invalid dataA required field is missing or malformedStop; hold for correction — retrying changes nothing
Authentication expiredA token or key is no longer validStop and alert immediately; every run will fail
Rate limit reachedToo many requests in the allowed periodWait and retry more slowly; reduce request volume
Duplicate eventThe same event was delivered more than onceDetect by identifier and discard the repeat
TimeoutNo response within the allowed windowRetry, but verify whether the action already succeeded
Partial successTwo of three steps completedResume from the failed step, or reverse the completed ones
Downstream rejectionThe receiving system refused the recordHold with the rejection reason for review
Each failure mode has a different correct response. Treating them identically is why some workflows retry forever and others give up immediately.

The timeout row deserves emphasis. A timeout means you do not know the outcome — the action may have succeeded. Retrying without checking is how duplicate invoices are created.

Retry or fail: classifying the error

The most useful distinction in error handling is transient versus permanent. A transient failure means the request was reasonable and the moment was wrong; a permanent failure means the request itself is wrong and will be wrong on every attempt.

Classification comes first. Retrying a permanent failure wastes capacity and delays the human fix by exactly the length of the retry schedule.

Retries should be spaced rather than immediate. Trying again a second later during an outage adds load to a system that is already struggling; waiting progressively longer — a few seconds, then a minute, then several — gives it room to recover. This spacing is usually called backoff.

Every retry policy needs a hard limit. Without one, a workflow can spend days retrying an operation that will never succeed, and the failure never reaches anyone.

Idempotency and duplicate prevention

Idempotency sounds technical and describes something simple: running the same operation twice leaves the system in the same state as running it once. Charging a card is not naturally idempotent. Setting a status to 'complete' is.

The standard technique is to give every event a stable identifier, record which identifiers have already been processed, and check that record before acting. A repeat delivery is acknowledged and discarded rather than executed.

Without this check, every retry mechanism you add becomes a duplicate-generation mechanism.

Dead-letter queues and failed-work queues

When a workflow cannot complete after its retries, the work has to go somewhere. A dead-letter queue — plainer language: a failed-work queue — holds the original event, the error and the context, so nothing is lost while the cause is investigated.

The queue must be visible to people, not just to logs. Its depth and the age of its oldest item are two of the most useful reliability metrics a business can watch, because both translate directly into work that has not happened.

Human escalation

Some failures need judgement rather than a fix: a record that does not match anything, a customer whose situation falls outside the rules, a conflict between two systems that both claim to be correct.

The escalation path should be defined in the same way an approval path is — a named role, a deadline and a recorded outcome. The design patterns are covered in human approval gates in automation.

Logging and observability

Every run should record what triggered it, what it did, how long it took, and how it ended. Logs need to be searchable by the business identifier — an order number, a customer reference — because that is how questions actually arrive.

  • Run history — the outcome of every execution, retained long enough to investigate.
  • Correlation by identifier — one order traced across every workflow that touched it.
  • Failure rate over time — the trend matters more than any individual failure.
  • Queue depth and age — how much work is waiting, and for how long.
  • Duration — a workflow that has become slow is usually a workflow about to time out.

Alerts people actually act on

Alerting fails in one of two directions. Too little, and problems are discovered by customers. Too much, and the alerts become noise that everyone filters into a folder.

EventAlert or report?Reason
Single retried timeoutReportThe system handled it; no action is available
Authentication failureAlertEvery subsequent run will fail until someone acts
Failure rate risingAlertIndicates a developing problem, not a one-off
Item in queue over 24 hoursAlertWork has silently stopped happening
Workflow processed nothing todayAlertSilence usually means broken, not quiet
Daily volume and success rateReportUseful context, not an interruption
Alert on things requiring action. Report everything else where it can be reviewed without interrupting anyone.

Recovery and replay

Fixing the cause is only half of recovery; the backlog still has to be processed. If the original events were stored and the workflow is idempotent, replay is a routine operation — reprocess the queue and confirm the counts reconcile.

If either property is missing, recovery becomes manual reconstruction from whatever evidence remains. That is the real cost of skipping idempotency: not the duplicates, but the inability to safely reprocess anything.

Design the failure path before launch

The failure path is cheapest to build at the same time as the workflow, when the data shapes and edge cases are already in front of you. Retrofitting it means reconstructing that understanding months later, usually under pressure.

An automation reliability checklist

  1. Every event carries a stable identifier, and repeats are detected before any action.
  2. Failures are classified as transient or permanent, with different routing for each.
  3. Retries use increasing gaps and a hard maximum attempt count.
  4. Failed work lands in a visible queue with its payload and error preserved.
  5. Alerts are limited to conditions a person must act on, routed to a named owner.
  6. Queue depth and oldest-item age are reported like any other operational metric.
  7. Recovery is a documented replay, not an improvised reconstruction.
  8. Credential expiry dates are tracked before they cause an outage.

None of this makes automation infallible. It makes failure visible, bounded and recoverable — which is the difference between a system a business can rely on and one it merely hopes about.


We design the failure path alongside the workflow rather than after it, because reliability is the property that determines whether automation is trusted enough to be used. It is part of every automation and business systems engagement.

Frequently asked questions

What happens when an automated workflow fails?

That depends entirely on what was designed. A well-built workflow classifies the failure, retries if it is transient, holds the record if it is not, alerts an owner and preserves enough context to reprocess later. A workflow without a failure path simply stops, usually silently.

Should automations retry automatically?

For transient failures — timeouts, rate limits, brief outages — yes, with increasing gaps between attempts and a firm limit. For permanent failures such as invalid data or expired credentials, retrying repeats the same error and delays the human fix.

How do you prevent duplicate actions?

Give every event a stable identifier, record which identifiers have been processed, and check before acting. That property is called idempotency, and it is why a retried workflow does not send a second invoice.

What is an exception queue?

A holding area for work that could not be completed automatically, storing the original data and the error so it can be inspected, corrected and reprocessed. It is also called a dead-letter queue or a failed-work queue.

When should a failed automation alert a person?

When a person needs to do something. A single retried timeout does not warrant an alert; an authentication failure, a rising failure rate or a customer-visible action stuck in a queue does.

Can failed workflows be replayed?

If the original event was stored and the workflow is idempotent, yes — reprocessing the queue after the cause is fixed is routine. Without those two properties, recovery becomes manual reconstruction.

How do you monitor automation reliability?

Track success and failure counts per workflow, queue depth and age, time to recovery, and duplicate rate. A workflow that has processed nothing unexpectedly is as significant a signal as one that is failing.