# SavvyCal webhooks in production: duplicates, ordering, retries and timeouts

Agent skill: `npx skills add hookdeck/webhook-skills --skill savvycal-webhooks` ([details](https://hookdeck.com/webhooks/savvycal/skill))

This guide covers the problems SavvyCal webhooks cause in production and how to handle each one. What SavvyCal sends and how it's signed is on the [SavvyCal webhooks](/webhooks/savvycal) overview, every event type is on [SavvyCal webhook events](/webhooks/savvycal/events), and signature verification code is on [Verify SavvyCal webhooks](/webhooks/savvycal/verify).

## At a glance

| Problem | What to do | With Event Gateway |
| --- | --- | --- |
| [Timeouts](#timeouts) | Return a 2xx quickly; process in a background job | Accepts the delivery at once, then queues it for your service |
| [Duplicates](#duplicates) | Record the body's `id`; make handlers idempotent on the event's id | Can drop repeats before they reach your handler |
| [Ordering](#ordering) | Read the event's `state`, or fetch the event | Logs every event and attempt, so you can see arrival order when debugging |
| [Retries](#retries) | Stay available; reconcile from `GET /v1/events` after an outage | Accepts deliveries while your service is down and replays them |
| [Choosing events](#choosing-events) | Filter on `type`; check `payload.action.id` on workflow payloads | Filters and routes events by type |
| [Testing](#testing) | Forward to localhost, book a real meeting and read the logs | Forwards to localhost and replays past events |
| [Other limits](#other-limits) | Plan for instant secret rotation, fixed URLs and no replay protection | Verifies the signature and fans one URL out to many services |

## SavvyCal webhook timeouts and slow handlers {#timeouts}

Return a `2xx` as soon as you have the payload, then do the work in a background job.

**Why it happens:** SavvyCal asks for a quick response and recommends queueing the body rather than processing it in the request. It doesn't publish a timeout. Its webhook logs show **Err** when it couldn't connect, for example because the request timed out, and that attempt is retried.

**Fix it in your handler:**

1. Verify the signature, store the raw body and return `200`.
2. Process it in a worker. See [why to process webhooks asynchronously](/webhooks/guides/why-implement-asynchronous-processing-webhooks).
3. Keep calls to your CRM, billing system and other services out of the request path.

**With Event Gateway:** Hookdeck accepts each SavvyCal delivery immediately, then queues it and delivers to your service at a rate it can handle. A slow handler doesn't use up SavvyCal's attempts.

## Duplicate SavvyCal webhooks {#duplicates}

The same change can reach you more than once, so record each body's `id` and make your handlers idempotent.

**Why it happens:** SavvyCal retries up to 20 times, so a handler that did the work and then failed to respond in time gets the payload again. Separately, a webhook belongs to a person, and it gets every event on teams and organizations that person owns or administers. Two admins with their own webhooks each get the same booking. The docs don't say whether the body's `id` (`payload_...`) stays the same across retries, and the `x-savvycal-webhook-id` header identifies the webhook, not the delivery.

**Fix it in your handler:**

1. Save each body's `id` under a unique constraint and skip any you've seen. See [how to implement webhook idempotency](/webhooks/guides/implement-webhook-idempotency).
2. Don't rely on that alone. Key side effects on the event's own id (`payload.id`, or `payload.event.id` on wrapped types) and what you're doing, such as "confirmation sent".
3. If several webhooks share a receiver, use `x-savvycal-webhook-id` to tell them apart and to pick the right secret.

**With Event Gateway:** Hookdeck's deduplication can drop repeated deliveries with the same `id` before they reach your service, and you choose the fields it compares.

## Out-of-order SavvyCal webhooks {#ordering}

SavvyCal doesn't document delivery order, so decide from the event's state rather than from which delivery came first.

**Why it happens:** Nothing in the docs rules out a retried delivery arriving after a newer one, and retries wait longer each time. Order matters most for paid bookings, which move from `event.checkout.pending` to `event.checkout.completed` or `event.checkout.expired`.

**Fix it in your handler:**

1. Read the event's `state` (such as `confirmed`, `awaiting_checkout` or `checkout_expired`) and `payment.state` (`awaiting_checkout` or `paid`) to decide what a booking is now.
2. Compare the body's `occurred_at` with the last one you applied to that event, and ignore older updates.
3. When it matters, fetch the current event with `GET /v1/events/{event_id}`.

**With Event Gateway:** Hookdeck logs every event and delivery attempt, so you can see the order things arrived in while you debug. It doesn't put events back in order, so your handler still needs these checks.

## SavvyCal webhook retries {#retries}

SavvyCal retries for up to 20 attempts and then stops, so a long outage can lose payloads for good.

**Why it happens:** A non-`2xx` response or a failed connection is retried with exponential backoff, up to 20 attempts in all. SavvyCal doesn't publish the schedule or how long it lasts. There's no button to resend a payload after the last attempt fails. SavvyCal follows up to 3 redirects.

**Fix it in your handler:**

1. Stay available, and return a non-`2xx` only when you want a retry.
2. Check **View logs** in the webhook's menu after an incident. It lists every attempt with its status code and event type, and you can open an attempt to see the payload and your response.
3. Reconcile bookings with `GET /v1/events`. Poll responses have no equivalent: the REST API has no polls endpoint, so recover those from the logs.

**With Event Gateway:** Hookdeck accepts deliveries while your service is down, retries to your service on a schedule you set, and lets you replay anything that failed, so SavvyCal's attempts aren't what you depend on.

## Choosing SavvyCal events {#choosing-events}

You can't choose event types on a webhook, so filter on `type` in your handler and check it before you read `payload`.

**Why it happens:** Creating a webhook takes only a URL, and SavvyCal documents no way to subscribe to some events and not others. The payload's shape also depends on the type: most send the event object directly, and others wrap it. Some types overlap too. `event.created` is documented as firing when an organizer grants approval, and so is `event.approved`.

**Fix it in your handler:**

1. Return `200` for types you don't use, rather than an error that triggers retries.
2. Switch on `type` before reading `payload`. `event.changed` sends `event` and `previous_attributes`, `event.attendee.added` and `event.attendee.canceled` send `event` and `attendee`, `event.attendee.rescheduled` sends `original_event`, `original_attendee`, `new_event` and `new_attendee`, `poll.response.*` sends the poll response, and `workflow.action.triggered` sends `workflow`, `rule`, `action` and `event`.
3. If you use approvals, act on one of `event.created` and `event.approved`, or make the work idempotent on the event's id.
4. On `workflow.action.triggered`, check `payload.action.id`. Every webhook on the account gets a payload each time a **Send a webhook** or **Trigger a zap** action runs, including zaps that have nothing to do with your code.
5. On `event.changed`, use `previous_attributes` to see what changed, but don't assume it's filled in. It holds `start_at` and `end_at` for a reschedule, `state` for a state change and the buffers for a buffer change, and it's empty for changes such as an attendee joining or a new location.

**With Event Gateway:** Hookdeck filters and routes events by `type`, so each one can go to the service that handles it, and a transformation can reshape a payload before it arrives.

## Testing SavvyCal webhooks {#testing}

Point a webhook at your machine, book a real meeting on your own link and read the result in SavvyCal's logs.

**Why it's awkward:** SavvyCal's docs describe no button for sending a test event, and webhooks start receiving payloads as soon as they're created.

**How to test:**

1. Forward deliveries to your machine with `hookdeck listen`, and use the URL it prints when you create the webhook.
2. Book, reschedule and cancel a meeting on one of your own scheduling links. For paid and approval flows, use a link set up that way.
3. To test a workflow action straight away, set it to run **After event scheduled** with a delay of 0 minutes, attach the workflow to a link and book a meeting. Change the timing back afterwards.
4. Open **View logs** to compare what SavvyCal sent with how your endpoint answered.

**With Event Gateway:** The CLI forwards events to localhost, and you can replay past events to your handler while you work on it, so you don't have to book another meeting.

## Other SavvyCal limits {#other-limits}

Three other things catch people out in production: secret rotation, fixed URLs and the lack of replay protection.

**Why it happens:** Regenerating a secret takes effect at once and can't be undone. Every request from then on is signed with the new secret, including retries of payloads that already failed, so there's no overlap. A webhook's URL can't be edited: you add a new webhook and delete the old one, and the new one has a new secret. The signature covers only the body, so a captured request still verifies if it's sent again, and SavvyCal publishes no source IP list. Zapier's connection is also a webhook in your list, and deleting it stops your zaps.

**Fix it in your handler:**

1. Plan rotation as a quick switch. During the swap, accept the old and new secrets for the same webhook, so that retries and new deliveries both pass.
2. To move to a new URL, create the new webhook first, deploy its secret, then delete the old one. It's deleted right away with no confirmation.
3. Use an `https://` URL. SavvyCal accepts `http://` but doesn't recommend it.
4. Treat the record of processed `id` values as your replay protection. If you add a freshness check on `occurred_at`, keep the window generous, because retries arrive later and SavvyCal doesn't say how late.

**With Event Gateway:** Hookdeck verifies the signature, gives SavvyCal one stable URL however your services change, and fans events out to as many destinations as you need.

## Conclusion

SavvyCal gives you 20 attempts, no published timeout and no way to resend, so return quickly, make handlers idempotent and reconcile after an outage. Check `type` before you read `payload`, and decide from the event's state rather than arrival order.

[Hookdeck Event Gateway](https://hookdeck.com) sits in front of your receiver, verifies every SavvyCal signature and holds each event until your service has processed it.

[Get started with Hookdeck](https://dashboard.hookdeck.com/signup) for free and handle SavvyCal webhooks reliably in minutes.