Workflows and webhooks
Automations as a graph of nodes, from draft to running, their runs, and webhook endpoints with signed requests.
A workflow is a trigger and the steps it leads to. The trigger can be a form being sent, a contact being added, a payment, a page being published, a collection entry changing, a webhook call, a schedule, or a Run button. The API can do everything the Automate workspace in the dashboard does.
Reading needs workflows:read; creating, changing, publishing, testing, running and deleting needs workflows:write. Publishing, turning a workflow on or off, deleting it and rotating its webhook secret are for owners and admins.
The graph
{
"nodes": [
{ "id": "trigger", "type": "trigger.form", "config": { "form": "contact" } },
{ "id": "add", "type": "people.upsert", "config": { "email": "{{trigger.contact.email}}", "tags": "website" } }
],
"edges": [{ "from": "trigger", "port": "next", "to": "add" }]
}nodes: up to 100.idis lowercase letters, digits and_, starting with a letter.typecomes from the node catalog, andconfigholds its fields.edges: up to 300.portis one of the source node's ports:nextfor most nodes,trueorfalseafterlogic.if,passafterlogic.filter.- Exactly one trigger, nothing leading into it, and no loops.
- Text fields are templates.
{{trigger.contact.email}}reads the trigger's output,{{steps.<id>.…}}an earlier step's, and{{site.name}}the site. Conditions are data, never code: nothing is ever evaluated.
The node catalog
GET /workflow-nodes lists every node with its fields (key, kind, whether it is required, options) and outputs, the paths later steps can read. Write graphs against it.
| Kind | Types |
|---|---|
| Triggers | trigger.form, trigger.contact, trigger.payment, trigger.page, trigger.entry, trigger.webhook, trigger.schedule, trigger.manual |
| Logic | logic.if, logic.filter, logic.wait |
| People | people.upsert, people.stage, people.note |
| Data | data.create, data.update, data.find, data.http |
| Messages | message.email, message.whatsapp, message.slack |
| AI | ai.sort, ai.summarise, ai.draft |
| Respond | respond.json (webhook workflows only) |
From draft to running
- Create.
POST /sites/{siteId}/workflowswith{ name, draft }, or{ templateId }to start from a template.GET …/workflow-templateslists them:new-enquiry,new-booking,weekly-digestandpayment-slack. - Test.
POST …/workflows/{workflowId}/testruns the draft once with thetriggerpayload you send, or the trigger's sample. It answers{ runId }. Problems that would stop the graph running come back as400withdetails.problems. - Publish.
POST …/workflows/{workflowId}/publishmakes the draft the graph that runs. The first publish turns the workflow on. A webhook workflow with secret access gets its signing secret inhookSecret, once. - On and off.
PATCH …/workflows/{workflowId}with{ "enabled": false }ortrue. Only a published workflow can be on. Changingdraftdoesn't change what runs until you publish again, so editing never breaks a live workflow. - Run it yourself.
POST …/workflows/{workflowId}/runwith{ "input": { … } }runs the published graph now, as its Run button does. A graph without a wait answers{ runId, status, output }; one with a wait answers{ runId, status: "queued" }and carries on in the background.
Runs
Every run keeps the frozen graph, the trigger payload and each step's input, output and error.
GET /sites/{siteId}/runslists recent runs of every workflow. Filter withworkflowandstatus(queued,running,waiting,succeeded,failed,cancelled).GET …/workflows/{workflowId}/runslists one workflow's runs.GET /sites/{siteId}/runs/{runId}shows one run with each step.
Webhooks
A published, enabled workflow whose trigger is trigger.webhook answers at /api/hooks/<name> on the site's own address, for any method. name is the trigger's name field:
https://harbour-bakery.unvop.dev/api/hooks/new-bookingWho may call it
The trigger's access field decides:
access | The caller sends |
|---|---|
secret (the default) | X-Unvop-Signature: sha256=<hex>, the HMAC-SHA256 of the raw body with the workflow's signing secret |
key | Authorization: Bearer <key>: a site key of this site, or a platform key. Account keys aren't accepted here. |
public | Nothing. Anyone may call it. |
Sign a request
Sign the exact bytes you send. Serialise the body once and sign that string:
import { createHmac } from 'node:crypto';
const body = JSON.stringify({ name: 'Sam Rivera', date: '2026-12-04' });
const signature = 'sha256=' + createHmac('sha256', process.env.UNVOP_HOOK_SECRET).update(body).digest('hex');
await fetch('https://harbour-bakery.unvop.dev/api/hooks/new-booking', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Unvop-Signature': signature },
body,
});import hashlib, hmac, json, os, requests
body = json.dumps({"name": "Sam Rivera", "date": "2026-12-04"})
digest = hmac.new(os.environ["UNVOP_HOOK_SECRET"].encode(), body.encode(), hashlib.sha256).hexdigest()
requests.post(
"https://harbour-bakery.unvop.dev/api/hooks/new-booking",
data=body,
headers={"Content-Type": "application/json", "X-Unvop-Signature": f"sha256={digest}"},
)BODY='{"name":"Sam Rivera","date":"2026-12-04"}'
SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$UNVOP_HOOK_SECRET" | sed 's/^.* //')
curl https://harbour-bakery.unvop.dev/api/hooks/new-booking \
-H "Content-Type: application/json" \
-H "X-Unvop-Signature: sha256=$SIG" \
-d "$BODY"Rotate the secret with POST …/workflows/{workflowId}/hook-secret. The old one stops working at once and the new one is shown once.
What the workflow sees
trigger.body (JSON, form-encoded fields, or text), trigger.query, trigger.headers and trigger.method. Headers never include Authorization, cookies, the signature or Cloudflare's own headers.
What the caller gets back
- A graph without a wait runs while the caller waits. With a
respond.jsonstep, the answer is that step's status and body; without one,200 { "ok": true }. - A graph with a wait, or a run still going after 25 seconds, answers
202 { "runId": "…" }and carries on. - A failed run answers
502 { error, code: "failed" }, or503 { error, code: "not_configured" }when a connection it calls has no key yet or its key was refused. Signed and keyed callers also get therunId; a public caller never does.
Limits
Bodies up to 64 KB (413 above that). 60 calls a minute per endpoint; a public endpoint also takes 10 a minute from one address and 300 an hour in all. Over a limit the answer is 429 { error, code: "rate_limited", retryAfter } with Retry-After.
To put a webhook workflow in front of visitors without writing any code, use the Action form.