Sections
ϟPULSSIX
Automation / Evergreen guide

How many retries should an automation attempt before giving up?

Use failure probability, bounded retries and backoff to make transient error handling predictable.

PULSSIX Desk /
2 min read (approx.)
How many retries should an automation attempt before giving up?
Original editorial infographic · PULSSIX
In this article
  1. Retrying is a decision, not a reflex
  2. A simple probability model
  3. Count the expected work
  4. Avoid synchronized retries
  5. Test the recovery process
  6. Explore the topic

Retrying is a decision, not a reflex

A network failure before a read request is different from a timeout after submitting an order. In the first case, retrying may be harmless. In the second, the external service might already have accepted the order. Treat errors according to their cause and the side effects of the operation rather than retrying everything identically.

A simple probability model

If every attempt independently fails with probability p, the probability of exhausting n total attempts is p raised to the power n. At a 20% failure probability, three attempts leave a theoretical 0.8% failure probability. The model becomes optimistic when failures share a cause such as a service outage. In that case the next attempt may be no better than the first.

Count the expected work

With up to three attempts and a 20% independent failure probability, the expected attempt count is 1 + 0.2 + 0.04 = 1.24 per job. Ten thousand jobs would generate about 12,400 calls on average. This matters when vendors bill by operation, when work takes time, or when many jobs compete for a limited service quota.

Avoid synchronized retries

An exponential delay with random variation can spread attempted recovery over time. Respect server-provided retry guidance and impose a maximum queue age. When the failure is caused by invalid data or missing permissions, retries typically waste capacity. Route those cases to a visible review queue with actionable details.

Test the recovery process

Simulate a timeout, a throttling response, invalid input and a completed action whose response was lost. Record the attempt count and final state. The goal is not merely to maximise success statistics; it is to preserve correct outcomes while staying inside operational limits. Use the calculator below to explore possible call volumes before testing real failure correlations.

Primary source · AWS Builders Library · Timeouts, retries and backoff with jitter

Explore more: Automation stories · Free tools

Explore the topic

Explore the collection: Automation library