Autumn webhooks in production: duplicates, ordering, retries and timeouts

Published · Updated

This guide covers the problems Autumn webhooks cause in production and how to handle each one. What Autumn sends is on the Autumn webhooks overview, every event is on Autumn webhook events, and signature verification code is on Verify Autumn webhooks.

At a glance

ProblemWhat to doWith Event Gateway
TimeoutsStore the event, return a 2xx quickly and process in a background jobAccepts the delivery at once, then queues it for your service
DuplicatesRecord each svix-id; use invoice.stripe_id for top-upsDrops repeats before they reach your handler
OrderingDon't assume an order; fetch the customer when your data must matchLogs every event and attempt, so you can see arrival order when debugging
RetriesCheck the dashboard after an outage and reconcile from the APIAccepts deliveries while your service is down and replays them
Choosing eventsSubscribe to what you handle; give vercel.* its own webhookFilters and routes each event type from a single source
TestingUse a sandbox webhook, an https URL and Send Test EventForwards to localhost and replays past events
Other limitsLoop over plan_changes, store the secret, and protect your endpoints from a syncKeeps each payload so you can replay it against a changed handler

Autumn webhook timeouts and slow handlers

Return a 2xx quickly and do the work in a background job. Autumn publishes no response timeout. Svix, which delivers its webhooks, documents 30 seconds to return a 2xx, and Autumn doesn't say whether it changes that.

Why it happens: Autumn's webhooks exist to trigger side effects such as activation emails, provisioning and CRM updates, and each of those calls another service. A handler that waits for them all can run past the limit, and Svix treats anything other than a 2xx, including a redirect, as a failed delivery.

Fix it in your handler:

  1. Verify the signature, store the raw event and return 200.
  2. Do the slow work in a worker. See why to process webhooks asynchronously.
  3. Point the endpoint at its final URL, because a redirect counts as a failure.

With Event Gateway: Hookdeck accepts each Autumn delivery immediately, then queues events and delivers them to your service at a rate it can handle, with its own retries. Your handler can take as long as it needs without failing an Autumn delivery.

Duplicate Autumn webhooks

A retried message keeps its svix-id, so record each id you process and skip repeats. Autumn's own pages don't discuss duplicates; the id's behaviour comes from Svix's documentation.

Why it happens: A delivery that times out or gets a non-2xx response is sent again, even if your handler had already done the work. Retrying a failed delivery from the Autumn dashboard has the same effect.

Fix it in your handler:

  1. Track processed svix-id values, using a database table with a unique constraint. See our guide to webhook idempotency.
  2. For billing.auto_topup_succeeded, use invoice.stripe_id, which Autumn suggests as a stable key. The top-level id identifies the event.
  3. Make plan handlers safe to run twice. Storing a subscription snapshot is, while sending a welcome email isn't.

Autumn does suppress one kind of repeat itself. While the same purchase, attempt or failed-attempt limit is active, repeated auto top-up attempts don't send another billing.auto_topup_failed, so don't expect one per attempt.

With Event Gateway: Hookdeck deduplicates events before they reach your endpoint, so repeats are filtered at the infrastructure level rather than in each handler.

Out-of-order Autumn webhooks

Autumn doesn't document delivery order, so don't assume events arrive in the order things happened. When your database must match Autumn, fetch the customer from its API.

Why it happens: A delivery that fails and is retried can arrive after a newer one. billing.updated has no event timestamp to compare, because only the auto top-up events carry occurred_at. Autumn suggests storing each subscription snapshot, and a late event would overwrite a newer snapshot with an older one.

Fix it in your handler:

  1. Treat each event as a snapshot of one moment, not a command to replay.
  2. Before overwriting stored plan state, call Get Customer and store what it returns.
  3. Don't rely on the order of entries inside plan_changes. Autumn doesn't state one, so read each entry's action.

With Event Gateway: Hookdeck logs every event and delivery attempt, so when state looks wrong you can see the order events actually arrived in and replay them.

Autumn webhook retries

Autumn retries with exponential backoff when your endpoint returns an error or is unavailable, and you can view attempts and retry failed deliveries from the dashboard. It doesn't publish how long it keeps trying or what happens afterwards.

Why it happens: Autumn leaves the schedule to Svix without restating it. Svix's documentation gives 8 attempts over about 27 hours, and disabling an endpoint after 5 days of failures, but Autumn doesn't say whether it keeps those settings.

Fix it in your handler:

  1. After an outage, check the delivery attempts in the Autumn dashboard and retry what failed.
  2. Reconcile plan state from Get Customer and invoices from invoices.list, in case a delivery ran out of attempts.
  3. Check that the endpoint is still on. A webhook has a disabled field that stops all its events, and webhooks.get returns it.

