Documentation Index
Fetch the complete documentation index at: https://docs.runflow.io/llms.txt
Use this file to discover all available pages before exploring further.
What you’ll do
Stand up a webhook handler that takes a Runflow callback, persists the result, and returns200 fast.
Prerequisites
- A Runflow API key. Create one.
- A public URL for the handler. Use ngrok for local dev.
- A database or queue to persist results.
Steps
Stand up the handler
The handler should: parse the body, persist the relevant fields, return
200 within a few seconds.These examples parse JSON directly for a local prototype. In production, verify Runflow-Signature against the raw request body before parsing JSON; see Verify callback signatures.Be idempotent
Runflow retries failed callbacks. Match on
run_id for run callbacks or batch_id for batch callbacks, and skip if you have already processed it.Verify it worked
Trigger a run, watch your handler logs:You have a row in your DB with
status: succeeded. You’re done.Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Callback arrives but body is empty | Missing body parser | For unsigned prototypes, use express.json() or framework equivalent. For signed handlers, read the raw body first. |
| Handler times out | Heavy work in the request | Return 200 first, defer heavy work. |
| Same payload arrives twice | Retry on a 5xx your handler returned | Be idempotent on run_id. |
| Nothing arrives | URL not public | Use ngrok or Cloudflare Tunnel for local dev. |
Production hardening
- Verify the signature so spoofed POSTs cannot reach your DB.
- Wrap your handler in a queue (SQS, Pub/Sub, BullMQ) so a slow downstream cannot drop callbacks.
- Monitor
4xxand5xxfrom your endpoint. Runflow stops retrying after a few attempts.
Related
Verify signatures
HMAC verify in code.
Callbacks concept
Pattern, retries, redelivery.