Developers

Trigger work by webhook

Start Foreman work from an external system.

About 4 minutes

Routines normally run on a schedule. They can also be triggered externally, which is how you make something in your stack start Foreman work.

Good uses

A deal reaching a stage in another system, a deployment finishing, a monthly close completing — anything where the trigger lives outside Foreman but the work belongs inside it.

Steps

  1. Create the routine and define what it should do.
  2. Enable webhook triggering and copy the endpoint.
  3. Call it from your system.
  4. Confirm the work started — it appears like any other run.

You're done when an external call produces work you can watch on the Dashboard.

Gotchas

  • Triggered work meters like any other work. A webhook wired to a chatty event is a recurring bill. Debounce on your side.
  • The routine defines the work, not the caller. The payload provides context; it does not get to specify arbitrary actions — which is deliberate.

Checked against

  • endpoints/routines/webhook_POST.ts
  • endpoints/routines/trigger_POST.ts