POST
request to the trigger’s URL. The flow runs without a contact, as an automation run, with the request available
under flow.webhook.
Setting it up
- Add a trigger to the flow and choose Webhook.
- Pick a verification preset — HMAC-SHA256, HMAC with timestamp, GitHub or Secret in a header — and adjust the fields to what the sending system does (see Verification).
- Click Get URL. The URL looks like
https://<your-workspace-host>/hooks/flow/<token>; the token is random and is the only part that identifies the trigger. Copy it into the sending system. - Click Generate secret and copy the secret into the sending system. It is shown once: after you leave the panel only “Secret set” is shown. If the sending system issues its own signing secret, paste it under Use a secret from the sender instead.
- Publish the flow. Until the flow is published with the trigger active, the URL answers
404, so you can set up the sender first.
Verification
Every request is checked before anything else happens.
Against replays (HMAC only). When the sender also sends the time it signed the request, set the timestamp
header and the signed string — what the sender actually signs, with
{raw} for the body and the timestamp
header as a placeholder, for example {header.X-Timestamp}.{raw} or v0:{header.X-Slack-Request-Timestamp}:{raw}.
A request whose Unix time is further than the tolerance (300 seconds by default) from now is refused, and
because the timestamp is part of the signature, an old request cannot be resent with a fresh one. A timestamp
header without a signed string that contains it is refused at publish.
A secret in the query string is never accepted. The signature, timestamp, Authorization and Cookie headers, and
any header with signature in its name (such as GitHub’s X-Hub-Signature next to X-Hub-Signature-256), are not
passed on to the flow.
Delivery id: no request runs twice
Senders retry when they do not get an answer in time, so the same event can arrive more than once. Set Delivery id to where the sender puts a unique id of each delivery, as one placeholder:{header.X-GitHub-Delivery}— a request header;{body.id}or{body.event.id}— a field of a JSON body;{header.X-Delivery-Id|body.id}— the first of several that is present.
Authorization, Cookie: the id is shown in the answer, the history and the run, and the secret would go with it.
Such a setting is refused at publish.
A request whose delivery id was already seen starts nothing and is answered 200 with "status": "duplicate".
Repeats are recognised for a day by a quick check, and for as long as the earlier run is kept in the history.
Without a delivery id — the field is empty, or the request lacks it — every request gets a new id, so a resent
request starts the flow again. The builder warns about an empty field.
A run that failed can be started again by hand from its session page, with the same request — see
Running a failed run again. That run answers nobody: the sender’s request
was answered long ago.
What the flow receives
The flow has no contact, so blocks that need one cannot be published in it; see
Publishing.
Answers
Response mode
Response in the trigger’s settings chooses what the sender gets once the request is accepted:-
Accept at once (202) — the default. The sender gets
202as soon as the run is queued; it does not wait for the flow. -
Wait for the flow’s answer — the request is held open while the flow runs, for up to 30 seconds, and the
sender gets what the flow answers:
- the first Respond to webhook block the run reaches: its status (200–499) and its body, JSON or text, built
from the run’s variables — for example
{"order": "{{flow.webhook.body.id}}", "status": "received"}. The block works inside a subflow too. The run goes on after it; a later block or the end of the run changes nothing; - otherwise, the end of the run:
200with{"status": "completed"}(or"cancelled", when an End block says so), or500with{"status": "failed"}when the run fails.
202and the run continues. Only the content type of an answer is set (application/jsonortext/plain); no other header comes from the flow. - the first Respond to webhook block the run reaches: its status (200–499) and its body, JSON or text, built
from the run’s variables — for example
flow.webhook.sync_waiters_max, flow.webhook.sync_waiters_per_tenant), for at most
flow.webhook.sync_wait_seconds seconds — see Platform settings. A burst of
deliveries, or runs of the same trigger queued behind each other, therefore gets 202 rather than the flow’s
answer: a sender that needs the outcome of every delivery should not rely on it.
Outside this mode the Respond to webhook block does nothing; the builder warns when a flow has the block but no
trigger that waits for the answer.