Webhooks
Start a workflow when another program sends a request to an address on this computer, and tell another program what happens in a run: the address, the secret, the queue, signed updates, retries and the delivery log.
What a webhook is here
A webhook works in two directions in Cerevisor:
- In: Start from a webhook. Your workflow gets its own address on this computer. When another program sends a request to it (a form, GitHub, n8n, a script), the workflow runs and its entry agent receives what was sent.
- Out: Send to a URL. Cerevisor sends a short message to an address you choose when something happens in a run: it started, it finished, an agent is waiting for your answer. Each message can be signed so the receiver knows it came from you.
Both work only while Cerevisor is open, and the address listens on this computer only. To reach it from the internet you use a tunnel of your own; this page shows two.
Both are included on the trial, Pro and Power. Not on Free; see What your plan changes.
Start a workflow from a webhook
Set it up
- Save the workflow. A webhook runs the workflow from its saved file, so the card asks you to save first: "Save this workflow first. A webhook runs the workflow from its saved file."
- Open the workflow's input: Settings → Input, or Manual Controls → Workflow Input… on the canvas toolbar. Choose Webhook.
- Press Start from a webhook.
The same card is in the Schedule window, on the From a webhook tab. It is offered only when you schedule the whole workflow: a webhook always starts the whole workflow, never one agent.
The card then shows:
| On the card | What it is |
|---|---|
| Address | The address to send to, for example http://127.0.0.1:48634/hooks/Xr4c…, and Copy address. If port 48634 is already taken when Cerevisor opens it, Cerevisor takes a free port and the card shows that one. |
| Entry Agent | The agent that receives what arrives. Auto-pick the first agent is the default. |
| How the sender proves itself | Secret in the Authorization header (the default) or Signed request. See Proving who sent it. |
| When the workflow is already running | Queue it and run when the current run finishes (the default) or Refuse it; the sender can try again. |
| Secret | Shown once, right after you press Start from a webhook, with Copy secret. |
| Rotate secret | Makes a new secret and shows it once. A sender still using the old one stops working on its next request. |
| Sample request | A curl command with the address and the secret on screen, and Copy request. Run it in a terminal on macOS or Linux, or in Git Bash on Windows. |
| Waiting to run | How many requests are queued, and Clear the queue. |
| Remove this webhook | Deletes the webhook, its secret and its queue. |
Copy the secret when it is shown. Cerevisor shows a secret only once, when it is made. If you lose it, press Rotate secret and give your senders the new one.
Try it
With the default setting, a sender puts the secret in the Authorization header:
curl -X POST "http://127.0.0.1:48634/hooks/<id>" -H "Authorization: Bearer <secret>" -H "Content-Type: application/json" -d '{"hello":"world"}'
The answer is JSON. A request that was taken gets 202 and its delivery id:
{ "deliveryId": "9d3c7e52-1f0a-4b8e-a6d2-3e5f7a9c1b04", "outcome": "started" }
or, when it waits behind another run, { "deliveryId": "…", "outcome": "queued", "position": 1 }.
Reach it from the internet
The address listens on 127.0.0.1 only, so nothing on your network or the internet can reach it by itself. To receive requests from a service on the internet, run a tunnel to port 48634 (or to the port the card shows):
cloudflared tunnel --url http://127.0.0.1:48634
ngrok http 48634
The tunnel gives you a public address. Add the /hooks/<id> part from the card to it, and give that to the sender. The secret is still checked on every request; if your tunnel offers its own sign-in or access rules, use them as well. Cerevisor never opens a public address for you.
What the entry agent receives
Each request starts a run, and the entry agent's message reads like this:
This run was started by a webhook.
Delivery: 9d3c7e52-1f0a-4b8e-a6d2-3e5f7a9c1b04, received 2026-10-23T14:02:11.120Z.
The full payload is in the file below; read it with read_file when you need more than what is quoted.
File: D:\Projects\Orders\orders\inbox\2026-10-23 16-02-11 9d3c7e52-1f0a-4b8e-a6d2-3e5f7a9c1b04.json
followed by the first 16,384 characters of what was sent, marked as outside content. In that quote each link is replaced by [link removed: <host>]; the file keeps the links. A body that is not JSON is accepted too, as text.
The inbox folder
Everything that arrives is saved before anything else happens, in an inbox folder inside the workflow's own folder:
inbox/<date> <time> <delivery id>.jsonholds the body exactly as it was sent, whatever its type.inbox/<date> <time> <delivery id>.meta.jsonbeside it says when it arrived, its content type, the sender's address on this computer, which headers it had (by name only, never their values) and its size.
When a later run files the previous run away into runs/<date time>/, the requests that are finished move into that run's own inbox/ folder. A request still waiting or running stays where it is. Files of your own in the inbox folder are left alone and stay visible.
A workflow without its own folder keeps its inbox folder in its working folder, and nothing there is filed away.
When the workflow is already running
One webhook run of a workflow at a time. With Queue it and run when the current run finishes, a request that arrives during a run waits its turn, and the runs follow one another. Up to 50 can wait, the one running included. The queue is kept on disk, so a request still waiting when you close Cerevisor runs after you open it again.
With Refuse it; the sender can try again, a request that arrives during a run is answered 409 and is not kept.
A queued request runs the workflow as it is saved when its turn comes, not as it was when the request arrived.
Outside content, and the reader and publisher pair
What arrives at a webhook was written by someone else, so Cerevisor treats it as outside content, like a web page. The entry agent starts the run marked as having read outside content, and so does every agent it hands its work to. Opening the delivery file with read_file marks an agent the same way.
A webhook run counts as a run nobody is watching. In such a run an agent marked this way that tries to send something out is refused, not asked, and is told why. This is on purpose: a request could carry hidden instructions telling the agent to send your data somewhere.
If the workflow must also send something out, split the work between two agents and set their Trust Role in the agent's settings:
- The entry agent reads the request. Set it to Quarantined reader: it reads outside content with a reduced set of tools (no file writes, no shell, no secrets), and its output is passed on marked as outside content.
- A second agent after it does the sending. Set it to Privileged planner. It takes the reader's output as marked data and may reach the network. It never reads the request itself.
With the default Standard trust role on both, the second agent is marked too, and its send is refused in a webhook run.
An entry agent that runs on Codex, the Claude Agent SDK, Cursor or Antigravity is not held back this way on its own tools: that program runs them itself. Only its calls to Cerevisor's connected tools are checked. For a webhook workflow that sends things out, give the entry agent an Anthropic, OpenAI-compatible or Gemini model. Grok Build also works, as long as its permission setting is "Ask me during runs" or "Read only"; with "Approve everything automatically" Cerevisor does not check its actions.
Proving who sent it
Secret in the Authorization header. The sender adds Authorization: Bearer <secret>. Simple, and what most services can do.
Signed request. The sender never sends the secret. It signs each request instead, with this header:
X-Cerevisor-Signature: t=<unix seconds>,v1=<signature>
where <signature> is the hex HMAC-SHA256 of <t>.<body> with the secret as the key: the time, a full stop, then the body exactly as sent. A request whose time is more than 5 minutes away from this computer's clock is refused, so a captured request cannot be sent again later. The card's sample request signs this way:
BODY='{"hello":"world"}'
T=$(date +%s)
SIG=$(printf '%s' "$T.$BODY" | openssl dgst -sha256 -hmac '<secret>' | sed 's/^.* //')
curl -X POST "http://127.0.0.1:48634/hooks/<id>" -H "X-Cerevisor-Signature: t=$T,v1=$SIG" -H "Content-Type: application/json" -d "$BODY"
A signed request must carry its body as UTF-8 text.
What the sender is told
| Answer | When |
|---|---|
202 |
Taken: the run started, or the request is queued. |
400 |
The request did not arrive in full. |
401 |
No secret, a wrong secret, a wrong signature, or a signature older than 5 minutes. |
404 |
No webhook at that address, or that webhook is turned off while another one is on. |
405 |
Anything but POST. |
409 |
The workflow is running and the webhook is set to refuse. |
413 |
The body is larger than 256 KB. |
429 |
More than 60 requests in one minute, or 50 already waiting. |
500 |
Cerevisor could not save the request, for example because the workflow's file could not be opened or the disk is full. Nothing runs. |
503 |
Cerevisor could not start this run: your plan does not include it, or no Cerevisor window is open. The sender is never told why; a plan refusal shows on the webhook in the app. |
Every refusal is JSON with one error sentence. A request without the right secret is never counted against the 60 a minute.
When no webhook is turned on, nothing listens at all: the sender gets no answer (its connection is refused), not a 404.
Turning it off and removing it
Turn the webhook off in the Schedule window. Nothing listens at its address while it is off (senders get 404, or no answer at all when no other webhook is on), and its secret and its queue are kept for when you turn it back on with Turn on.
Remove this webhook deletes it with its secret and its waiting requests. Their files stay in inbox/ until the next run files them away.
Choosing another input type on the Workflow Input card does not turn the webhook off. To stop it, remove it on the card first, or turn it off in the Schedule window.
Tell a URL what happened
Add an address
Settings → Automation → Send to a URL holds the addresses every workflow sends to: the place for "tell my team chat whenever any workflow needs me". Settings → Workflow → This workflow sends to holds the ones for this workflow only. Those are saved in the workflow's file.
Addresses in "This workflow sends to" travel with the file. Copy Workflow and Export .cerevisor keep them, and so does the file itself when you send it to someone; only Share… leaves them out. For many services the address is the key to post there. The other way round, a .cerevisor file someone sends you can carry addresses that send your runs' updates to them. After you open one, check This workflow sends to on the Workflow tab before you run it.
Press Add and fill in:
| Field | What it is |
|---|---|
| Name | Your own name for it, for example Team chat. |
| Address | Starts with http:// or https://. A username or password in the address is refused: it would be saved as plain text. An http:// address that leaves this computer shows "This address is not encrypted. Anyone on the way can read what is sent." |
| Send when | One or more of the ten events below. |
| Signing secret | A Vault secret of type bearer-token or generic, or Not signed. App-wide secrets are offered everywhere; a workflow's own secrets are offered in its own list. |
The list shows each address by its start only (for example https://hooks.slack.com/…), because for many services the rest of the address is the key to post there. Show reveals it. Each row has an on/off switch, Send a test, Delivery log, Edit and Delete. An app-wide Delete can be undone for a few seconds.
Addresses go out exactly as you typed them: Cerevisor does not check where they point, so http://localhost:5678 for an n8n on this computer works. An agent never chooses one.
The ten events
| Event | Sent when |
|---|---|
run.started |
A run of the workflow started. |
run.completed |
A run finished and produced its results. |
run.failed |
A run ended with an error. |
run.stopped |
A run was stopped before it finished. |
run.needs_you |
An agent is waiting for your answer, approval or permission. |
run.answered |
A waiting question was answered. |
agent.completed |
One agent finished its work. |
file.produced |
An agent wrote one of its output files. |
budget.warning |
A run is close to its cost or turn limit. |
budget.exceeded |
A run reached its cost or turn limit and stopped. |
A chat with an agent card sends no run.started and no ending, the same as lifecycle hooks; what happens inside it is sent. What happens inside a Power is sent as part of the run that used it.
What is sent
Each message is one JSON envelope:
{
"id": "5b0f3c1e-8a2d-4f6b-9c1e-2d7a4e9b0c11",
"event": "run.needs_you",
"occurredAt": "2026-10-23T14:02:11.120Z",
"workflow": { "id": "wf-orders", "name": "Orders" },
"run": { "sessionId": "8c41d2e0-0f6a-4b3e-a9d7-51c3e8b2f6a0", "runId": "run_4fd8df77-2c1b-4e5a-9f60-0d3b8a7e1c25" },
"data": {
"runId": "8c41d2e0-0f6a-4b3e-a9d7-51c3e8b2f6a0",
"sessionId": "8c41d2e0-0f6a-4b3e-a9d7-51c3e8b2f6a0",
"raisedAt": 1792764131120,
"promptId": "e7a1b9c4-3d2f-4a6e-8b05-9c1d2e3f4a5b",
"kind": "permission",
"agentName": "Publisher",
"title": "Publisher needs permission",
"message": "web_fetch is a moderate action.",
"choices": ["Approve", "Deny"],
"actionClass": "consequential"
}
}
idis this message's own id. It stays the same across retries and a Resend, so a receiver can drop a message it already has.run.sessionIdis the run's id as the local API knows it (itsrunId).run.runIdis the id of the run's saved record.datadepends on the event:
| Event | data carries |
|---|---|
run.started |
totalAgents, totalWaves, startedBy (for example user, scheduler, webhook, local-api) |
run.completed, run.failed, run.stopped |
The same report a script gets from the local API: status, costUsd, overview, outputs and outputCount, plus outcome, durationMs, failedAgentCount, deliverables, deliverableCount, runReport, and error for a failed run |
run.needs_you |
The waiting question, as above: promptId, kind (permission, question, approval, plan or help), agentName, title, message, choices |
run.answered |
promptId, kind |
agent.completed |
agentId, agentName, costUsd, durationMs, toolCalls, outputs, outputCount |
file.produced |
agentName, path |
budget.warning |
currentCostUsd, limitCostUsd, currentTurns, limitTurns |
budget.exceeded |
reason, current, limit, scope |
What leaves your computer is kept small on purpose. Paths are relative to the workflow's folder, or a bare file name, never a full path on your computer. Text that looks like a key or a password is removed first, and long text is cut at 8 KB. Lists of files stop at 64 entries, with the full count beside them.
An agent's result files and written work are never sent. Some of its words are: run.needs_you carries the agent's question, its request for help or the plan it proposes (up to 8 KB, with full paths taken out), and a failed run carries its error text.
A run that finished but left something for you (Needs attention) is still a run.completed message, with status set to "completed". Its outcome is "completed_needs_attention", where a run with nothing left has "completed". A receiver that must tell the two apart reads outcome. The list of what is left is not sent.
Each request carries these headers: Content-Type: application/json, User-Agent: Cerevisor/<version>, X-Cerevisor-Event, X-Cerevisor-Delivery (the message id) and, when a signing secret is chosen, X-Cerevisor-Signature.
Check the signature
The signature uses the same scheme as a signed request coming in: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>">, with the Vault secret's value as the key. Check it over the body exactly as it arrived, before you parse it. Each try is signed again with its own time.
Node:
const crypto = require('node:crypto')
function verify(secret, rawBody, header) {
const m = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header || '')
if (!m) return false
const t = Number(m[1])
if (Math.abs(Date.now() / 1000 - t) > 300) return false
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex')
return crypto.timingSafeEqual(Buffer.from(expected, 'hex'), Buffer.from(m[2], 'hex'))
}
Python:
import hashlib, hmac, re, time
def verify(secret: str, raw_body: bytes, header: str) -> bool:
m = re.fullmatch(r"t=(\d+),v1=([0-9a-f]{64})", header or "")
if not m:
return False
t = int(m.group(1))
if abs(time.time() - t) > 300:
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, m.group(2))
A shell, with the time and the body you received in T and BODY:
printf '%s' "$T.$BODY" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //'
The output must equal the v1 part of the header.
Retries
Any 2xx answer settles a message. Anything else, no answer within 10 seconds, or an address that cannot be reached is tried again after 1 minute, then 5 minutes, then 30 minutes: four tries in all. A redirect is not followed; it counts as a failed try. When a signing secret is chosen and Cerevisor cannot read it (for example it was deleted from the Vault), nothing is sent: the try fails with "Not sent: the chosen Vault secret could not be read." and is retried like any other. A run never waits for its messages and never learns whether they arrived.
Before each retry, an app-wide address is read again as it stands now. If you removed it, turned it off, or took that event off its list, the remaining tries are cancelled. The same happens when your plan no longer includes sending to a URL.
Retries need Cerevisor open. A message still waiting when Cerevisor closes is not tried again; the next start marks it Gave up.
The delivery log
Delivery log on a row shows the latest 20 tries for that address: the event, Try 1, Try 2 and so on, when, Sending, Delivered, Will try again or Gave up, the status the address answered and, when it failed, why in a plain sentence. Cerevisor keeps the last 200 messages of each address in ~/.cerevisor/webhooks/deliveries/, and never what was in them.
Resend sends a delivered or given-up message once more, now. Cerevisor keeps what it sent in memory only, so Resend works while Cerevisor stays open and for recent messages. After a restart it says "This message is no longer available to resend. Cerevisor keeps a copy only until it closes, and only for recent messages."
Send a test
Send a test posts one sample run.started message to the address, marked "test": true, with workflow id test. It is tried once, never retried, and shows its result on the row (for example Delivered, 200). It goes in the delivery log like any other.
Answering from the other side
A run.needs_you message carries the same promptId that the local API uses. So a program that started a run through the local API (cerevisor run or the run_workflow tool) can be told by a webhook that the run is waiting, and answer it straight away:
cerevisor answer e7a1b9c4-3d2f-4a6e-8b05-9c1d2e3f4a5b approve
or with the answer_prompt tool. run.answered then tells every address that the question is closed, wherever it was answered.
The local API answers only questions from runs it started itself. A question from a run started by a webhook, a schedule or the Run button is answered in the app or on your paired phone; the message still tells you it is waiting.
An agent sending to an address itself
An agent's web_fetch tool can now send a body with POST, PUT, PATCH or DELETE. A body on GET or HEAD is not sent, and the agent is told so. Text is sent as written; anything else is sent as JSON with Content-Type: application/json unless the agent set its own.
Nothing about the rules moves: a writing request still counts as an action that needs your OK in Auto, the web access list and the private-address guard still apply, and an agent that read outside content is still asked first when you watch the run and refused when nobody does. The body is never written to the run's record, the permission log or the live run view; only its length is kept.
When a server answers with a redirect, every new address is checked the same way as the first. A request that writes, and its body, never go to a different site than the one the agent called: the agent is told where the server pointed, and can send again to that address, which is then checked like any other.
What your plan changes
On Free you can set up a webhook and see its address. A request is answered 503 and does not start a run, and the webhook shows "Webhooks are part of the Scheduler, which is a paid feature. Upgrade to resume."
On Free, Send to a URL shows an upgrade card. "Your addresses stay saved. Nothing is sent to them until your plan includes sending updates to a URL."
Sharing a workflow that uses webhooks
A shared workflow never carries a webhook address, a secret or an address it sends to. It carries only that it needs them: the receiver is told "This workflow is started by a webhook. Its address and secret were not included." and the names of the addresses it sent updates to. A name that contains part of its address travels as Untitled.
Only Share… leaves the addresses out. Copy Workflow, Export .cerevisor and the saved file itself keep the addresses in This workflow sends to; see Add an address.
Limits
- Cerevisor has to be open, with a window. While it is closed nothing listens, and a request reaches nothing; most services try again on their own. On a Mac, Cerevisor can stay open with every window closed: a request is then answered
503and not kept, and requests already waiting run once you open a window again. Updates are sent only by the open app: a run in the background with no window (a schedule set to run while Cerevisor is closed, or one thecerevisorcommand starts for you) sends none. - This computer only. Reaching the address from the internet is your tunnel's job, and its own security is yours to set.
- The port can change. If port 48634 is in use when Cerevisor opens the address, it takes another one and the card shows it. A tunnel set up for 48634 then needs the new port.
- The webhook follows the file. A webhook belongs to the saved file, like every schedule. If you move or rename the file, the webhook stops until you set it up again.
- Whole workflows only. A webhook never starts a single agent.
- The queue knows only the runs it started. A run you start with the Run button does not hold a webhook request back.
- What a search or a shell command prints is not marked. A delivery file opened with
read_filemarks the agent as having read outside content; a search across theinboxfolder, or a shell command that prints the file, does not. Give the agents that read the inbox the Quarantined reader trust role. - A
UserPromptSubmithook gets no instruction. It still fires for a webhook run, with an empty instruction, because the request is not something you wrote. - Waiting requests need your plan. If your plan stops including the Scheduler while requests wait, each one is skipped and taken off the queue when its turn comes, and the webhook says why.
- Running it again uses the saved input. Resuming or re-running a webhook run gives the entry agent the workflow's saved input, not the request.
- Retries and Resend end when Cerevisor closes. See Retries and The delivery log.
- A workflow's own list keeps its first form for retries. Before a retry, an app-wide address is read again; one in This workflow sends to is tried as it was when the message was first sent, even if you turned it off since.
- Questions inside a Power are sent under the run that used the Power.
- Some addresses carry their key in the host name. The list hides everything after the host name. For a service that gives each user a host name of their own, that name is on screen even while the rest is hidden.
- An agent's body is not secret from the agent. The body of a
web_fetchstays in the agent's own conversation, and a server that echoes it back puts it in the reply the agent reads.