Webhook Dedupe and Replay-Protection Receiver Design Prompt
Design a hardened inbound webhook receiver that verifies signatures, rejects replayed or stale deliveries, and deduplicates at-least-once redeliveries so automated downstream actions fire exactly once per real event.
- Target user
- Platform engineers building event-driven webhook ingestion
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior automation engineer who has debugged a webhook receiver that triggered the same remediation eleven times because the sender retried on a slow 200. I will provide: - The webhook source(s), their signing scheme, and retry behavior (timeout, max attempts, ordering guarantees) - The delivery payload, headers, and any delivery/event IDs available - The downstream automated action each event triggers and its blast radius - Our storage options for dedupe state (Redis, DynamoDB, Postgres) and traffic volume Your job: 1. **Authenticity** — specify signature verification (HMAC/timestamped), the exact header order and raw-body handling, and constant-time comparison to block forged payloads. 2. **Replay window** — define a timestamp tolerance and reject deliveries outside it, explaining the clock-skew trade-off and how stale replays are logged. 3. **Dedupe key and store** — derive a stable idempotency key from the event (delivery ID or content hash), pick a store with atomic set-if-absent, and set a TTL longer than the sender's max retry span. 4. **Ack vs. process** — separate fast acknowledgement (return 200 quickly) from the actual work via a queue, so the sender stops retrying while processing happens asynchronously and at-most-once. 5. **Out-of-order and missing events** — describe handling for reordered deliveries and a reconciliation/poll fallback for events that never arrive. 6. **Failure and DLQ** — define what happens when processing fails after ack, including a dead-letter path and a safe replay procedure that re-checks the dedupe store. 7. **Observability** — list metrics for duplicates dropped, replays rejected, signature failures, and queue depth so silent dedupe storms are visible. Output as: a request-handling sequence diagram in prose, a dedupe-key spec, a store schema with TTL, and a metrics/alert list. Call out every downstream action that is not naturally idempotent and require it to be gated behind the dedupe check plus a documented manual reversal for any action that did double-fire.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Webhook-to-Action Event Automation Design Prompt
Design an event-driven automation that turns an inbound webhook into a safe, bounded action — covering authentication, idempotency, allow-listing of which events may trigger which actions, and a read-only default so a spoofed or replayed event can never cause harm.
-
GitOps Secret Rotation Automation Design Prompt
Design an automated secret rotation flow that fits a GitOps model, keeping plaintext out of Git while rotating credentials, resyncing consumers, and rolling back cleanly if a rotated secret breaks a workload.
-
ChatOps RBAC Command Authorization Design Prompt
Design role-based authorization for a ChatOps bot so every chat-triggered command checks who issued it, in which channel, against an explicit policy — before it touches infrastructure.
-
Idempotency Receipt Store Design Prompt
Design an idempotency receipt store that records the result of each first-time request keyed by an idempotency key, so retries return the original outcome instead of re-executing the side effect.
More Automation prompts & error guides
Browse every Automation prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.