Event Delivery Guarantees
The Webhooks service retries a number of times to deliver the event to the client in the event of failure on the first attempt.
Retry Attempts
- By default, all events that fail to deliver on the first attempt are subjected to retry for 8 times over the span of the next 48 hours in an exponential delayed fashion.
- If the event fails to deliver after all the retry attempts, the backend system records the failure by maintaining a counter against the hook.
- The Webhooks service applies the retry logic to 5 events that arrive for the hook.
- If all 5 events fail to deliver, the hook is inactivated by updating the hook status to
inactive
.
Enhanced Retry With Automatic Hook Reactivation
The Webhooks service has the capability to automatically reactivate the hook after it becomes inactive
. This is controlled by the flag autoReactivateHook
that can be set on the hook.
The hook with autoReactivateHook
flag set is subjected to an automatic hook reactivation lifecycle.
Automatic Hook Reactivation Flag
- The hook with
autoReactivateHook
flag set to true becomes a candidate for automatic hook reactivation lifecycle. By default, the flag is set to false. - The flag can be set when the hook is created using POST API call or updated later using the PATCH API call.
Automatic Hook Reactivation Lifecycle
If the hook has the autoReactivateHook
flag set, then it becomes the candidate for the automatic hook reactivation lifecycle.
- After the hook becomes
inactive
after the normal retry attempts, the Webhooks service runs a background process to pick all the hooks that became inactivate before 7 days from the current date and updates the hook toreactivated
status. - The Webhooks service will accept an event for the hook for a one-time delivery attempt.
- If the event delivery is successful, the hook status is updated to
active
. - If the event delivery fails, the hook status is updated to
inactive
. The backend system records the failure by maintaining a counter against the hook. - The Webhooks service applies the automatic hook reactivation lifecycle logic 5 times before the hook is made permanently
inactive
. This also makes theautoReactivateHook
flag to false on the hook.