Skip to content
E Webhook Package Documentation

Retries And Failures

Retries and failures

Webhook handlers can fail for many reasons. A database may be unavailable, a remote API may time out, or the payload may reference a record that has not been created yet.

RelayKit records each attempt and can retry failed deliveries.

Retry configuration

'retries' => [
    'max_attempts' => 3,
    'backoff' => [60, 300, 900],
],

This retries after one minute, five minutes, and fifteen minutes.

Marking a delivery as failed

Throw an exception from your handler to mark the delivery as failed.

public function handle(WebhookEvent $event): void
{
    if (! $this->customerExists($event->data('customer_id'))) {
        throw new CustomerNotFoundException();
    }
}

Manual retries

RelayKit includes an Artisan command for manual retries.

php artisan relaykit:retry delivery_01HZX4Q9NX

Dead deliveries

A delivery becomes dead when it reaches the maximum number of attempts.

Dead deliveries are not retried automatically. They should be reviewed from your application logs or admin screen.

© Webhook Package Documentation