Skip to main content

What you’ll do

Reject spoofed POSTs to your webhook by verifying the Runflow-Signature HMAC header against a shared secret.

Prerequisites

Steps

1

Create a callback secret

Response:
Save plain_secret to your secret manager. It is shown once.
2

Verify the signature in your handler

Runflow sends Runflow-Signature: <hex> where the value is HMAC-SHA256(secret, raw_body). The hex string is 64 chars (SHA-256 digest size).
3

Use timing-safe comparison

Always compare with crypto.timingSafeEqual (Node) or hmac.compare_digest (Python). Plain == leaks timing info. Both inputs must be the same length, hence the regex pre-check above.

Verify it worked

Send a test callback (re-deliver one):
Your handler logs should show 200. Now send a forged POST without the header. Your handler should return 401.

Troubleshooting

Rotation

Create a second secret. Both verify in parallel during cutover. Delete the old secret once traffic confirms the new one works.

Handle callbacks

Handler structure.

Callbacks concept

Pattern, retries.