Idempotent Webhook Handler & Background Queue Processor
Implement production-grade third-party webhook receivers with cryptographic verification and background processing.
Implement secure webhook ingest endpoints (e.g. Stripe, GitHub, Shopify) that verify signatures, return immediate 200 OK responses, and queue work for background workers.
Execution Workflow Procedure
Ordered steps the coding agent executes when performing this skill.
Verify Webhook Cryptographic Signatures
Validate HMAC signatures using raw request bodies and timing-safe comparison before parsing JSON.
Fast Acknowledgment & Enqueueing
Store incoming event payloads in an idempotent queue and immediately return HTTP 200 OK to prevent provider timeouts.
Idempotent Background Worker Processing
Process events in background workers, checking idempotency keys inside database transactions.
Agent Safety Guardrails & Anti-Hallucination Rules
- DO NOT execute slow database transactions or email dispatch inside the synchronous webhook HTTP handler.
- DO NOT use parsed JSON bodies for HMAC signature validation; always verify against raw request buffers.
Expected Output Format
Secure ingress route and idempotent background worker.
Domain Verification Checks
Example Agent Invocations
Install / Configure This Skill
# Place in .cursorrules or create .cursor/rules/idempotent-webhook-queue-processor.mdc # Trigger: Whenever you perform idempotent webhook handler & background queue processor --- name: idempotent-webhook-queue-processor description: Implement secure, idempotent third-party webhook receivers with signature verification and background queue workers. version: 1.0.0 compatibility: [Cursor, Claude Code, Cline, Roo Code, Antigravity] --- # Idempotent Webhook Handler & Background Queue Processor ## Objective Safely ingest third-party webhooks with cryptographic HMAC signature verification and decoupled background worker processing. ## Workflow 1. **Signature Verification**: Validate HMAC signatures on raw request buffers using timing-safe comparisons. 2. **Immediate Acknowledgment**: Return HTTP 200 OK immediately and enqueue the event. 3. **Idempotent Worker**: Process events in background jobs checking for duplicate event IDs in database transactions.
Need a quick one-time prompt for chat?
Try the Pull Request Severity-Graded Code Review — a lightweight version designed for 1-click copying directly into Claude, ChatGPT, or Cursor chat.
SprintKit Workflow Integrations
Complementary tools and checklists to pair with this agent workflow.
Related Agent Skills
Explore related procedural workflows in this discipline.
Application Security & OWASP Top 10 Audit
Audit backend and frontend code for injection, authentication flaws, IDOR, SSRF, and sensitive data leakage.
Event-Driven Architecture & Message Ordering Hardening
Review Kafka, RabbitMQ, or SQS/SNS event architectures for exactly-once semantics, out-of-order delivery, and DLQs.
Jira User Story to Vertical-Slice Implementation Loop
Transform Jira user stories and acceptance criteria into vertically sliced, test-backed code implementations.