With Event Gateway: Hookdeck accepts Autumn's deliveries while your services are down, so they succeed and nothing is left to retry on Autumn's side. Failed events can be retried automatically, manually or in bulk once you recover.

Choosing which Autumn events to receive

Subscribe each webhook to the events you handle, return a 2xx for any type you don't recognise, and give vercel.* events a webhook of their own.

Why it happens: Leaving out events sends every event, and a webhook can't mix vercel.* events with others. Autumn also lists customer.products.updated and customer.threshold_reached as subscribable without describing them on its current pages. Its older docs show their own shapes: customer.products.updated has data.scenario, data.customer and data.updated_product, with no plan_changes. Autumn's changelog shows it firing alongside billing.updated on trial expiry, so a webhook on every event can hear about one change twice.

Fix it in your handler:

  1. Start with billing.updated, balances.limit_reached, balances.usage_alert_triggered, billing.auto_topup_failed and invoice.finalized.
  2. Pick billing.updated or customer.products.updated for plan changes, not both, and don't reuse a plan_changes loop for the second one.
  3. For Vercel Marketplace, create a separate endpoint under Developer > Vercel, as Autumn's setup guide describes.
  4. Use the names in the events list. Autumn's changelog spells two with an extra dot, billing.auto_topup.failed and balances.usage_alert.triggered, but its API and example bodies use underscores.

With Event Gateway: Hookdeck filters on type can route each event type to its own destination from a single source.

Testing Autumn webhooks

Test against a sandbox webhook and use Send Test Event in the dashboard to confirm your endpoint receives deliveries.

Why it's awkward: The URL must be https, and Autumn rejects localhost and private-network addresses, so a handler on your machine needs a tunnel. Most events depend on a customer's billing activity, and Autumn doesn't document a way to trigger a specific type.

What to do:

  1. Create a webhook with a sandbox key. It's separate from production and has its own secret.
  2. Point it at a tunnel, as Autumn suggests, or at a temporary URL from Hookdeck Inspect, which has an Autumn page.
  3. Attach, change and cancel a plan on a sandbox customer to produce billing.updated.
  4. Keep fixtures of the examples on Autumn webhook events, including an upgrade with two plan_changes.

With Event Gateway: The Hookdeck CLI receives webhooks on your machine without a public server, and you can replay past events. A replayed message keeps its original svix-timestamp, so the Svix libraries reject it more than five minutes later; Verify Autumn webhooks explains the options.

Other Autumn webhook limits

Plan for how Autumn shapes plan changes, how it returns secrets and how it manages endpoints as code before they reach production.

Several plan changes in one event. One billing.updated can carry several plan_changes. An upgrade from free to pro is an activated entry and an expired entry in the same event, and a single event can cover several entities, so read each entry's entity_id. Loop over every entry rather than reading the first.

Detecting cancellations. previous_attributes.canceled_at being null means a cancellation was just set, and a number means it was undone. previous_attributes is itself null on a new plan, and the field is missing when it didn't change, so check for a real null: a loose check reads a missing field as a cancellation.

The secret comes back once. The API returns a webhook's whsec_ secret when it creates the webhook, and webhooks.get never returns it. Store it in a secrets manager straight away. If it's lost, create a new webhook, deploy its secret, then retire the old one. Autumn's docs don't say where the dashboard shows the secret for an endpoint added there.

Syncs can delete endpoints. webhooks.sync with skip_deletions: false deletes every webhook you didn't list, including ones made in the dashboard, and atmn push deletes endpoints removed from your config. webhooks.preview_sync shows what would change.

A succeeded top-up may not be paid. In invoice_mode, billing.auto_topup_succeeded fires once credits are granted and the invoice is finalized, and invoice.status is typically open until the customer pays. Check the status before you record revenue.

One action can send several events. Autumn's changelog says a transfer sends billing.updated for both the source and the destination, and license transitions send one for each seat entity.

Vercel access tokens. vercel.resources.provisioned carries an access_token that can patch a resource's secrets. Keep it out of your logs and treat stored copies of that body as secrets.

With Event Gateway: Hookdeck keeps each payload, so you can replay real billing.updated events against your handler when you change how it reads plan_changes. Only the Hookdeck source needs the Autumn secret, so replacing it is one change in one place.

Keep an outage from losing an Autumn cancellation.

Hookdeck Event Gateway accepts every Autumn delivery, verifies its signature, stores each event and delivers it at a rate your service can handle, with replay for anything that fails.

Not affiliated with Autumn. Facts are compiled from public sources and linked inline.