A webhook endpoint can return a successful response while the work behind it never happens. The request reached your application, but a queue write failed, a worker rejected a changed field, or a duplicate delivery repeated a business action.
For a small team, the useful question is not simply, “Did the webhook succeed?” It is, “What evidence shows how far this event travelled?”
This checklist separates transport, durable acceptance and business processing. That makes investigations narrower and recovery decisions safer.
Separate received, durably accepted and processed
Give these states different meanings in your application and logs:
- Received: the HTTP handler saw the request. This proves neither authenticity nor persistence.
- Durably accepted: the request passed validation, and enough information to recover the work was committed to durable storage or a durable queue.
- Processed: the intended business change committed, or the handler deliberately recorded a valid no-op.
A success response should normally follow durable acceptance, not merely entry into the handler. Keep expensive processing outside the request path where practical.
The tradeoff is additional queue or database machinery. However, acknowledging an event while its only copy lives in process memory creates a loss window during crashes and deployments.
GitHub’s guidance on handling webhook deliveries provides a concrete provider-specific reference for receiving events and responding promptly. Treat it as GitHub guidance, not a universal contract for other providers.
Validate authenticity before trusting the payload
Check the provider’s current signing specification. Where signatures cover the raw request body, retain those exact bytes before JSON parsing or middleware transformations. Re-serializing an equivalent JSON object can produce different bytes and invalidate verification.
Follow the provider’s documented algorithm, secret handling and comparison method. If its scheme includes signed timestamps, apply its documented freshness checks. Do not add a home-grown timestamp rule to a scheme that does not provide one.
GitHub’s webhook signature validation documentation explains its signing approach. Other providers can use different headers and signed inputs.
A common mistake is temporarily disabling verification to clear delivery failures. Instead, inspect body handling and secret configuration without logging secrets. Keep payload access restricted and retention deliberate: webhook bodies may contain sensitive information.
Deduplicate deliveries without discarding unfinished work
Record a provider-scoped delivery identifier with a uniqueness constraint. Check the provider’s identifier semantics, including whether retries or manual redeliveries reuse it. Do not assume every identifier represents a unique business change.
Avoid a separate “have we seen this?” lookup followed by an unprotected insert. Concurrent requests can both pass that check. Use an atomic claim backed by storage constraints.
Also distinguish seen from completed. If a worker crashes after claiming an event, a duplicate must not cause unfinished work to disappear permanently. Track processing state and provide a recovery path for abandoned claims.
Delivery deduplication does not make external side effects exactly once. If processing calls another API, use its supported idempotency mechanism or reconcile uncertain outcomes before repeating the action. For local database changes, commit the business update and completion marker together where possible.
Expect events to arrive out of order
Arrival order is not business order. An older update can arrive after a newer update, especially around retries or parallel delivery.
Choose an ordering strategy based on what the provider actually exposes:
- Compare documented resource versions or sequence numbers when available.
- Fetch current source state when events are notifications rather than authoritative snapshots.
- Serialize work per resource when concurrent local changes would conflict.
Serialization prevents simultaneous processing; it does not repair events that already arrived in the wrong order. Timestamps also need care: they may describe different moments or lack sufficient precision.
Write the business invariant explicitly. For example: “An older account event must not restore access that a newer source state removed.” That is a stronger test than checking whether the handler returned success.
Bound retries and quarantine failures
Separate temporary failures from failures that need intervention. A connection interruption may justify another attempt. An unsupported event shape will probably fail again unchanged.
Use bounded attempts, backoff and jitter for appropriate failures. Set a maximum retry age as well as an attempt limit. Otherwise, stale work can remain active long after its business context changes.
After the limit, quarantine the event with its identifier, failure category and enough context to investigate safely. Assign an owner and define how replay works. A failure queue without review is merely another place to lose work.
Distinguish provider delivery attempts from your worker retries. Do not assume the provider retries every rejected request; verify its documented behaviour and redelivery options.
Fictional walkthrough: delivery succeeded, access stayed unchanged
This scenario is fictional. A small SaaS application receives account-change webhooks from a billing provider. The endpoint reports success, but a customer’s local access remains active after the source account becomes inactive.
The engineer finds a received log entry and a durable inbox record. The problem is therefore beyond initial delivery. The worker’s failure record shows that a changed status value is unsupported. Replaying the event immediately would only repeat the error.
The engineer checks the provider’s current account state, then traces the status field through the access-policy consumer. The team defines the intended mapping and tests both the new value and the existing values before replaying the quarantined event.
During recovery, an older account event arrives. The consumer checks current source state rather than blindly restoring the older payload’s access setting. A reconciliation pass then compares affected source accounts with local access records.
The investigation ends with evidence of the corrected business state—not merely another successful webhook response.
A reusable webhook troubleshooting checklist
Use this during an incident or before changing a handler:
- Locate: Can you correlate the provider delivery, durable record, worker attempt and business resource?
- Authenticate: Did verification use the exact provider-defined inputs before trusting the body?
- Accept: Was recoverable work persisted before acknowledgement?
- Deduplicate: Is delivery claiming atomic, scoped correctly and distinct from completion?
- Recover: Can abandoned processing resume without silently skipping work?
- Order: Can a stale event overwrite newer state?
- Retry: Are temporary failures retried within explicit limits?
- Quarantine: Are persistent failures visible, owned and safely replayable?
- Reconcile: Does the local business state match the source after recovery?
Record state transitions and failure categories without routinely copying full payloads into logs. Enough correlation is useful; unrestricted sensitive data is not.
Know the limits, then choose one next step
This checklist cannot prove every event was delivered or every consumer was found. Reconciliation needs an authoritative source, suitable permissions and a comparison method that accounts for pagination and concurrent changes. Some historical transitions cannot be reconstructed from current state alone.
For broader investigation context, see the related DOAAS engineering guidance.
Start with one webhook type: trace its path from receipt to a committed business outcome, then test a worker failure after acceptance. Document how that unfinished event becomes visible and recoverable.
GhostImpact helps understand API changes, map producer-to-consumer dependencies and investigate potential downstream impact. It does not establish complete coverage or automatically fix handlers. For API change and dependency investigation, Explore GhostImpact.