Webhooks
Start a workflow from any system that can send an HTTP POST. Create the endpoints from the webhook trigger, choose test or prod mode, send JSON, wait for the result or run asynchronously and follow the progress over Server-Sent Events.
A webhook is the simplest way to put a workflow behind another system: the system sends a POST, Sommatic AI runs the
workflow with that request as input and answers with the result, or with a run id you can follow.
Create the endpoints
- Add
webhook.trigger(Webhook Receiver) as the first node of the workflow. - Open it and click Create webhook endpoint in the Webhook URL section.
- Sommatic AI creates two ingress bindings for the workflow, one marked TEST and one marked PROD, and shows
their URLs with a ready-to-copy
curlcommand.
The last segment of the URL identifies the binding. It starts as an identifier generated for the workflow, and you can change it to a readable slug from the same section.
The URL
| Segment | Values |
|---|---|
mode | test runs the draft. prod runs the default published version. |
bindingIdentifier | The binding’s id or its slug. Sommatic AI looks for the id first, then the slug. |
The request
Send any JSON body (up to 5 MB). The workflow receives the whole request as its input:
| Field | Content |
|---|---|
body | The JSON you sent. |
headers | The request headers, with lowercase names. |
query | The query string parameters. |
method | POST. |
Downstream nodes read it with expressions:
{{ $json.body.data.order_id }} // in the node right after the trigger
{{ $('Webhook Receiver').item.json.body.data.order_id }} // from any later node
{{ $('Webhook Receiver').item.json.headers['x-request-id'] }}Call it
curl -X POST "https://api.sommatic.ai/workflow-orchestration/trigger/webhooks/prod/order-intake" \
-H "Content-Type: application/json" \
-d '{
"event": "order.received",
"data": { "order_id": "ord_abc123", "total": 129.99, "currency": "USD" }
}'const response = await fetch(
'https://api.sommatic.ai/workflow-orchestration/trigger/webhooks/prod/order-intake',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
event: 'order.received',
data: { order_id: 'ord_abc123', total: 129.99, currency: 'USD' },
}),
},
);
const { success, result } = await response.json();Sync and async
By default the call is synchronous: it waits until the run ends and returns the instance, the steps and the result.
{
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"instance": { "id": "wf-flow-instance-…", "status": "completed" },
"steps": [
{ "nodeId": "…", "operatorSlug": "webhook.trigger", "status": "success", "port": "out", "durationMs": 2 }
],
"result": {
"outcome_category": "success",
"duration_ms": 1840,
"final_output_envelope": { "node_id": "…", "port": "out", "payload": {} }
}
}
}For long workflows, ask for async with execution_mode=async, in the query string or in the body. The call
returns at once with the run id:
curl -X POST "https://api.sommatic.ai/workflow-orchestration/trigger/webhooks/prod/order-intake?execution_mode=async" \
-H "Content-Type: application/json" \
-d '{ "event": "report.generate", "data": { "period": "2026-04" } }'{
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"instance": { "id": "wf-flow-instance-…", "status": "running" },
"execution_mode": "async"
}
}Then follow the run over SSE, or read it later from the
Execution API (flow-instance and flow-instance-result).
Follow progress over SSE
Open a Server-Sent Events stream for the workflow:
curl -N "https://api.sommatic.ai/workflow-orchestration/execution/stream?flow_definition_id=<flow-definition-id>&user_identity=<your-identity>"Both parameters are required. Runs started by webhooks are broadcast to every stream open on that workflow. The events are:
| Event | When |
|---|---|
connected | The stream is open. |
webhook-received | A webhook call reached the workflow. |
node-step-started | A node started. |
node-step-progress | A long-running node reported progress. |
node-step-completed | A node finished, with its port, duration and output (status is failed when it left through error). |
execution-completed | The run finished; its status is completed or failed. |
execution-failed | The run broke before the engine could finish it (for example, the orchestrator could not be reached). |
Paused workflows
You can pause a workflow per mode (see Publishing). A test call to a paused workflow is
rejected with status 423 and creates no run. A prod call is accepted and creates a run with status paused, so the
call is kept on record.
Errors
| Message | Cause |
|---|---|
Invalid webhook mode. Use "test" or "prod" | The mode segment is not test or prod. |
Webhook binding not found | No binding has that id or slug. |
No flow definition bound to this webhook | The binding does not point to a workflow. |
No published version found for this workflow | prod call and the workflow was never published. |