Hightouch webhooks in production: duplicates, ordering, retries and timeouts
This guide covers the problems the Hightouch HTTP Request destination causes in production and how to handle each one. It's about the requests a sync sends to your endpoint. How those requests work, and why Hightouch has no event list, is on the Hightouch webhooks overview, and checking the secret header is on Verify Hightouch webhooks.
At a glance
| Problem | What to do | With Event Gateway |
|---|---|---|
| Timeouts | Return a 2xx quickly; process in a background job | Accepts each request at once, then queues it for your service |
| Duplicates | Deduplicate on the row's primary key, not the sync run ID | Drops repeats you define before they reach your handler |
| Ordering | Send current state and ignore anything older | Logs every request and attempt, so you can see arrival order |
| Retries | Return a 2xx for rows you skip; alert on rejected rows | Accepts requests so rows stop failing, then retries on your schedule |
| Choosing events | Give each trigger its own method, path or key | Filters and routes by path, headers or body |
| Testing | Preview templates; read the live debugger | Forwards requests to localhost |
| Other limits | Set rate limits; handle batches row by row | Delivers at a rate you set, whatever speed the run sends at |
Hightouch webhook timeouts and slow handlers
Return a 2xx quickly and do the work in a background job, because Hightouch treats a timeout as an error and sends the row again.
Why it happens: You set the timeout in the sync's error handling step. Hightouch's tutorial allows 30 seconds, and its docs don't state a default. Each request also holds one of the run's concurrent slots, 100 by default, so a slow handler slows the whole run.
Fix it in your handler:
- Check the secret header, store the request and return
200. - Do the work from a queue. See why to process webhooks asynchronously.
- If a downstream call has to happen in the request, set the sync's timeout to match it and lower its concurrency.
With Event Gateway: Hookdeck accepts each Hightouch request immediately, then queues it and delivers it at a rate your service can handle. Your handler can take as long as it needs without failing a row in Hightouch.
Duplicate Hightouch webhooks
The same row can reach you more than once. Deduplicate on the model's primary key and something that changes with the row, and leave the sync run ID out of the key.
Why it happens: A request that times out after your handler did the work is retried. A full resync processes every row as added, and Hightouch warns that it can repeat events for webhook destinations. context.sync_run_id identifies the run making the request, so a retry on a later run has a different value and a key built on it won't match.
Fix it in your handler:
- Put the model's primary key in every payload. Hightouch's change detection already depends on that key being unique.
- Build a key from the primary key, the trigger, and a column that changes with the row, such as an
updated_atcolumn in your model. - Make writes idempotent where you can, so an upsert on the primary key gives the same result however many times it runs.
- Before a full resync, check that every handler can take each row again. If you only need a new baseline, Hightouch's reset CDC sends nothing.
With Event Gateway: Hookdeck can deduplicate on the fields you choose before requests reach your endpoint, so repeats are filtered in one place rather than in each handler.
Out-of-order Hightouch webhooks
Hightouch documents no ordering guarantee, so don't assume requests arrive in the order rows changed.
Why it happens: A run makes up to 100 concurrent requests by default, so requests overlap. A row that fails comes back on a later run, after requests for other rows have already succeeded.
Fix it in your handler:
- Send the row's current state in the payload rather than a description of the change.
- Include a column that orders changes to a row, such as
updated_at, and ignore anything older than what you've stored. - If one sync has to finish before another starts, run them in a sequence.
With Event Gateway: Hookdeck logs every request and delivery attempt, so when state looks wrong you can see the order requests actually arrived in and replay them.
Hightouch webhook retries and rows that never succeed
Hightouch keeps retrying a failed row until it succeeds or leaves the model's query results, so a row you'll never accept needs a 2xx or a fix in the model.
Why it happens: Timeouts and any 4xx or 5xx response count as errors. On the destination you choose to retry immediately, with a number of attempts you set, or to wait for the next run. Either way, rows that still fail are retried on every later run with no attempt limit. Hightouch's general retry page adds that in-run retries use exponential backoff and that a 400, 401, 403 or 422 is rejected at once instead of being retried in that run. The row still returns on the next one. A wrong secret on your endpoint therefore rejects rows until you fix it, and they're retried on later runs.
Fix it in your handler:
- Return
200and log rows you deliberately skip, rather than a4xx. Better still, filter them out of the model. - Keep
4xxfor requests you want Hightouch to send again once something is fixed. - Turn on the Rejected rows alert. A run with rejected rows shows as Completed with errors, not Failed, so run status alone can hide them.
- Choose retrying on the next run for downstream outages, so a run isn't spent on a service that's down.
With Event Gateway: Hookdeck accepts the request and stores it, so Hightouch records success, and failures between Hookdeck and your service become retries you control and can stop. Issues alert you, and you can replay requests after a fix.
Telling Hightouch triggers apart
Hightouch has no event list and writes no trigger name into the request, so you decide how your handler tells an added row from a changed or removed one.
Why it happens: Rows added, rows changed and rows removed are each configured separately, with their own method, endpoint and payload. The request carries only what you configured. You can put {{context.model_id}}, {{context.model_name}}, {{context.sync_id}} and {{context.sync_run_id}} in a template, but they aren't added otherwise.
Fix it in your handler:
- Enable only the triggers you handle. A valid sync needs at least one.
- Give each trigger a distinct method or path, or put an explicit key in each template, as in the example below.
- Accept every method your triggers use. A route that only allows
POSTreturns an error for the others, and Hightouch retries those rows. - Treat the format as an API contract, and change it the way you'd change an API, because every receiver depends on it.
{
"action": "row_added",
"id": "{{row.id}}",
"email": "{{row.email}}"
}
The action key is your own convention, and Hightouch doesn't add it.
With Event Gateway: Hookdeck filters can route requests by path, headers or a body field, so rows added and rows removed can go to different destinations. Check that the source allows every method your triggers use. GET has to be enabled on the source.
Testing Hightouch webhooks
Preview the template first, then read what each run actually sent in the live debugger.
Why it's awkward: Hightouch can't reach localhost, and a real run acts on real model rows.
How to test:
- Use the payload editor's Preview tab, which renders the template with a sample row and shows errors inline.
- Use a small test model and the Skip existing rows initial sync setting, so a first run doesn't backfill everything.
- Set the schedule to Manual while you work, so runs only happen when you trigger them.
- Read the live debugger for the exact requests and responses from a run.
With Event Gateway: hookdeck listen 3000 hightouch --path /webhooks/hightouch gives you a public URL that forwards to your machine. Use it as the destination's base URL.
Other Hightouch webhook limits
Plan for bursts, batches, a static credential and the limits on what this destination is for.
- Bursts: Hightouch defaults to 1000 requests per second or 100 concurrent requests, whichever comes first, and a backfill can send every row in the model. Lower the limits on the sync, or skip existing rows. Limits aren't shared between syncs, so two syncs to one endpoint add up. A limit set in requests per hour also makes Hightouch wait out the full hour before the next run. Hookdeck delivers to your service at a max delivery rate you set, so the run finishes quickly and your service isn't overloaded.
- Batches: With batching on, the default batch size is 100. A column-based payload is a JSON array, and a JSON editor template gets
rowsinstead ofrowand can build any wrapper. Process each row independently, and decide what one bad row should do to the rest, since your response code answers for the whole request. - A secret header is all you get: A static header doesn't cover the body and carries no timestamp. Use a long random value marked Secret, send it over HTTPS only, and make handlers idempotent so a replayed request does no harm. Hightouch also lists its IP addresses per region if you want to allowlist them as well. Hookdeck sources can check an API key in a header you name.
- Native destinations: Hightouch prohibits using this destination to replicate what a native destination already does, so it's for your own services and APIs without one.
Keep a bad deploy from leaving Hightouch rows stuck in retries.
Event Gateway accepts each sync run's requests, queues them, delivers them at a rate you set and retries failures on your schedule.