Tray.io webhooks
Tray.io webhooks are the HTTP requests a Tray.ai workflow sends to your endpoint through the HTTP Client connector, in whatever shape the workflow builds.
These pages cover requests a Tray workflow sends to your endpoint. To send data into Tray and start a workflow, see Tray's Webhook Trigger docs. Log streaming, which sends workflow logs to an endpoint, is a separate feature and isn't covered here.
How Tray.io webhooks work
A workflow calls your endpoint as soon as it has data, so your app doesn't have to poll for it. The step waits up to 15 minutes for your response. From version 5.0, any status outside 2xx fails the step unless you list other expected codes, and before 5.0 any returned status counts as success.
Tray defines no event types, envelope or version for these requests. The workflow's builder chooses the method, headers and body, which can be raw, form-data, form-urlencoded or binary. To route requests, put an event name and a stable id in the body yourself.
Key facts
Setting up Tray.io webhooks
- In a workflow, add an HTTP Client step with the operation you want, usually POST, and set its URL.
- Choose the raw body type and add a
Content-Type: application/jsonheader. With no body type selected, Tray sendsapplication/x-www-form-urlencoded. - Tray's cloud can't reach localhost, so test through a public HTTPS URL.
hookdeck listen 3000 tray-iogives you one and forwards requests to your machine, then a manual trigger runs the workflow. - Resend with a replay from the workflow's logs, which starts a new run. Logs and replay last 7 or 30 days depending on your package.
Delivery behaviour
up to 15 minutes the step's wait for a response; its optional Timeout input can't go higher Retries 3, 40 seconds apart for a service connector's API error on Stop workflow; Tray doesn't say whether this covers the HTTP Client After a failure set on the step Stop workflow is the default; Manual adds a failure path and Continue moves on, and neither retries an API error Ordering not documented loops handle items one by one, but batches sent to callable workflows run in parallel Known failure modes
From Hookdeck's Tray.io guide →-
Your outage fails the workflow
From version 5.0, a status outside
Retries and failed steps →2xxfails the HTTP Client step, and what happens next depends on its error handling. Choose Manual or Continue deliberately if a run shouldn't stop when your endpoint is down. -
Errors that never show up
Before version 5.0, Tray treats any returned status as success, including
Make failures visible →403and504. On those versions, check the status with a Boolean condition step. -
The same request arrives twice
Tray can retry a failed step, and a replay from the logs runs the workflow again. Put a stable
Handle duplicates →idin the body and deduplicate on it. -
Requests with nothing to route on
Tray adds no event name, so nothing tells your endpoint which workflow sent a request unless the body says so. Add an
Name your events →eventfield to every body.
Tray.io webhook best practices
- Name the event in every body.
Tray adds no event field. Send
eventand a stableid, and keep the shape the same across workflows so one receiver can handle them all. - Set the body type and Content-Type.
Use a raw body with an explicit
Content-Type: application/json. Left unset, the request goes out asapplication/x-www-form-urlencoded. - Return a 2xx quickly. A slow response holds up the workflow for up to 15 minutes. Store the request, respond, and do the work afterwards.
- Deduplicate on your own id.
A retry or a replay sends the request again. Take
idfrom the record the workflow is handling, then skip ids you've processed. - Decide how failures should behave.
Pick the step's error handling on purpose, then test what the workflow does when your endpoint returns a
500. - Keep the secret in a Tray authentication.
Map the header's value from
$.auth. Tray obscures it in the logs, and a value typed into the step isn't protected that way.
In this hub
| MCP events → | How an agent subscribes to Tray.io events as MCP events. |
| Verify signatures → | Signature facts, verification code and common failures. |
| Production guide → | Production problems, such as timeouts and retries, and how to handle them. |
| Agent skill → | Install the webhook skill in your coding agent. npx skills add hookdeck/webhook-skills --skill tray-io-webhooks |
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.