This prompt is designed for platform teams and infrastructure engineers who need to produce precise, unambiguous documentation of webhook retry behavior. The job-to-be-done is converting internal retry logic—often scattered across config files, queue worker code, and on-call runbooks—into a single, consumer-facing specification that integration engineers can rely on to build resilient receivers. The ideal user is a backend engineer or technical writer who understands the system's actual retry implementation but needs help structuring it into a complete, readable document that covers schedules, backoff strategies, maximum attempts, timeouts, jitter, and failure destinations.
Prompt
Retry Policy Specification Prompt

When to Use This Prompt
Define the job, ideal user, required context, and constraints for the Retry Policy Specification Prompt.
Use this prompt when you have access to the ground truth about your system's retry behavior—whether from source code, configuration, or architecture decisions. The prompt requires several concrete inputs to be effective: the retry schedule (intervals between attempts), the backoff strategy (linear, exponential, or custom), the maximum number of attempts before giving up, any jitter configuration, the total timeout window, and the dead-letter queue or failure destination where events go after retries are exhausted. If you cannot provide these specifics, the prompt will produce vague documentation that fails the primary goal of giving consumers enough detail to implement correct error handling and idempotency on their side.
Do not use this prompt when you are still designing the retry policy rather than documenting an existing one. It is not a design tool—it assumes the policy is already decided and needs to be communicated. Avoid using it for systems where retry behavior varies unpredictably per event type or tenant without a clear specification; in those cases, you need a different approach that documents the variability rules rather than a single policy. After generating the documentation, always validate it against the actual implementation by running integration tests that simulate each retry attempt, timeout, and dead-letter scenario. The output should be reviewed by both the engineering team that owns the delivery pipeline and a sample of API consumers who can confirm the documentation answers their operational questions.
Use Case Fit
Where the Retry Policy Specification Prompt works and where it does not. Use these cards to decide if this prompt fits your current documentation task.
Good Fit: Documenting a New Retry Policy
Use when: you are defining retry behavior for a new webhook endpoint or event type and need a complete specification. Guardrail: provide the exact retry schedule, backoff multiplier, and maximum attempts as input variables to avoid the model inventing plausible but incorrect defaults.
Bad Fit: Runtime Retry Logic Implementation
Avoid when: you need to generate the actual retry code, queue worker configuration, or infrastructure-as-code for your message broker. Guardrail: this prompt produces documentation for humans and integration engineers, not deployable retry logic. Pair it with a code-generation prompt if you need implementation artifacts.
Required Inputs
What to watch: the prompt needs a retry schedule, backoff strategy, maximum attempts, timeout values, and a failure destination. Guardrail: if any of these are missing, the output will contain placeholder gaps. Validate that your source material covers all five dimensions before running the prompt.
Operational Risk: Incomplete Dead-Letter Queue References
What to watch: the model may describe a dead-letter queue without specifying its name, retention period, or inspection interface. Guardrail: add a post-generation validation step that checks for concrete DLQ identifiers, alerting integration, and replay procedures. Flag any output that uses vague language like 'a dead-letter queue' without specifics.
Operational Risk: Jitter Omission
What to watch: retry documentation often omits jitter configuration, leading to thundering herd problems when multiple consumers retry simultaneously. Guardrail: explicitly include a jitter input variable in the prompt template and verify its presence in the output. If jitter is intentionally absent, the documentation must state why.
Operational Risk: Timeout and Retry Interaction Gaps
What to watch: the prompt may document retry intervals without clarifying how they interact with consumer acknowledgment timeouts. Guardrail: cross-reference the retry policy output against your webhook timeout documentation. Ensure the retry schedule accounts for the maximum allowed acknowledgment window to prevent false failure detection.
Copy-Ready Prompt Template
A reusable prompt template for generating a complete webhook retry policy specification from your platform's operational parameters.
This prompt template is designed to produce a comprehensive retry policy document for your webhook system. It takes your specific operational constraints—such as maximum attempts, backoff strategy, and failure destinations—and generates a specification that covers the retry schedule, jitter, timeouts, and dead-letter queue behavior. The output is intended for both internal platform documentation and external consumer-facing guides, ensuring that integration engineers understand exactly how your system handles delivery failures.
codeYou are a technical documentation engineer for a platform team. Your task is to produce a complete, unambiguous specification for a webhook retry policy based on the provided parameters. ## Input Parameters - **Maximum Attempts:** [MAX_ATTEMPTS] - **Initial Retry Delay:** [INITIAL_DELAY] (e.g., 1s, 30s, 5m) - **Backoff Strategy:** [BACKOFF_STRATEGY] (e.g., exponential, linear, fixed) - **Backoff Multiplier:** [BACKOFF_MULTIPLIER] (if applicable) - **Maximum Delay Cap:** [MAX_DELAY_CAP] (e.g., 1h) - **Jitter Strategy:** [JITTER_STRATEGY] (e.g., full, equal, none) - **Request Timeout:** [REQUEST_TIMEOUT] (per delivery attempt) - **Failure Destination:** [FAILURE_DESTINATION] (e.g., dead-letter queue, S3 bucket, log-only) - **Success Criteria:** [SUCCESS_CRITERIA] (e.g., HTTP 2xx, specific status codes) - **Idempotency Key Header:** [IDEMPOTENCY_KEY_HEADER] - **Delivery Ordering Guarantee:** [ORDERING_GUARANTEE] (e.g., best-effort, FIFO per endpoint, none) ## Output Schema Generate a specification document with the following sections. Use the exact headers provided. ### 1. Overview A plain-language summary of the retry policy, its purpose, and when it applies. ### 2. Retry Schedule A detailed description of the retry timeline. Include a table with columns for Attempt Number, Delay Before Attempt, and Cumulative Time. Calculate exact values based on the input parameters. ### 3. Backoff and Jitter Explain the backoff algorithm and jitter strategy in detail. Provide a formula or pseudocode representation of the delay calculation. Explain how jitter is applied to prevent thundering herd problems. ### 4. Timeout and Connection Behavior Specify the per-request timeout, how connection errors vs. read timeouts are handled, and whether a timeout counts as an attempt. ### 5. Failure Destination and Dead-Letter Queue Describe what happens after [MAX_ATTEMPTS] are exhausted. Detail the format of the dead-lettered event, its storage location, retention period, and how consumers can inspect or replay failed events. ### 6. Idempotency and Deduplication Explain how the [IDEMPOTENCY_KEY_HEADER] header is used across retries. Specify the deduplication window and how consumers should handle duplicate deliveries. ### 7. Ordering and Concurrency Describe the [ORDERING_GUARANTEE] during retries. Explain whether retries for one event block subsequent events for the same endpoint. ### 8. Monitoring and Alerting Recommend what metrics and logs consumers should monitor (e.g., retry count spikes, DLQ growth) and what alerts the platform triggers internally. ## Constraints - Use exact numeric values derived from the input parameters. Do not use placeholders in the output. - If a parameter is marked "none" or "N/A", explicitly state that the feature is not supported. - Do not invent features or guarantees not specified in the input parameters. - Write for an audience of integration engineers who need to build against this contract.
To adapt this template, replace each bracketed placeholder with your platform's specific values. For the backoff strategy, ensure you provide enough detail for the model to calculate an exact schedule—for example, if using exponential backoff with a multiplier of 2 and an initial delay of 1 second, the model should produce a table showing 1s, 2s, 4s, 8s, etc. After generating the specification, validate the output by checking that all numeric values in the retry schedule table are mathematically consistent with the input parameters. For high-reliability systems where this documentation becomes a contractual part of your API, have a senior engineer review the generated specification before publication.
Prompt Variables
Required inputs for the Retry Policy Specification Prompt. Each placeholder must be populated before the prompt can generate accurate, testable retry documentation.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[RETRY_STRATEGY] | Defines the retry approach: fixed, exponential backoff, or custom schedule | exponential_backoff | Must be one of: fixed, exponential_backoff, custom_schedule. Reject unknown values before prompt assembly. |
[MAX_ATTEMPTS] | Total delivery attempts including the initial attempt | 5 | Must be an integer >= 1. Values above 20 require explicit justification in the generated docs. |
[INITIAL_DELAY_SECONDS] | Delay before the first retry attempt | 10 | Must be a positive integer. For exponential backoff, this is the base interval. Validate that delay does not exceed consumer timeout. |
[BACKOFF_MULTIPLIER] | Multiplier applied to delay between successive retries for exponential strategies | 2.0 | Required when [RETRY_STRATEGY] is exponential_backoff. Must be > 1.0. Null allowed for fixed or custom strategies. |
[JITTER_PERCENT] | Randomization percentage applied to retry delays to prevent thundering herd | 20 | Must be an integer between 0 and 100. 0 means no jitter. Document jitter absence explicitly when set to 0. |
[TIMEOUT_SECONDS] | Maximum time the provider waits for a consumer HTTP response before treating it as a failure | 30 | Must be a positive integer. Must be less than the total retry window. Validate against [INITIAL_DELAY_SECONDS] to ensure first retry is not guaranteed to time out. |
[DEAD_LETTER_QUEUE_ENABLED] | Whether undeliverable events are routed to a dead-letter queue after exhausting retries | Must be true or false. When true, [DLQ_RETENTION_DAYS] and [DLQ_REPLAY_ENABLED] become required. When false, document that events are dropped after max attempts. | |
[FAILURE_HTTP_STATUS_CODES] | List of HTTP response status codes from the consumer that trigger a retry | 500,502,503,504 | Must be a comma-separated list of valid HTTP status codes. 4xx codes should not appear unless explicitly justified. Validate that 200, 201, and 204 are excluded. |
Implementation Harness Notes
How to wire the retry policy prompt into an application, including validation, logging, and human review gates.
The retry policy specification prompt is designed to be called programmatically as part of a documentation generation pipeline, not as a one-off chat interaction. In a typical implementation, a platform team triggers this prompt when a new webhook event type is registered or when an existing retry policy is modified. The prompt receives structured inputs—such as the event type name, target delivery SLA, and any existing policy fragments—and returns a complete retry policy document section. The output should be treated as a draft that requires human review before publication, because retry policies directly affect consumer reliability expectations and infrastructure load.
To integrate this prompt into an application, wrap it in a function that accepts a RetryPolicyInput schema with fields like event_type, delivery_sla_seconds, max_attempts, backoff_strategy (enum: exponential, linear, constant), jitter_enabled, timeout_per_attempt_ms, and dead_letter_queue_name. Before calling the model, validate that all required fields are present and that numeric values fall within acceptable ranges (e.g., max_attempts between 1 and 50). After receiving the model response, run a structured validation pass: check that the output contains all required sections (retry schedule, backoff strategy, maximum attempts, failure destination, idempotency guidance), that any mentioned timeout values match the input parameters, and that the dead-letter queue reference is not a placeholder. If validation fails, retry the prompt once with a more explicit [CONSTRAINTS] block that lists the missing sections. Log every generation attempt—including input parameters, model version, raw output, validation results, and final published text—so that future policy changes can be audited.
For high-reliability platforms, add a human approval step before the generated retry policy goes live. Route the validated output to a review queue where an engineer confirms that the backoff intervals won't overwhelm downstream consumers, that jitter is correctly specified, and that the dead-letter queue retention period aligns with operational runbooks. Avoid wiring this prompt directly into a CI/CD pipeline without a review gate; a malformed retry policy in production documentation can cause integration partners to implement incorrect retry logic, leading to thundering herd problems or missed deliveries. Pair this prompt with the webhook delivery guarantee documentation prompt and the idempotency key handling prompt to ensure consistency across all consumer-facing reliability documentation.
Expected Output Contract
Validate the structure and content of the generated retry policy documentation against this contract before accepting the output.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
retry_strategy | enum: fixed, exponential, linear, custom | Must match one of the allowed enum values exactly. Reject if missing or unrecognized. | |
max_attempts | integer >= 1 | Must be a positive integer. Reject if 0, negative, or non-integer. Warn if > 20 without explicit justification. | |
initial_delay | ISO 8601 duration string | Must parse as a valid duration (e.g., PT5S, PT1M). Reject if unparseable or zero-duration. | |
backoff_multiplier | float >= 1.0 | Required when retry_strategy is exponential or linear. Reject if missing in those strategies. Must be >= 1.0. | |
max_delay | ISO 8601 duration string | Must parse as a valid duration and be greater than initial_delay. Reject if max_delay < initial_delay. | |
jitter_strategy | enum: none, full, equal, decorrelated | Must match one of the allowed enum values. Reject if missing. If none, add a note that jitter is disabled. | |
timeout_per_attempt | ISO 8601 duration string | Must parse as a valid duration. Reject if timeout > max_delay when max_delay is present. Warn if timeout < initial_delay. | |
dead_letter_queue | object with fields: destination, retention_period | Must contain a non-empty destination string and a valid ISO 8601 retention_period. Reject if DLQ reference is missing or destination is empty. |
Common Failure Modes
Retry policy prompts fail in predictable ways. These cards cover the most common failure modes when generating retry policy documentation and how to guard against them.
Missing Jitter Specification
What to watch: The prompt generates a retry schedule with fixed intervals but omits jitter entirely. This causes thundering herd problems when multiple consumers retry simultaneously after an outage. Guardrail: Add an explicit constraint requiring jitter strategy documentation—random, exponential, or decorrelated—with a concrete range or percentage.
Undefined Maximum Attempts Boundary
What to watch: The output describes retry behavior but never states the hard cap on attempts, leaving consumers guessing whether retries are finite or infinite. Guardrail: Require a dedicated field for max_attempts in the output schema and validate that every retry tier references an explicit termination condition.
Dead-Letter Queue Omission
What to watch: The prompt produces a complete retry schedule but fails to specify what happens after all retries are exhausted—no DLQ destination, no alerting, no manual intervention path. Guardrail: Include a mandatory output section for failure destinations and validate that the generated doc answers 'where do failed deliveries go?'
Timeout and Retry Interval Conflict
What to watch: The generated retry intervals are shorter than the documented acknowledgment timeout, causing retries to fire before the original attempt has a chance to succeed. Guardrail: Add a cross-validation rule that checks retry_interval > ack_timeout and flag violations before publishing the documentation.
Backoff Strategy Ambiguity
What to watch: The output uses vague language like 'exponential backoff' without specifying the base interval, multiplier, or cap, making the policy impossible to implement consistently. Guardrail: Require a structured backoff table or formula in the output—base delay, multiplier, max delay, and jitter factor—and reject prose-only descriptions.
Idempotency Interaction Gap
What to watch: The retry policy is documented in isolation without explaining how idempotency keys interact with retries, leading consumers to mishandle duplicate deliveries. Guardrail: Add a cross-reference requirement that every retry policy document must include an idempotency section explaining replay behavior and deduplication windows.
Evaluation Rubric
Criteria for evaluating the quality and completeness of a generated retry policy specification before it is published or integrated into webhook documentation.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Retry Schedule Completeness | Document specifies exact intervals for all attempts (e.g., 1s, 5s, 15s) up to [MAX_ATTEMPTS]. | Vague language like 'retries a few times' or missing attempt counts. | Parse output for a list of retry delays. Assert length equals [MAX_ATTEMPTS] and all values are positive numbers. |
Backoff Strategy Specification | Backoff type (exponential, linear, fixed) and multiplier are explicitly named with a concrete formula or example. | Only mentions 'exponential backoff' without a base or multiplier. | Regex search for a formula or a concrete numerical example demonstrating the backoff calculation. |
Jitter Configuration | Jitter is explicitly enabled or disabled. If enabled, the strategy (e.g., full, equal, decorrelated) and range are defined. | Jitter is not mentioned at all, leaving behavior ambiguous. | Keyword search for 'jitter'. If found, check for a strategy label and a numeric range or percentage. |
Timeout and Total Lifespan | Per-request timeout and maximum total retry lifespan (e.g., 24 hours) are clearly stated. | Timeout is specified but total lifespan is missing, implying infinite retries. | Extract numeric values for 'timeout' and 'max_lifespan'. Assert both are present and max_lifespan > timeout. |
Failure Destination (DLQ) | Dead-letter queue or final failure destination is named with a link or reference to its documentation. | States 'event is dropped' without specifying storage, logging, or alerting. | Check for a proper noun or URL identifying the DLQ. Assert it is not null. |
Idempotency Interaction | Explains how retries interact with idempotency keys (e.g., 'Retries use the same idempotency key as the original delivery'). | No mention of idempotency, risking duplicate processing on retry. | Keyword search for 'idempotency'. Assert a sentence exists describing key reuse or conflict resolution. |
HTTP Status Code Triggers | Lists specific HTTP status codes (e.g., 500, 502, 503, 504) or network errors that trigger a retry. | Uses a generic phrase like 'server errors' without enumerating codes. | Parse output for a list of HTTP status codes. Assert the list is non-empty and contains valid 5xx codes. |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single retry strategy and minimal validation. Remove dead-letter queue and jitter requirements. Focus on getting a readable policy draft for internal review.
codeGenerate a retry policy for webhook [EVENT_TYPE]. Include: max attempts, initial delay, and backoff multiplier. Format as a markdown table.
Watch for
- Missing timeout values
- No mention of idempotency requirements
- Backoff strategy that could cause thundering herd on recovery

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us