communication
webhook_reliability
ai_generated
true
GitHub webhook delivers same event multiple times because endpoint is slow or returns non-2xx
ID: communication/github-webhook-delivery-timeout-retry
85%Fix Rate
88%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
GitHub webhooks timeout after 10 seconds and retry failed deliveries. There's no configurable retry policy. Slow endpoints receive duplicate deliveries. The X-GitHub-Delivery header is unique per delivery attempt, not per event.
genericWorkarounds
-
95% success Return 200 immediately and process webhook asynchronously
Enqueue the raw webhook payload for background processing. Return 200 within 1 second.
-
90% success Use event ID from payload (not delivery header) for idempotency
Dedup key: f'{event_type}:{payload["action"]}:{payload["id"]}' # unique per logical event -
82% success Check webhook delivery logs in GitHub repo settings for debugging
Settings -> Webhooks -> Recent Deliveries shows each attempt with request/response details
Dead Ends
Common approaches that don't work:
-
Process webhook synchronously and return 200 after completion
88% fail
If processing takes >10s, GitHub considers the delivery failed and retries. You get duplicate processing of the same event.
-
Use X-GitHub-Delivery header as idempotency key
82% fail
X-GitHub-Delivery is unique per delivery ATTEMPT, not per event. Retries have different delivery IDs. Use the event payload's action+id for dedup.