Webhooks
What a system sends to a Flowmage webhook, what it gets back, and what the flow receives: method, headers, keys, signatures, status codes and the trigger payload.
To make a webhook, see Start a flow from a webhook.
curl
curl -X POST 'https://hooks.flowmage.com/hook/whu_YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--data '{"name":"Anna","email":"anna@example.com"}'JavaScript
const response = await fetch("https://hooks.flowmage.com/hook/whu_YOUR_TOKEN", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"name":"Anna","email":"anna@example.com"}),
});
console.log(response.status, await response.text());Python
import requests
response = requests.post(
'https://hooks.flowmage.com/hook/whu_YOUR_TOKEN',
headers={
'Content-Type': 'application/json',
},
data='{"name":"Anna","email":"anna@example.com"}'.encode(),
)
print(response.status_code, response.text)What you send
| Part | What a webhook takes | Notes |
|---|---|---|
| Method | POST | Any other method gets 404. |
| URL | https://hooks.flowmage.com/hook/whu_… | On the webhook's page in Triggers. |
| Key | Authorization: Bearer <key>, x-api-key: <key> or ?key=<key> | Only when the webhook has a Sender key. |
| Request id | idempotency-key: <id> | Or x-idempotency-key, x-request-id, x-github-delivery. The same id again, within the window the builder above shows, starts no second run. |
| Content | content-type: application/json and a JSON document | Any other content arrives as text, in trigger.body.rawBody. |
| Signature | x-hub-signature-256: sha256=<hex> (GitHub) or the Signature header you set, x-signature at first (Generic HMAC-SHA256) | Only when the webhook has a Signature check: the HMAC-SHA256 of the raw request, made with its Signing secret. |
What Flowmage answers
| Status | When | What it sends back |
|---|---|---|
202 | The webhook took the request and started the run. | {"executionId":"…"}; with two or more flows on it, {"executions":[…],"deliveryIds":[…]} |
200 | Answer the caller is on; the run finished. | What Answer with works out, or the last node's output. |
500 | Answer the caller is on; the run failed. | {"error":{"code":"…","message":"…"},"executionId":"…"} |
504 | Answer the caller is on; the run took longer than Wait at most and goes on. | {"executionId":"…"} |
404 | The URL is unknown, no flow on it is published in the webhook's environment, or the key is missing or wrong. | Not found |
401 | The signature is missing or does not match. | Not found |
403 | The sender's address is not under Allowed addresses. | {"error":{…}} |
413 | The request is larger than a webhook takes. | {"error":{…}} |
429 | Over Deliveries per minute, or over a workspace limit. | {"error":{…}}, and a Retry-After header |
What the flow receives
| In the flow | Holds |
|---|---|
trigger.body | The JSON you sent. |
trigger.headers | The headers, by name. |
trigger.query | The query parameters, by name. |
trigger.method | POST |
trigger.receivedAt | When it arrived, as an ISO 8601 time. |
trigger.file | What was sent, when larger than the size on Limits, kept as a file in place of trigger.body. |
How they behave
- Credentials stay out of the run.
authorization,x-api-keyand every header withsignatureorhmacin its name arrive as•••, as does akeyquery parameter. Cookies are left out. - A webhook answers at once, or with Answer the caller on, after the run, up to Wait at most. Each flow on it starts its own run; a request the workspace cannot start yet is kept and started when it can.
- Security is on the webhook's page, under Security: Sender key, Signature check, Allowed addresses and Deliveries per minute (
0is no limit).
Common mistakes
- Testing the URL in a browser. A browser sends
GET, which gets404. Send aPOST, for example withcurl. - Sending the key in another header. Only
Authorization: Bearer,x-api-keyand thekeyquery parameter count; anything else gets404. - Leaving out the content type. Your JSON then arrives as text in
trigger.body.rawBody. - A new request id on each retry. Keep the same
idempotency-key, so a request that did arrive starts no second run. - Signing the JSON after parsing it. Sign the exact bytes you send: a changed space or key order changes the signature.