On this page
Sommatic Docs
Open portal

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.

View as Markdown
Open in

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

  1. Add webhook.trigger (Webhook Receiver) as the first node of the workflow.
  2. Open it and click Create webhook endpoint in the Webhook URL section.
  3. 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 curl command.

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

POST https://api.sommatic.ai/workflow-orchestration/trigger/webhooks/:mode/:bindingIdentifier
SegmentValues
modetest runs the draft. prod runs the default published version.
bindingIdentifierThe 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:

FieldContent
bodyThe JSON you sent.
headersThe request headers, with lowercase names.
queryThe query string parameters.
methodPOST.

Downstream nodes read it with expressions:

JavaScript
{{ $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

Shell
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" }
  }'
JavaScript
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.

JSON
{
  "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:

Shell
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" } }'
JSON
{
  "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:

Shell
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:

EventWhen
connectedThe stream is open.
webhook-receivedA webhook call reached the workflow.
node-step-startedA node started.
node-step-progressA long-running node reported progress.
node-step-completedA node finished, with its port, duration and output (status is failed when it left through error).
execution-completedThe run finished; its status is completed or failed.
execution-failedThe 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

MessageCause
Invalid webhook mode. Use "test" or "prod"The mode segment is not test or prod.
Webhook binding not foundNo binding has that id or slug.
No flow definition bound to this webhookThe binding does not point to a workflow.
No published version found for this workflowprod call and the workflow was never published.

Next steps

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs