Tray.io webhooks in production: duplicates, ordering, retries and timeouts
This guide covers the problems you meet when a Tray.io (now Tray.ai) workflow calls your endpoint with the HTTP Client connector, and how to handle each one. It doesn't cover Tray's Webhook Trigger, which receives data into a workflow.
What Tray sends is on the Tray.io webhooks overview, and how to check the secret header is on Verify Tray.io webhooks.
At a glance
| Problem | What to do | With Event Gateway |
|---|---|---|
| Timeouts | Respond well inside the step's 15-minute limit; process in a background job | Answers the step at once, then queues the request for your service |
| Duplicates | Put a stable id in the body and skip ids you've processed | Drops repeats before they reach your handler |
| Ordering | Don't rely on arrival order; compare a source timestamp or fetch current state | Logs every request, so you can see arrival order when debugging |
| Retries | Choose the step's error handling and test it against a 500 | Accepts requests while your service is down and retries on your schedule |
| Choosing events | Name the event in every body and set the Content-Type | Filters and routes on the fields you send |
| Testing | Use a public HTTPS URL that forwards to localhost | Forwards to localhost and replays past requests |
| Other limits | Keep the secret in a Tray authentication, keep responses small and pace loops | Compares the secret header and smooths out bursts |
Tray HTTP Client timeouts and slow handlers
Respond well inside the step's limit, then do the work in a background job. Tray's limits page says the HTTP Client waits up to 15 minutes for a response.
Why it happens: The step waits for your response before the workflow moves on, so a slow handler holds up the run. The step's optional Timeout input is in milliseconds, covers the connection, the read and the full response, and goes up to 900000. Without it, the request waits until the platform stops the execution. Tray doesn't document how a timed-out request is retried.
Fix it in your handler:
- Check the secret header, store the request and return
200. See why to process webhooks asynchronously. - Do the work in a worker, outside the request.
- Set a Timeout that fits how quickly your endpoint really responds, so a stuck request doesn't hold the run for the full 15 minutes.
With Event Gateway: Hookdeck answers the step as soon as a request arrives, then queues it and delivers it to your service at a rate it can handle. Your handler can take as long as it needs without holding up the workflow.
Duplicate Tray requests
Your endpoint can receive the same request more than once. Put a stable id in the body, taken from the record the workflow is handling, and skip ids you've processed.
Why it happens: A step on the default error handling can be retried after your endpoint has already done the work, and Tray's limits page lists connector backend errors and internal Tray errors as retried whatever the setting. Replaying a run starts a new run, which calls your endpoint again. Tray adds no delivery id, so your endpoint has nothing to compare unless the body carries one.
Fix it in your handler:
- Map an identifier from an earlier step into
idin the body. - Track processed ids in a table with a unique constraint.
- Make every handler idempotent.
With Event Gateway: Hookdeck deduplicates requests before they reach your endpoint, using the fields you choose.
Out-of-order Tray requests
Don't assume requests arrive in the order things happened. Tray doesn't document a delivery order for the HTTP Client, so include a timestamp in the body or fetch the record's current state from its source.
Why it happens: A Loop Collection handles items one by one, but batches sent to callable workflows run in parallel, and a retried or replayed request arrives after newer ones.
Fix it in your handler:
- Include a timestamp from the source record in the body, and ignore anything older than what you've stored.
- Or fetch current state from the source system when the request arrives.
With Event Gateway: Hookdeck logs every request and attempt, so you can see arrival order when debugging. For more on the general problem, see Webhook Ordering: Why It's Hard and How to Handle It.
Tray retries and failed steps
What a failed request does depends on the version and on the step's error handling. Decide what you want to happen, then test it against a 500.
Why it happens: From version 5.0, the step fails on any status outside 2xx unless you list other expected codes in Status codes. Before version 5.0, any returned status counts as success, including a 403 or a 504, so Tray raises no error at all.
A failed step then follows its error handling. The default, Stop workflow, retries by error type. Manual adds a success path and a failure path, and Continue moves on to the next step. Neither of those retries an API error, and a step inside a loop can also break the loop or skip to the next item.
Tray's limits page gives 3 retries, 40 seconds apart, when a service connector's API returns an error and the step is on Stop workflow. It doesn't say whether that covers the HTTP Client, which Tray files as a core connector, or which statuses count.
Fix it in your workflow and handler:
- Use Manual error handling where a failure shouldn't stop the run, and send failures down a path that alerts someone or stores the payload.
- On versions before 5.0, check the returned status with a Boolean condition step.
- Set up an alerting workflow, so a failed run reaches someone.
- Replay failed runs from the logs before they expire: 7 days on Pro and Team, 30 days on Enterprise or as a Team add-on. After that, Tray warns the data may be gone.
With Event Gateway: Hookdeck accepts each request as soon as it arrives and stores it, then delivers it to your service with retries on a schedule you control. An outage on your side doesn't become a failed step in the workflow, and you can replay any request after a fix.
Choosing events: Tray has no event list
Tray has no event catalogue for these requests, because every request is built in a workflow. Your events are whatever your workflows report, so name them yourself.
Why it happens: The person building the workflow chooses the method, headers and body, usually by mapping values from earlier steps with jsonpaths. Tray adds no event name, envelope or workflow identifier, so several workflows calling one endpoint can send different shapes.
Fix it in your workflow:
Agree on a body format with whoever builds the workflows, and keep it the same across them:
{ "event": "record.created", "source": "crm-sync", "occurred_at": "2026-10-22T09:15:00Z", "id": "rec_123", "data": { "name": "Acme" } }The values come from your workflow, and these field and event names are only an example.
Use the raw body type and add a
Content-Type: application/jsonheader. The step's body types are raw, form-data, form-urlencoded, binary and none, so there's no JSON option to pick. Tray sets the Content-Type from the body, and it'sapplication/x-www-form-urlencodedif none is selected, which a JSON receiver rejects. A header you set yourself overrides it.Validate the body on arrival and return
400for anything that doesn't match, so the error shows up in Tray on version 5.0 and later.Use one method per endpoint. Choose
POSTunless you have a reason not to.
With Event Gateway: Hookdeck stores every request with its full body, so you can see what each workflow sends. Filters route on any field or header, and transformations can normalise different shapes into one.
Testing Tray requests locally
Point the step at a public HTTPS URL that forwards to your machine, then run the workflow with a manual trigger and read its logs.
Why it happens: Tray's cloud can't reach localhost, and Reject unauthorised is on by default, so a self-signed certificate fails too.
How to test it:
- Run
hookdeck listen 3000 tray-ioand use the URL it prints as the step's URL. - Run the workflow with a manual trigger, then check the logs for the status and body your endpoint returned.
- To send the same data again, replay the run from its log.
With Event Gateway: The Hookdeck CLI forwards requests to localhost, and you can replay past requests without running the workflow again.
Other Tray limits
A static header isn't a signature. Tray adds no signature or timestamp, so the same value goes out on every request and anyone who learns it can send requests that look like yours. Use a long random secret over HTTPS, and deduplicate on id so a replayed request has no further effect. Treat requests as signals, and confirm anything consequential against the system of record.
Keep the secret in a Tray authentication. Tray says not to hard code authentication values in the properties panel, because reading them from $.auth is what obscures them in the logs. A Generic Service Authentication in an organization workspace is accessible to everyone in the organization.
Loops can send bursts. An HTTP Client step inside a loop sends one request per item. Tray's docs cover batching and queueing for destinations that can't keep up.
Keep your response small. Tray has a 1 MB page limit, and a larger response body may return an error. A short 200 is all the step needs.
Don't redirect the step. Redirects aren't followed by default, so give the step your final URL, or turn on Follow redirect.
Tray publishes its public IPs. If your endpoint sits behind a firewall, allow the addresses for your Tray region. They're available on Pro, Team and Enterprise.
With Event Gateway: Create a source with the Tray.io type, then enter the header you added as API Key Header and the exact value as API Key, including any Bearer prefix. The source type pre-selects POST. If your step uses GET, PUT, PATCH or DELETE, allow that method on the source too. Hookdeck can set a max delivery rate for your destination, so a burst from a loop reaches your service at a pace it can handle.
Hookdeck answers the step itself, before your service sees the request, so the step succeeds while your service is down. A request with the wrong header is recorded as failed verification and creates no event. Watch Hookdeck rather than Tray's logs for those: issues alert you when deliveries to your service fail, and every request is listed with its headers and body, including those that failed verification.
Get started with Hookdeck for free and receive Tray.io workflow requests reliably in minutes.
Keep an outage on your side from failing a Tray workflow.
Event Gateway checks the header you set on each request from the step, queues it and retries to your service on your schedule, so your downtime doesn't become a failed step in the workflow.