Autosana webhooks in production: duplicates, retries and timeouts

Published · Updated

This guide covers the problems Autosana webhooks can cause in production and how to handle each one. What Autosana sends and how it's signed is on the Autosana webhooks overview, its one event is on Autosana webhook events, and signature verification code is on Verify Autosana webhooks.

Autosana's docs cover setup, the payload and the signature. They give no success code, timeout, retry policy, resend or delivery ID, so most of this guide is about building a receiver that doesn't depend on them.

At a glance

ProblemWhat to doWith Event Gateway
TimeoutsReturn a 2xx straight away; process in a background jobAccepts the delivery at once, then queues it for your service
DuplicatesKey on run_groups[].url, since there's no delivery IDDrops repeats based on the body fields you choose
RetriesSet a deadline for each result and check the Run Status API after itAccepts deliveries while your service is down and retries to it
TestingUse the Test button, and remember it sends from different IPsForwards to localhost and replays past deliveries
Other limitsSet a signing secret, read summary carefully, keep your allowlist currentVerifies signatures and routes on the body

Autosana webhook timeouts and slow handlers

Return a 2xx as soon as you've verified and stored the delivery, then do the work in a background job.

Why it happens: Autosana doesn't state how long it waits for a response or which status codes count as success. With no published limit, you can't tell whether a slow handler is safe, so the only safe assumption is that it isn't.

Fix it in your handler:

  1. Verify the signature, store the body and return a 200 before anything else.
  2. Update the pipeline, open tickets or post to chat in a worker. See why to process webhooks asynchronously.
  3. Keep calls to other services out of the request path.

With Event Gateway: Hookdeck accepts each Autosana delivery immediately, then queues it and delivers it to your service with its own retries. Your handler can take as long as it needs.

Duplicate Autosana webhooks

Autosana doesn't say whether it can send a result twice, and the body has no event or delivery ID. If acting twice would cause harm, key on the run_groups[].url values.

Why it happens: Any sender can repeat a delivery after a network failure, and the documented fields don't include an ID that would identify the repeat. git.commit_sha is no help on its own: it's missing when a build has no git metadata, and one commit can be tested in many batches. The docs also don't say whether timestamp stays the same on a repeat.

Fix it in your handler:

  1. Build a key from the sorted run_groups[].url values. Each URL holds that run group's own ID.
  2. Store the key with a unique constraint, in the same transaction as the side effect.
  3. Make handlers idempotent, so setting a commit status or updating a dashboard twice does no harm.

With Event Gateway: Hookdeck's deduplication can drop repeats based on the body fields you choose.

Autosana webhook retries

Autosana documents no retry policy and no way to resend a delivery, so plan for a result that never arrives.

Why it happens: Autosana sends a result when the batch completes, and nothing in the docs says it's sent again if your endpoint is down. A pipeline waiting on that result can then hang with no signal that anything went wrong.

Fix it in your handler:

  1. Give anything that waits on a result a deadline, and treat a missed deadline as unknown rather than passed.
  2. If you start batches with the API, keep the batch_id that POST /api/v1/flows/run returns. When the deadline passes, read the result from GET /api/v1/runs/status, which Autosana suggests polling every 10 to 15 seconds until is_complete is true. The webhook body has no batch_id, so this only works if you stored it yourself.
  3. For batches started elsewhere, link people to the run page so they can check by hand.

With Event Gateway: Hookdeck accepts the delivery as soon as it arrives and delivers it to your service with retries you configure, so a short outage on your side doesn't lose the result. You can also replay a delivery once your service is back.

Testing and debugging Autosana webhooks

Send a test delivery with the webhook's Test button, then confirm the setup with a real batch.

Why a test can mislead: The Test button sends from Autosana's API, whose IPs aren't on the allowlist that real deliveries come from. If your firewall admits only the runner IPs, tests can be blocked while real deliveries arrive. The docs also don't say whether a test delivery has the same event value or is signed, so a handler that passes a test hasn't necessarily handled a real batch.completed.

Test it like this:

  1. On a firewalled endpoint that admits only the runner IPs, expect the Test button to be blocked. Autosana doesn't publish its API's IPs, so you can't add them.
  2. Run a small suite and check the real delivery, since that's the path production uses.
  3. Keep a fixture from Autosana webhook events, including a variant with no git object, because git appears only when the build has git metadata.

With Event Gateway: The Hookdeck CLI receives webhooks on your machine without a public server, and you can replay past deliveries while you work on the handler.

Other Autosana webhook limits

Before going to production, set a signing secret, decide how you read summary and plan how you'll keep any allowlist current.

Signing is optional. The signing secret is optional when you add a webhook, and without one Autosana sends no signature header, so anyone who finds your URL can post a fake all-passed result. Always set one, and treat a missing header as a failed check. See Verify Autosana webhooks.

summary counts only passed and failed groups. The webhook example has total_groups, passed_groups and failed_groups, while Autosana's Run Status API also lists run group statuses such as error and terminated. The docs don't say how those count in the webhook's summary, so pass a batch only when passed_groups equals total_groups. A check that failed_groups is zero could pass a batch that didn't finish cleanly.

Git metadata isn't always there. git appears only when the build has git metadata, for example when it's uploaded from CI with commit information. Upload builds from CI if you need to tie each result to a commit, and handle its absence in code.

Allowlists go stale. Deliveries come from the flow_runners.virtual_runners.web_browsers IPs for every platform, including mobile. The list is served only by the authenticated GET /api/v1/network/allowlist, and Autosana doesn't notify you when it changes. Poll it from your firewall config, or pull it monthly by hand, as Autosana suggests. If results stop arriving, pull the endpoint and compare it with your rules.

With Event Gateway: Hookdeck verifies the signature on each delivery, as long as the same secret is set on the Autosana webhook and the Hookdeck source. A webhook with no secret sends unsigned deliveries, which fail verification there. Hookdeck can also filter and route on the body, for example sending batches with failures to a separate service. Autosana then delivers to the Hookdeck URL, so your firewall no longer needs its runner IPs. If it needs a fixed source instead, Hookdeck has a static IP add-on.

Keep an endpoint outage from losing an Autosana result.

Autosana documents no retries, so a result sent while your service is down may not come back. Hookdeck Event Gateway accepts each delivery straight away, verifies the signature, then queues it and retries to your service on your schedule.

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