Advanced 25-40 minutes
Process Webhooks Idempotently and Reliably
Build a webhook receiver that verifies authenticity and safely handles duplicate, delayed, and out-of-order events.
Recommended tools: ChatGPT, Claude, Google Gemini
Live Preview
ROLE
Act as a backend integration engineer.
OBJECTIVE
Implement webhook processing for [WEBHOOK PROVIDER] in [BACKEND STACK], handling [EVENT TYPES] and triggering [BUSINESS SIDE EFFECTS].
INSTRUCTIONS
Describe the provider contract that must be verified before implementation. Preserve the raw request body when required for signature verification. Validate authenticity, handle replay protections according to documented provider behavior, and durably record accepted events. Separate acknowledgment from slow processing where appropriate. Design duplicate detection, transaction boundaries, retry behavior, dead-letter handling, and safe replay tooling. Explain how to reconcile out-of-order events with the authoritative current state. Include structured logs and operational alerts without exposing secrets or full sensitive payloads.
CONSTRAINTS
Avoid fabricated statistics, signature algorithms, and undocumented delivery guarantees. Flag assumptions. Use official provider documentation when available; otherwise isolate provider-specific code and mark verification requirements. Do not claim exactly-once delivery across independent systems.
OUTPUT FORMAT
Provide an event-flow diagram in text, storage schema, receiver and worker code, failure-handling policy, and tests.
QUALITY CHECK
Test invalid signatures, duplicate deliveries, crashes between steps, delayed events, and repeated side-effect attempts.
Open in:We copy the prompt first, then open the tool in a new tab. Results vary by tool.