Start work from webhooks
Verify incoming events and publish queue jobs for the matching workflow.
Prepare a queue and worker before exposing a webhook. The HTTP server verifies and queues a request; it does not run the agent. You also need an application rule deciding which verified senders may request work.
Receive a webhook and publish a job
Section titled “Receive a webhook and publish a job”Use a webhook source to verify the incoming request, then route the accepted event to a queue job. serveTriggers() handles the HTTP request; workers execute the workflow after publication.
Adding the outpost:fix label to an issue or a pull request publishes a fix job to the queue. A worker runs it with defineWorkflowJob(): see Job queues and workers.
A job names a registered worker handler, a runId of at most 256 characters and an optional JSON input. Keep on() fast: GitHub waits 10 seconds for an answer, Slack 3 seconds.
Check a local delivery
Section titled “Check a local delivery”Set GITHUB_WEBHOOK_SECRET for both processes and run node server.ts. In another terminal, run node send-webhook.ts: expect 202, then 401. No worker is needed for this check; the job stays in the queue. Replace github:octocat with authorized actors before connecting a real repository.
Pick a source
Section titled “Pick a source”| Source | Verification | Delivery identifier | event.actor |
|---|---|---|---|
createGithubWebhook({ secret }) | X-Hub-Signature-256, an HMAC of the body. JSON or form payloads. | X-GitHub-Delivery | github:<login> |
createGitlabWebhook({ signingToken }) | webhook-signature with a whsec_ signing token (GitLab 19.0+), 5-minute window. | webhook-id | gitlab:<username> |
createGitlabWebhook({ token }) | X-Gitlab-Token equals the token. The body is not signed. | Idempotency-Key, else X-Gitlab-Event-UUID | gitlab:<username> |
createSlackSource({ signingSecret }) | X-Slack-Signature over the timestamp and body, 5-minute window. | trigger_id | slack:<user id> |
createStandardWebhook({ secret }) | Standard Webhooks whsec_ secret, 5-minute window. | webhook-id | none |
Prefer a GitLab signing token: a plain token travels as is in a header and does not sign the body. toleranceMs changes the 5-minute window. Slack sources accept slash commands and interactive payloads.
Read the event
Section titled “Read the event”Two helpers recognize the common events and return undefined for everything else.
API reference: labelAdded, commandIssued and TriggerEvent.
Use the event contract when handling another kind of delivery.
API reference: TriggerEvent.
Authorize senders
Section titled “Authorize senders”A verified signature proves the request comes from your GitHub, GitLab or Slack integration, not that its author may start a workflow. Anyone who can comment on a public repository can write /outpost: check event.actor against an explicit list.
Pass fromCommand as a route’s on. event.actor is not an Outpost gate actor: approvals authenticate their deciders separately.
For this step, follow Operate a webhook server.

