How to trigger a coding agent from a webhook with an approval step
Create a From a webhook automation delivered to a Slack thread, and write its instructions in two phases: investigate and post a plan, then stop. The run’s thread stays open to your team, so the agent continues only when a person replies “approved” there. Pull request review and branch protection add a second gate before anything merges.
The approval step for each run is a reply in its Slack thread from someone your Slack inbound access lets drive the agent. Nori also gates with admin approval is the automation itself: a member’s new automation, or a change to one, waits under Review requests until an admin approves it.
Prerequisites
Section titled “Prerequisites”- A system that can send an HTTP POST with a JSON body: CI, Sentry, Grafana, Alertmanager, a form, or your own service.
- The Nori Slack app installed, the bot in the
approval channel (for example
#deploy-approvals), and that channel’s ID. - The GitHub App and your repositories under Settings → Environment, if the agent will change code.
- Branch protection on
mainthat requires a review, so the agent’s pull requests cannot merge themselves.
- Open Automations → New automation, name it, and under Starts when choose From a webhook.
- Write two-phase Instructions (see the example): phase one is read-only and ends with a plan; phase two runs only after a reply that says “approved”.
- Under Deliver to, choose Slack thread and enter the channel ID. Keep Channel post on Standard header so the plan stays in the thread.
- Save. Members see Submit for approval; the automation starts working once an admin approves it.
- Open the automation and use Copy webhook URL
(
https://<org>.norisessions.com/api/webhook/<automation-id>). Treat it as a secret: anyone with it can start a run. - Configure your system to POST JSON to that URL. Nori appends the payload (up to 1 MB) to the instructions and marks it as untrusted data, so text inside the payload is not treated as a request.
- When a run posts its plan, a person replies in the thread:
approved, or new constraints. Plain thread replies reach the agent without a mention, unless your org uses tag-only reply mode.
Example
Section titled “Example”Instructions:
A webhook fired; the payload is attached.
Phase 1 (read-only): work out what the payload asks for, inspect therelevant repository, and post a short plan: what you would change, whichfiles, and the risk. Change nothing, push nothing, open nothing. End with"Reply approved to proceed." and stop.
Phase 2: only after someone replies "approved" in this thread, carry out theplan on a new branch, run the tests, and open a pull request. Never merge.If the reply asks for changes, revise the plan and wait again.A test delivery:
curl -X POST "https://<org>.norisessions.com/api/webhook/<automation-id>" \ -H "Content-Type: application/json" \ -d '{"service":"checkout","event":"error_rate_high","threshold":"5%"}'The call answers with { "ok": true, "firingId": ... } once the run is
queued.
Verify it works
Section titled “Verify it works”- Send the test delivery above, or choose Run now and paste a payload into Optional JSON payload.
- A thread opens in the channel with the automation header, then the agent’s plan. Confirm that no branch or pull request exists yet.
- Reply
approved. The agent continues in the same session and posts the pull request link. - Check the automation’s Recent activity for the run and Latest webhook payload.
For delivery limits, retries, and running each firing in an existing thread, see automations.
this page as markdown: /sessions/recipes/webhook-trigger-with-approval.md· index for agents: /llms.txt