Skip to main content

Webhook

Starts the automation when an outside system sends an HTTP request to a URL that belongs to this trigger. Reach for it when the system you want to react to can call out to you but has no integration of its own: a form service, a monitoring tool, a script, or a device that can do nothing more than request a fixed address.

Setting one up is usually a job for the developer or administrator who controls the sending system, since they have to tell it to call the URL. The main path is short: add the trigger and save, choose how the sender proves who it is, hand the sender the URL and credential shown on the trigger, then click Fire Test to confirm the wiring. The rest of this page is the detail behind each of those steps.

Fields​

FieldDescription
NameWhat the trigger is called on the canvas. Once the trigger has been saved, everything the sending system needs is shown beneath this field: the Webhook URL and, depending on the scheme, the signing secret or token.
AuthenticationHow the sending system proves it is who it says it is. Signature is the default; see Authentication.
Example RequestA read-only, copy-and-paste shell example for this trigger, written for the selected scheme.
RespondWhen the sender gets its answer: Immediately, the default, or From a Webhook Response Step, which holds the request open for a Webhook Response step in the run. See Answering the sender.
Response Timeout (Seconds)How long a request waits for a Webhook Response step: 30 by default, 55 at most. Shown when Respond is From a Webhook Response Step.
Fire ConditionA rule checked against the trigger's output the moment a request arrives. When it is false, no run starts, nothing is counted, and the sender is told so under result.skipReason. See Triggers.

The URL is rebuilt from the trigger on every save, so it survives the server being moved. The first credential is generated the first time the trigger is saved and kept stable afterwards, so the copy held by the sending system stays valid.

Authentication​

Pick the scheme by what the sending system can do.

SchemeThe sender needsWhat it sendsReplay protection
SignatureTo compute an HMAC-SHA256A signature over the request; the secret itself never travelsBuilt in: a signed timestamp and a unique delivery id
Bearer TokenTo set a request headerThe token, in an Authorization: Bearer headerOptional: a header the sender fills with a value unique to each delivery
URL SecretOnly to call a URLThe secret, as the final segment of the webhook URLOptional: the same per-delivery header, if the sender can set one

The sender signs each request following the Standard Webhooks convention: a webhook-id header with a unique id for the delivery, a webhook-timestamp header with the time in seconds, and a webhook-signature header carrying v1, followed by the base64 HMAC-SHA256 of id.timestamp.body. The signing secret is shown as whsec_…, which the Standard Webhooks client libraries accept as is. A request whose timestamp is more than five minutes off is refused, and a delivery id that has already been accepted is recorded but not run again.

The older signature form

A secret generated before the standard form was available still accepts the older form: an X-Automation-Signature-256: sha256=<hex> header carrying the HMAC-SHA256 of the body alone, keyed by the secret's text. Such a secret is shown as it was, and its example request uses the older form. A whsec_… secret is verified only under the standard headers; a request signing it the older way is refused, since a body-only signature could be sent again.

Answering the sender​

With Respond set to Immediately, every request is answered as soon as it is accepted, with 200 and the id of the run it started:

1
{"status": "ok", "result": {"execId": "…"}}

A request that started no run is answered with the reason instead, under result.skipReason.

With From a Webhook Response Step, the request waits for a Webhook Response step to answer it, and gets whatever that step sends. A request no step answers still gets an answer:

What happenedStatusBody
A Webhook Response step answeredThe step'sThe step's
The run finished without reaching a Webhook Response step200The run's id, as an immediate answer carries it
The run failed or was stopped first500The run's id, under "status": "error"
No step answered within Response Timeout (Seconds)202The run's id. The run carries on.

A request refused before any run starts, such as one with a bad credential, is answered at once whatever Respond is set to. The editor won't let you publish a Webhook Response step after a trigger set to Immediately, since it could never answer; a trigger set to wait with no Webhook Response step after it shows a warning in the validation indicator but still runs.

tip

Most load balancers drop a request that is silent for a minute, which is why the timeout stops at 55 seconds. Put work that can take longer, such as an approval or a long AI step, after the Webhook Response step, so the sender has its answer while the run carries on.

Requests that are refused outright

A request whose body is larger than 1 MB is refused with 413 without any of it being kept, and is not recorded. A request to a URL that names no trigger gets 410, a malformed path 400, and a missing or wrong credential 401.

