Recipes

Handler recipes

Five copy-paste recipes for receiving Cortex-dispatched triggers, signed and verified. All five sit behind the same trigger dispatch contract; pick the runtime you're already using.

What every recipe covers

  1. Register a handler via handler.register (one call, returns a webhook_secret).
  2. Verify the signature on every inbound POST using the canonical timestamp + "." + body string. 5-minute replay window. Reject stale or mismatched signatures with 401.
  3. Execute the action through whatever channel the recipe's runtime exposes (Slack node, email step, custom function, etc).
  4. Call back trigger.complete (or trigger.reverse) with the outcome and your external reference id.
  5. Handle retries — Cortex dedupes via X-Cortex-Idempotency-Key. Your handler must too.

Cross-cutting references