Webhook Trigger
The Webhook Trigger starts the workflow when an HTTP request reaches its URL. Use it to receive events from Stripe, GitHub, Slack, Shopify, Twilio, your own backend, or anything else that can call a URL.
Webhook URLs
Every Webhook Trigger step gets a random, unguessable token and two URLs. Both are shown at the top of the step's settings, with a copy button:
| URL | Format | What it does |
|---|---|---|
| Production URL | https://<api-host>/api/webhook/<token> | Starts a run of the published workflow. The badge reads Live once the workflow is published, and Not live — publish to activate before that. |
| Test URL | https://<api-host>/api/webhook-test/<token> | Captures a request while the editor is listening. Does not start a run. |
The production URL only accepts requests when the workflow has a published version that contains this trigger
and the workflow is enabled. Otherwise it returns 404. Changes you make to the trigger take effect the next
time you publish.
Webhook URLs issued before token URLs were introduced keep working, so you don't need to reconfigure senders.
Capturing a test event
- Open the Webhook Trigger step and click Listen for a test request.
- Send a request to the Test URL within 120 seconds (the countdown is shown next to the button).
- The request appears in the step with its method, time and verification result. Its method, path, headers, query and body become the step's sample data, so you can map fields in later steps right away.
While listening, the test URL uses the current draft of the workflow. If you aren't listening, it returns
404 with Not listening. Click "Listen for test event" in the editor first.
The test URL always replies 200 with { "received": true, "verified": true | false | null }. If verification
fails, the event is still captured and the step shows Verification failed with the reason, which makes it
easy to debug a signature setup. Uploaded files are not stored for test events.
Test runs
Capturing a test event doesn't start a run. To run the workflow, click Test run in the editor header and pick
the Webhook Trigger. The dialog's Trigger data box is pre-filled with { "body": {}, "headers": {}, "query": {} };
fill in the parts your workflow reads, for example:
{ "body": { "orderId": 1042, "total": 149.9 }, "headers": {}, "query": {} }
The object becomes $trigger and the trigger step's output for that run. To start every test run with a captured
request instead, pin it on the trigger's output.
Settings
| Name | Required | Default | Description |
|---|---|---|---|
| HTTP methods | No | POST | Which methods start a run: GET, POST, PUT, PATCH, DELETE. At least one must stay selected. |
| Respond | No | Immediately | How the HTTP call is answered. See Response modes. |
| Response timeout (seconds, max 120) | No | 30 | How long to wait for the workflow in the two waiting response modes. Values are clamped to 1–120. |
| Request Verification | No | None | How to check that a request is genuine. See Request verification. |
:::tip GET is off by default
Link previews, chat apps and crawlers often fetch any URL they see. Leaving GET disabled stops them from
starting runs. Enable it only if your sender really uses GET.
:::
A request with a method that isn't enabled gets 405 Method Not Allowed with an Allow header that lists the
enabled methods.
Trigger output
The trigger outputs one object that describes the request:
{
"method": "POST",
"path": "/api/webhook/8hN2kq0Yb3vVx1sLr9TzWc4mPa7Ue5Fd",
"headers": {
"content-type": "application/json",
"user-agent": "Stripe/1.0 (+https://stripe.com/docs/webhooks)",
"stripe-signature": "t=1762851600,v1=5257a869e7ec..."
},
"query": { "source": "stripe" },
"queryParams": { "source": "stripe" },
"body": {
"id": "evt_1Q2w3E4r",
"type": "checkout.session.completed",
"data": { "object": { "id": "cs_test_a1", "amount_total": 4900 } }
},
"rawBody": "{\"id\":\"evt_1Q2w3E4r\",\"type\":\"checkout.session.completed\", ...}",
"files": null
}
| Field | Description |
|---|---|
method | The HTTP method. |
path | The request path. |
headers | All request headers. Header names are lowercase. |
query | Query-string parameters as an object of strings. |
queryParams | Same as query. Kept for older workflows. |
body | The parsed body (see below). |
rawBody | The exact body as text, before parsing. null for multipart/form-data requests and file bodies. |
files | For multipart/form-data requests, the uploaded files as file references; for a file body, that one file. Otherwise null. |
How body is parsed:
| Request | body |
|---|---|
Content-Type contains json (for example application/json, application/vnd.api+json) | The parsed JSON value. If the JSON is invalid, the raw text. |
No Content-Type, and the body starts with { or [ | The parsed JSON value. |
application/x-www-form-urlencoded | An object of form fields (string values). |
multipart/form-data | An object of the text fields. Files go to files. |
A file: a non-text Content-Type (application/pdf, image/png, application/octet-stream…), or no Content-Type and bytes that aren't text | The file, stored as a file reference (named from Content-Disposition when sent). Test events show a short description instead. |
| Anything else | The body as a string. |
Use the output in later steps with expressions, either through the trigger step's
name or through $trigger, which always points at the payload that started the run:
{{ $trigger.body.data.object.id }}
{{ $trigger.headers['x-github-event'] }}
{{ $trigger.query.source }}
{{ $nodes['Webhook Trigger'].body.type }}
Response modes
The Respond setting controls what the caller gets back.
| Mode | Response |
|---|---|
| Immediately (202 + run ID) (default) | 202 Accepted with { "executionId": "…" } as soon as the run is queued. |
| When the last step finishes | Waits for the run to finish, then replies 200 with the output of the last step that completed successfully, as JSON. If the run fails or is cancelled, replies 500 with { "error", "executionId", "status" }. |
| Using a Respond to Webhook step | Waits until a Respond to Webhook step runs and replies with the status code, headers and body it sets. If the run finishes without reaching one, replies 500. |
In both waiting modes, if no response is ready within Response timeout, Blokkio replies 504 with
{ "error": "Timed out waiting for the workflow to respond.", "executionId": "…" }. The run itself carries on.
# Default mode
curl -X POST https://api.blokkio.com/api/webhook/8hN2kq0Yb3vVx1sLr9TzWc4mPa7Ue5Fd \
-H "Content-Type: application/json" \
-d '{"orderId": 1042}'
# → 202 {"executionId":"0f6c2a8e-6a41-4f7e-9a0b-3d2f5c1e7b90"}
Limits and duplicate requests
| Limit | Value | Response when exceeded |
|---|---|---|
| Request body size | 10 MB | 413 |
| Rate limit | 120 requests per 60 seconds, per webhook URL | 429 |
Idempotency-Key length | 255 characters | 400 |
These are the limits on Blokkio Cloud.
Idempotency-Key
Senders often retry when they don't get an answer fast enough. To make sure a retry doesn't start a second run,
send an Idempotency-Key header with a value that's unique per event:
curl -X POST https://api.blokkio.com/api/webhook/8hN2kq0Yb3vVx1sLr9TzWc4mPa7Ue5Fd \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1042-created" \
-d '{"orderId": 1042}'
The first request starts a run. Any repeat with the same key within 24 hours starts nothing and gets
202 { "executionId": "<the original run>" } with an Idempotent-Replayed: true header.
Request verification
Anyone who knows the URL can call it. Verification makes sure a request really comes from the expected sender.
Choose a method under Request Verification. Requests that fail verification get 401 with
{ "error": "<reason>" } and don't start a run.
Settings that hold a key, token or signing secret use the Secret field. Pick a project secret there instead of pasting the value. Secrets resolve in the environment the trigger runs in, so production and staging can use different signing secrets.
All signature checks run over the raw request bytes, exactly as received, and compare in constant time.
Signature presets
Use a preset when the sender is one of these services. You only need to store the signing secret.
| Preset | Header checked | What is signed | Replay protection |
|---|---|---|---|
| Stripe | Stripe-Signature (t=…,v1=…) | HMAC-SHA256 of {t}.{raw body} with the endpoint signing secret. Any matching v1 passes. | Timestamp must be within the replay window. |
| Slack | X-Slack-Signature (v0=…) and X-Slack-Request-Timestamp | HMAC-SHA256 of v0:{timestamp}:{raw body} with the signing secret. | Timestamp must be within the replay window. |
| GitHub | X-Hub-Signature-256 (sha256=…) | HMAC-SHA256 of the raw body with the webhook secret. | None (GitHub doesn't sign a timestamp). |
| Shopify | X-Shopify-Hmac-Sha256 (base64) | HMAC-SHA256 of the raw body with the app secret. | If X-Shopify-Triggered-At is present, it must be within the replay window. |
| Twilio | X-Twilio-Signature (base64) | HMAC-SHA1 of the full public URL plus the sorted form fields, with your auth token. For JSON bodies, the bodySHA256 query parameter is checked against the body. | None (Twilio doesn't sign a timestamp). |
Replay Window (seconds) defaults to 300. It applies to Stripe, Slack, Shopify and the custom HMAC option
when a timestamp header is set.
For senders without replay protection (GitHub, Twilio), duplicates are best handled with an
Idempotency-Key or by checking the delivery id in the workflow.
For Twilio, the URL Twilio calls must match the URL Blokkio sees. Blokkio uses its public webhook URL for this.
HMAC signature (custom)
For any other sender that signs requests with an HMAC.
| Name | Default | Description |
|---|---|---|
| Signature / Key Header | — | The header that holds the signature, for example X-Signature. Required. |
| Algorithm | SHA-256 | SHA-256, SHA-512 or SHA-1. |
| Signature Encoding | Hex | Hex, Base64, or Hex with prefix. |
| Signature Prefix | — | Text to strip from the start of the header before decoding, for example sha256=. If set, the header must start with it. |
| Timestamp Header (optional) | — | If set, this header must hold a Unix timestamp (seconds), the signed payload becomes {timestamp}.{raw body}, and the replay window applies. |
| Secret | — | The shared signing secret. |
| Replay Window (seconds) | 300 | Maximum age of the timestamp. Only used with a timestamp header. |
API key
Checks a static key sent with every request.
| Name | Default | Description |
|---|---|---|
| Key Location | Header | Header, Query string, or Basic auth password (the password part of an Authorization: Basic header). |
| Signature / Key Header | — | The header name, when the location is Header. |
| Query Parameter | — | The parameter name, when the location is Query string, for example api_key. |
| Secret | — | The expected key. |
JWT (Bearer)
Validates a JWT in an Authorization: Bearer <token> header. The token's signature and expiry (exp/nbf,
with 30 seconds of clock skew) are always checked.
| Name | Default | Description |
|---|---|---|
| Signing Key | JWKS URL | JWKS URL (asymmetric keys published by the issuer) or Shared secret (HS256). |
| JWKS URL | — | For example https://issuer.example.com/.well-known/jwks.json. Keys are cached for 10 minutes and refreshed automatically when a token uses an unknown key id. |
| Secret | — | The shared secret, in Shared secret (HS256) mode. |
| Validate Issuer / Issuer | Off | Require the iss claim to equal this value. |
| Validate Audience / Audience | Off | Require the aud claim to equal this value. |
| Required Claims | — | Extra claims that must be present with an exact value, as claim=value pairs separated by commas, for example scope=webhooks,tenant=acme. |
IP allowlist
Only accepts requests from listed addresses.
Allowed IPs / CIDR ranges takes single IPs and CIDR ranges, IPv4 and IPv6, separated by commas, spaces, semicolons or new lines:
203.0.113.0/24, 198.51.100.7
2001:db8::/32
The client address is the one Blokkio's API resolves itself. X-Forwarded-For is only honoured when it comes
from Blokkio's own proxies, so callers can't spoof their IP with that header. The older
Trust X-Forwarded-For option is no longer used.
Custom script
Write your own check in JavaScript when no preset fits. The script runs in a sandbox (strict mode, 10 MB memory, 5 seconds, recursion depth 64) and has these globals:
| Global | Description |
|---|---|
request | { method, path, headers, query }. Header names are lowercase. |
body | The raw request body as a string. |
$secrets.get(name) | Returns the value of the project secret name (environment aware), or null if it doesn't exist. |
crypto.hmacHex(algorithm, secret, payload) | HMAC as lowercase hex. algorithm is 'sha256', 'sha512' or 'sha1'. |
crypto.hmacBase64(algorithm, secret, payload) | HMAC as base64. |
crypto.sha256(payload) | SHA-256 hash as lowercase hex. |
crypto.timingSafeEqual(a, b) | Compares two strings in constant time. |
The script's result is the value of its last expression. Don't use a top-level return. The result must be
either a boolean or an object { verified: boolean, reason?: string }. The reason is returned to the caller and
shown in the editor when verification fails. Errors, null and undefined count as failed verification.
This example checks an X-Signature: sha256=<hex> header against an HMAC of the body, using the secret
WEBHOOK_SECRET:
const signature = request.headers['x-signature'] ?? '';
const secret = $secrets.get('WEBHOOK_SECRET');
const expected = 'sha256=' + crypto.hmacHex('sha256', secret ?? '', body);
({
verified: secret !== null && crypto.timingSafeEqual(signature, expected),
reason: secret === null ? 'WEBHOOK_SECRET is not set' : 'Signature mismatch'
})
A simple shared-token check can be one line:
crypto.timingSafeEqual(request.headers['x-token'] ?? '', $secrets.get('WEBHOOK_TOKEN') ?? '')
The script is plain JavaScript, not a Blokkio expression. {{ }} inside it is not interpolated, and the
expression variables ($nodes, $trigger, …) aren't available. Read secrets with $secrets.get('NAME').
Response codes
| Status | When |
|---|---|
200 | Waiting response modes, or a test URL call. |
202 | Default mode, or a repeated Idempotency-Key. |
400 | Idempotency-Key longer than 255 characters. |
401 | Verification failed. |
404 | Unknown URL, workflow not published or disabled, or test URL not listening. |
405 | Method not enabled for this webhook. |
413 | Body larger than 10 MB. |
429 | Rate limit exceeded. |
500 | Waiting mode: the run failed or was cancelled, or finished without reaching a Respond to Webhook step. |
504 | Waiting mode: no response before the timeout. |