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
1
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.2
Pass callback_url on every run
3
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.4
Copy outputs to your storage
Output URLs are presigned and time-limited. Download or re-upload them to your own bucket on receipt. Do not store the raw URLs as your source of truth.
Verify it worked
Trigger a run, watch your handler logs:You have a row in your DB with
status: succeeded. You’re done.Troubleshooting
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.