Deliveries​

Every request the trigger receives is recorded on its Deliveries screen, from the node's actions menu once the trigger has been saved: the ones that started a run, the ones a fire condition held back, the ones that were refused, and the ones that arrived while the automation was off. Its Status column shows the status each sender was sent, and a delivery's detail shows the response itself under Response.

The same menu offers Fire Test, which sends a test delivery presented the way the selected scheme expects, so you can confirm the wiring end to end. It always runs as a dry run, so a test body never reaches a real system, even on a published automation.

warning

Replay on a delivery re-sends it and starts a real run, even when the automation is turned off, and even if the trigger is set to record deliveries without running them. On a published automation each delivery offers Replay, in green, which runs live, and Replay as Dry Run, in amber, which runs it as a dry run with no real effects. A draft or revision offers Replay as Dry Run alone. This is not the Replay on a finished run's view, which only animates history.

What is kept, and what a replay sends

The trigger keeps its 100 most recent deliveries and, apart from them, its 25 most recent refused requests, so a stream of refused requests never pushes real deliveries out. A delivery's detail shows the same headers later steps see under _trigger.headers, and a replay delivers them again; a signature header shows only its scheme and first characters, and a replay signs the body afresh with the trigger's current credential. A delivery whose body was too large to keep can't be replayed.

Besides a run that was skipped because the automation was off or archived, the screen records two outcomes particular to this trigger: DUPLICATE_DELIVERY, for a live delivery whose id or deduplication value the trigger had already accepted, and refusals such as STALE_TIMESTAMP, MISSING_CREDENTIAL and INVALID_CREDENTIAL, which name what was wrong with the request.

Credentials and rotation​

The Credentials action in the node's menu lists the credentials the trigger accepts, at most two, with what to hand the sender for each, when it was created, and when a delivery last verified against it. Credential values are shown to anyone who can run the automation, since whoever holds a credential can start it from outside. A Viewer sees that each credential exists and when it was used, with the value masked.

To rotate a credential:

  1. Click Generate New Credential. Both credentials now verify, so nothing breaks.
  2. Move the sending systems to the new credential, at your own pace.
  3. When the old credential's Last used shows that nothing still presents it, click Revoke beside it.

Last used is read from the trigger's retained deliveries, so it can tell you a credential was used recently but not that it was never used.

warning

If a credential has leaked and it is the only one, click Regenerate. The leaked credential is refused from that moment and a replacement is created in the same step, so the trigger is never left without one. Then move the sender to the new credential.

What later steps see​

The trigger's output is whatever the sender sent, so its shape isn't known until a request arrives. Build the flow against the shape you expect, click Fire Test or have the sender send a real request, then read the data back from the run and adjust. A reference into the payload can't be checked against a schema, so the editor leaves such references unverified rather than marking them broken.

Everything the trigger adds about the request goes inside its own _trigger object, so a body field of any name is left exactly as the sender wrote it:

PathWhat it holds
_trigger.bodyA body with no fields to read, such as XML, plain text or a JSON list, whole as text. Absent when the body had fields or was empty. Parse it in a mapping with the Convert transform's Parse XML or Parse JSON.
_trigger.headersThe request's headers, each name in lower case, so _trigger.headers.content-type reads the Content-Type whatever casing the sender used. Headers that carry a credential are left out.
_trigger.queryThe URL's query parameters, so _trigger.query.relay reads a ?relay=on parameter. Absent when the URL had none.
How a request's body is read

A request may use any HTTP method, including ones other protocols use, such as UPnP's NOTIFY. A body is read as JSON when it holds a JSON object, whatever its Content-Type, and a JSON object's fields keep their types. A form posted as application/x-www-form-urlencoded, the way an HTML form is, gives a string for every field; a field that itself carries JSON stays a string, which a Script step can read with JSON.parse. A repeated field name keeps its first value, as _trigger.query does for a repeated parameter. An empty body with a query string is a valid delivery whose output is just _trigger. A body that itself carries a _trigger object keeps its entries, with the trigger's own written over any of the same name, and the picker marks the object as the trigger's.

A header that carries a credential, meaning Authorization, Cookie, or one whose name says token, key, secret, auth, password or credential, is left out of _trigger.headers, and a signature header keeps only its scheme and first characters.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.