## Question
How should retryable 5xx responses be handled for non-idempotent requests?
## Why this matters
Recurring public developer task for HTTP and integration errors.
## Environment / product
HTTP and integration errors
## What needs to be determined
Current researched guidance, applicability, limitations, and primary sources for this question.
Researched guidance is proposed, not an execution report.
Problem details
- Observed symptom
- How should retryable 5xx responses be handled for non-idempotent requests?
- Context
- Recurring public developer task; researched guidance is proposed, not an execution report.
- Environment
- Unknown · not established
- Symptom signature
- Literal source
- Not supplied
- Expected behavior
- Not supplied
Known approaches
solution · Revision 1
Researched guidance: How should retryable 5xx responses be handled for non-idempotent requests?
## Summary
For a non-idempotent request, a 5xx response does not by itself authorize automatic replay: first make the operation safe to repeat with a server-supported idempotency key or an equivalent conditional/preconditioned design, or establish that the original was never applied. With a supported key, retry the same operation using the same key and parameters; treat a 500 as indeterminate and do not switch to a new key merely because the first attempt returned 500. Apply bounded exponential backoff and honor Retry-After, while keeping retry policy and idempotency safeguards aligned.
## Candidate action
Classify the operation and response before retrying. For POST or other non-idempotent writes without a reliable deduplication key, status query, or proof the original was not applied, do not automatically retry a 5xx; reconcile the outcome through a read/status endpoint or operator workflow. If the API supports idempotency keys, persist one per logical operation, send the same key with identical parameters on every retry, and follow the provider's retention window. Treat 500/502/503/504 as potentially transient only after this safety gate; honor a server Retry-After when present, otherwise use bounded exponential backoff with jitter and a total attempt/time budget. Stop on a permanent error, an explicit no-retry signal, or exhausted budget. Do not layer independent retry loops. A concrete managed-workflow policy illustrates the shape, not a universal HTTP rule: Google Workflows' non-idempotent default retries only 429, 503, and connection failures, with five retries and 1-second initial, 60-second maximum, 1.25 multiplier backoff.
## Applicability
- HTTP clients, SDKs, gateways, and workflow engines issuing POST, PATCH, or other non-idempotent writes where a 5xx or transport failure leaves the server-side outcome uncertain.
- Use only when the API contract documents idempotency keys, conditional preconditions, or a reliable way to check whether the original request was applied.
## Key findings
- RFC 9110 says a client SHOULD NOT automatically retry a non-idempotent method unless it knows the semantics are actually idempotent or can detect that the original request was never applied; a proxy MUST NOT automatically retry it. For 503, Retry-After is advisory and does not override that safety rule. (S1)
- Stripe documents 500 results for POST mutations as indeterminate: retry with the same idempotency key and parameters when the outcome is unknown, avoid a new key because the original may have had side effects, and account for the provider's 24-hour key expiry. (S2)
- Google Cloud Storage classifies 408, 429, and 5xx as transient candidates but says the request must also satisfy idempotency requirements; it recommends preconditions or ETags for conditionally idempotent writes, exponential backoff with jitter, and workload-specific retry limits. (S3)
- Google Workflows provides a product-specific non-idempotent default that retries 429, 503, and connection failures up to five times with 1-second initial, 60-second maximum, 1.25-multiplier backoff; this is an example policy rather than an HTTP-wide rule. (S4)
## Known limitations
- RFC 9110 does not define a general 5xx retry allow-list, exponential-backoff algorithm, jitter rule, or maximum attempt count; provider contracts and client policies supply those details.
- An idempotency key is only effective if the server stores and matches it with the operation parameters for an adequate retention period; key semantics, expiry, and replayed responses are provider-specific.
- A 5xx response can represent an indeterminate outcome even when a provider attempts reconciliation; retries can still produce delayed webhooks or other side effects.
- The Google Workflows and Cloud Storage guidance is product-specific and must not be treated as a universal HTTP policy.
## Evidence boundary
- basis=researched_guidance; executed=false; independent_reproduction=false
- The sources document standards and provider behavior; no live request was sent and no retry policy was independently executed.
## What remains unknown
- For an API not named in the brief, the supported idempotency-key header or precondition, retention window, deduplication scope, replay behavior, and status-reconciliation endpoint remain to be confirmed from that API's contract.
- Whether a particular 502 or 504 means the origin did not apply the write cannot be inferred from the status alone; it depends on the gateway and application path.
- The safe retry budget, jitter distribution, and maximum total duration are workload- and service-specific.
## Evidence
- basis: researched_guidance
- executed: false
- independent reproduction: false
## Sources
- [S1] RFC 9110: HTTP Semantics — https://www.rfc-editor.org/rfc/rfc9110 (standard; accessed 2026-09-22)
- [S2] Advanced error handling — https://docs.stripe.com/error-low-level (official_documentation; accessed 2026-09-22)
- [S3] Retry strategy | Cloud Storage — https://docs.cloud.google.com/storage/docs/retry-strategy (official_documentation; accessed 2026-09-22)
- [S4] Retry steps | Workflows — https://docs.cloud.google.com/workflows/docs/reference/syntax/retrying (official_documentation; accessed 2026-09-22)
- Problem id
- 642dd8ef-92d8-4ace-8451-5baf0c247fb4
- Proposed action
- Classify the operation and response before retrying. For POST or other non-idempotent writes without a reliable deduplication key, status query, or proof the original was not applied, do not automatically retry a 5xx; reconcile the outcome through a read/status endpoint or operator workflow. If the API supports idempotency keys, persist one per logical operation, send the same key with identical parameters on every retry, and follow the provider's retention window. Treat 500/502/503/504 as potentially transient only after this safety gate; honor a server Retry-After when present, otherwise use bounded exponential backoff with jitter and a total attempt/time budget. Stop on a permanent error, an explicit no-retry signal, or exhausted budget. Do not layer independent retry loops. A concrete managed-workflow policy illustrates the shape, not a universal HTTP rule: Google Workflows' non-idempotent default retries only 429, 503, and connection failures, with five retries and 1-second initial, 60-second maximum, 1.25 multiplier backoff.
- Applicability
- State
- partial
- Text
- HTTP clients, SDKs, gateways, and workflow engines issuing POST, PATCH, or other non-idempotent writes where a 5xx or transport failure leaves the server-side outcome uncertain. Use only when the API contract documents idempotency keys, conditional preconditions, or a reliable way to check whether the original request was applied.
- Limitations
- State
- partial
- Text
- RFC 9110 does not define a general 5xx retry allow-list, exponential-backoff algorithm, jitter rule, or maximum attempt count; provider contracts and client policies supply those details. An idempotency key is only effective if the server stores and matches it with the operation parameters for an adequate retention period; key semantics, expiry, and replayed responses are provider-specific. A 5xx response can represent an indeterminate outcome even when a provider attempts reconciliation; retries can still produce delayed webhooks or other side effects. The Google Workflows and Cloud Storage guidance is product-specific and must not be treated as a universal HTTP policy.
- Success criteria
- Not supplied
- Risk notes
- Not supplied
- Lifecycle
- active
- Pack
- Schema version
- 1
- Candidate action
- Classify the operation and response before retrying. For POST or other non-idempotent writes without a reliable deduplication key, status query, or proof the original was not applied, do not automatically retry a 5xx; reconcile the outcome through a read/status endpoint or operator workflow. If the API supports idempotency keys, persist one per logical operation, send the same key with identical parameters on every retry, and follow the provider's retention window. Treat 500/502/503/504 as potentially transient only after this safety gate; honor a server Retry-After when present, otherwise use bounded exponential backoff with jitter and a total attempt/time budget. Stop on a permanent error, an explicit no-retry signal, or exhausted budget. Do not layer independent retry loops. A concrete managed-workflow policy illustrates the shape, not a universal HTTP rule: Google Workflows' non-idempotent default retries only 429, 503, and connection failures, with five retries and 1-second initial, 60-second maximum, 1.25 multiplier backoff.
- Applicability
- HTTP clients, SDKs, gateways, and workflow engines issuing POST, PATCH, or other non-idempotent writes where a 5xx or transport failure leaves the server-side outcome uncertain.
Use only when the API contract documents idempotency keys, conditional preconditions, or a reliable way to check whether the original request was applied. - Limitations
- RFC 9110 does not define a general 5xx retry allow-list, exponential-backoff algorithm, jitter rule, or maximum attempt count; provider contracts and client policies supply those details.
An idempotency key is only effective if the server stores and matches it with the operation parameters for an adequate retention period; key semantics, expiry, and replayed responses are provider-specific.
A 5xx response can represent an indeterminate outcome even when a provider attempts reconciliation; retries can still produce delayed webhooks or other side effects.
The Google Workflows and Cloud Storage guidance is product-specific and must not be treated as a universal HTTP policy. - Evidence boundary
- basis=researched_guidance; executed=false; independent_reproduction=false
The sources document standards and provider behavior; no live request was sent and no retry policy was independently executed. - What remains unknown
- For an API not named in the brief, the supported idempotency-key header or precondition, retention window, deduplication scope, replay behavior, and status-reconciliation endpoint remain to be confirmed from that API's contract.
Whether a particular 502 or 504 means the origin did not apply the write cannot be inferred from the status alone; it depends on the gateway and application path.
The safe retry budget, jitter distribution, and maximum total duration are workload- and service-specific. - Summary
- For a non-idempotent request, a 5xx response does not by itself authorize automatic replay: first make the operation safe to repeat with a server-supported idempotency key or an equivalent conditional/preconditioned design, or establish that the original was never applied. With a supported key, retry the same operation using the same key and parameters; treat a 500 as indeterminate and do not switch to a new key merely because the first attempt returned 500. Apply bounded exponential backoff and honor Retry-After, while keeping retry policy and idempotency safeguards aligned.
- Key findings
- Text
- RFC 9110 says a client SHOULD NOT automatically retry a non-idempotent method unless it knows the semantics are actually idempotent or can detect that the original request was never applied; a proxy MUST NOT automatically retry it. For 503, Retry-After is advisory and does not override that safety rule.
- Source ids
- S1
- Text
- Stripe documents 500 results for POST mutations as indeterminate: retry with the same idempotency key and parameters when the outcome is unknown, avoid a new key because the original may have had side effects, and account for the provider's 24-hour key expiry.
- Source ids
- S2
- Text
- Google Cloud Storage classifies 408, 429, and 5xx as transient candidates but says the request must also satisfy idempotency requirements; it recommends preconditions or ETags for conditionally idempotent writes, exponential backoff with jitter, and workload-specific retry limits.
- Source ids
- S3
- Text
- Google Workflows provides a product-specific non-idempotent default that retries 429, 503, and connection failures up to five times with 1-second initial, 60-second maximum, 1.25-multiplier backoff; this is an example policy rather than an HTTP-wide rule.
- Source ids
- S4
- Research sources
- Id
- S1
- Title
- RFC 9110: HTTP Semantics
- Url
- https://www.rfc-editor.org/rfc/rfc9110
- Source class
- standard
- Accessed at
- 2026-09-22
- Id
- S2
- Title
- Advanced error handling
- Url
- https://docs.stripe.com/error-low-level
- Source class
- official_documentation
- Accessed at
- 2026-09-22
- Id
- S3
- Title
- Retry strategy | Cloud Storage
- Url
- https://docs.cloud.google.com/storage/docs/retry-strategy
- Source class
- official_documentation
- Accessed at
- 2026-09-22
- Id
- S4
- Title
- Retry steps | Workflows
- Url
- https://docs.cloud.google.com/workflows/docs/reference/syntax/retrying
- Source class
- official_documentation
- Accessed at
- 2026-09-22
Page 1 · 1 children total
Sources and related records
No source relations recorded.