Skip to main content
A webhook trigger starts a flow when another system — a CRM, a shop, GitHub, your own backend — sends a 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

  1. Add a trigger to the flow and choose Webhook.
  2. 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).
  3. 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.
  4. 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.
  5. Publish the flow. Until the flow is published with the trigger active, the URL answers 404, so you can set up the sender first.
Getting the URL needs the permission to edit the flow; generating or replacing the secret needs the permissions to publish it and to Manage automations, because the secret is what lets an outside system start the flow. Replacing the secret is recorded in the activity log; the old secret stops working at once. The secret never appears in the trigger’s settings, the draft, a published version or a template: it is stored encrypted, apart from the flow. Deleting the trigger (or changing its type) and publishing deletes its URL and secret.

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.
The delivery id cannot be one of the headers the flow never sees — the signature or secret header, the timestamp, 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 202 as 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: 200 with {"status": "completed"} (or "cancelled", when an End block says so), or 500 with {"status": "failed"} when the run fails.
    If the flow does not answer in time, or more requests are already waiting than the platform allows, the sender gets the usual 202 and the run continues. Only the content type of an answer is set (application/json or text/plain); no other header comes from the flow.
Waiting holds a server worker for each request, so few may wait at once: by default 5 on the whole installation and 2 per workspace (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.