Workflows guide
The Workflows API lets your systems start and steer workflows. Every endpoint is listed in the Workflows API reference. For a first run end to end, see the workflow quickstart.
Base URL: https://api.nuacem.dev/workflow-api
Every call needs a secret key (vcx_sk_) with no agent limit, in X-VoiceCX-Key. Call it from your server only. Each call reaches only the key’s workspace, and only live (published) workflows. Answers carry customer-safe fields: never the workflow’s steps, timeline or internal data.
Start a run
Section titled “Start a run”A workflow can be started by the API when it has an API / webhook trigger. See Starting runs for how to set that trigger up.
curl -X POST "https://api.nuacem.dev/workflow-api/public/v1/workflows/flw_xxxx/runs" \ -H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{"input": {"appointmentId": "A-1042", "phone": "+919800000000"}, "correlation": {"patientRef": "P-77"}}'const WF = 'https://api.nuacem.dev/workflow-api/public/v1';const headers = { 'X-VoiceCX-Key': process.env.NUACEMONE_SECRET_KEY, 'Content-Type': 'application/json' };
const res = await fetch(`${WF}/workflows/flw_xxxx/runs`, { method: 'POST', headers, body: JSON.stringify({ input: { appointmentId: 'A-1042' }, correlation: { patientRef: 'P-77' } }),});if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);const run = await res.json();import os
import httpx
WF = "https://api.nuacem.dev/workflow-api/public/v1"HEADERS = {"X-VoiceCX-Key": os.environ["NUACEMONE_SECRET_KEY"]}
r = httpx.post(f"{WF}/workflows/flw_xxxx/runs", headers=HEADERS, timeout=60, json={"input": {"appointmentId": "A-1042"}, "correlation": {"patientRef": "P-77"}})r.raise_for_status()run = r.json()| Field | Notes |
|---|---|
input |
The run’s input, checked against the input fields the trigger defines. Up to 64 KB of JSON. A value that does not fit answers 422 invalid_input. |
correlation |
Up to 20 keys with string, number or boolean values, such as {"patientRef": "P-77"}. Business events with a matching correlation can later wake this run. |
triggerId |
Only needed when the workflow has more than one API / webhook trigger. |
The answer (201):
{ "id": "run_xxxx", "workflowId": "flw_xxxx", "workflowName": "Appointment reminder", "version": 3, "status": "RUNNING", "result": null, "outcome": null, "statusCode": "", "statusLabel": "", "startedAt": "2026-11-23T09:15:02.311000+00:00", "endedAt": null, "output": null, "deduplicated": false}The trigger’s own settings apply:
- Duplicate key: when the trigger names an input field as its duplicate key, a second start with the same value returns the first run with
deduplicated: trueinstead of starting another. - Duplicate window: when set, a start with the same
correlationinside the window returns the recent run withdeduplicated: true. - Allowed keys: when the trigger lists API keys, other keys get
403 client_not_allowed. - Wait for completion: when the trigger waits for the run to finish, the answer comes when the run ends (or the trigger’s time limit passes) and
outputholds the End step’s output.
Read a run
Section titled “Read a run”curl "https://api.nuacem.dev/workflow-api/public/v1/runs/run_xxxx" \ -H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY"| Field | Meaning |
|---|---|
status |
RUNNING, COMPLETED, FAILED or CANCELLED. |
outcome |
The End step’s outcome, for example renewed, once the run completes. |
statusCode, statusLabel |
A progress code and a short text the workflow’s author wrote for customers with a Status update step. Safe to show to your users. |
startedAt, endedAt |
When the run started and ended. |
Rather than polling, subscribe to workflow webhooks.
Cancel a run
Section titled “Cancel a run”curl -X POST "https://api.nuacem.dev/workflow-api/public/v1/runs/run_xxxx/cancel" \ -H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY"For example, when the appointment a reminder run is waiting for is cancelled. The run stops shortly after; its status becomes CANCELLED. A run that has already finished answers 409 run_finished.
Send a business event
Section titled “Send a business event”A business event tells NuacemOne that something happened in your systems. One call does two things:
- It starts every live workflow in the workspace whose Business event trigger listens for this event name.
- It wakes running runs that wait for this event and whose correlation matches the
correlationyou send.
curl -X POST "https://api.nuacem.dev/workflow-api/public/v1/events" \ -H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{ "eventName": "doctor.cancelled", "eventId": "hosp-evt-981", "correlation": {"doctorId": "D-12"}, "data": {"doctorId": "D-12", "date": "2026-11-20"} }'| Field | Notes |
|---|---|
eventName |
Up to 120 letters, digits, _, ., : or -. |
eventId |
Your unique id for this event. Sending the same id again does nothing and answers duplicate: true, so retries are safe. Ids are remembered across your whole organisation, so make them unique across workspaces too. |
correlation |
Which waiting runs to wake. Without it, no running run is woken (it would reach every waiting customer). |
data |
The event’s data, up to 64 KB. Started runs get it as their input. |
The answer (202):
{ "duplicate": false, "started": ["run_xxxx"], "deduplicated": [], "woken": ["run_yyyy"], "refused": [] }started: new runs. One event starts at most 20 workflows.deduplicated: starts that matched a recent run (the trigger’s duplicate settings).woken: running runs that received the event.refused: workflows that could not start, each withworkflowIdand an errorcode.
Human tasks
Section titled “Human tasks”Approvals and manual steps create tasks. You can list them and decide them from your own system.
# Open tasks in the workspace (newest first, up to 200). Filter by runId and status (OPEN, DONE, EXPIRED).curl "https://api.nuacem.dev/workflow-api/public/v1/tasks?status=OPEN" \ -H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY"
# Decide onecurl -X POST "https://api.nuacem.dev/workflow-api/public/v1/tasks/tsk_xxxx/decide" \ -H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{"outcome": "approved", "note": "Checked in the hospital system"}'Each task has kind (approval, task or escalation), label, role, instructions, status, dueAt, form (fields to fill in) and outcomes (the allowed choices).
- An approval takes
approvedorrejected. A rejection needs anote. - Other tasks take one of their
outcomes, ordonewhen they list none. - If the task has a form, send its answers in
data. Missing or wrong answers give422 invalid_input. - An approval that needs more than one approver stays
OPENuntil enough have approved. - If maker-checker is on, the key that started the run cannot approve it (
403 maker_cannot_approve). Decide with a different key, or in the console. - A task decided by someone else or expired answers
409 task_closed.
Only tasks of live runs are listed; test runs from the console never appear.
Signed hooks (start a run without an API key)
Section titled “Signed hooks (start a run without an API key)”Some systems can send a webhook but cannot hold an API key. They can start a run at a signed hook URL instead:
POST https://api.nuacem.dev/workflow-api/public/v1/hooks/{orgId}/{workspaceId}/workflows/{workflowId}Copy the URL from the console (Settings → Developers → Signed workflow hooks), where you also create the workspace’s inbound secret. The body is the same as starting a run: input, correlation and triggerId.
Each call is signed with two headers:
| Header | Value |
|---|---|
X-VoiceCX-Timestamp |
The current Unix time in seconds, as a whole number. |
X-VoiceCX-Signature |
v1= followed by the hex HMAC-SHA256 of <timestamp>.<raw body>, keyed with the inbound secret. |
Sign the exact bytes you send. If you re-serialise the JSON after signing, the signature will not match.
const crypto = require('node:crypto');
function signHook(secret, body, timestamp = Math.floor(Date.now() / 1000)) { const signature = 'v1=' + crypto.createHmac('sha256', secret).update(`${timestamp}.${body}`).digest('hex'); return { 'Content-Type': 'application/json', 'X-VoiceCX-Timestamp': String(timestamp), 'X-VoiceCX-Signature': signature };}
const body = JSON.stringify({ input: { appointmentId: 'A-1042' } });const res = await fetch(hookUrl, { method: 'POST', body, headers: signHook(process.env.NUACEMONE_INBOUND_SECRET, body) });import hashlibimport hmacimport jsonimport osimport time
import httpx
def sign_hook(secret: str, body: bytes, timestamp: int | None = None) -> dict[str, str]: ts = int(time.time()) if timestamp is None else timestamp signature = "v1=" + hmac.new(secret.encode(), f"{ts}.".encode() + body, hashlib.sha256).hexdigest() return {"Content-Type": "application/json", "X-VoiceCX-Timestamp": str(ts), "X-VoiceCX-Signature": signature}
body = json.dumps({"input": {"appointmentId": "A-1042"}}).encode()r = httpx.post(hook_url, content=body, headers=sign_hook(os.environ["NUACEMONE_INBOUND_SECRET"], body), timeout=60)The hook refuses:
- a missing or wrong signature:
401 invalid_signature; - a timestamp more than 5 minutes from the server’s clock:
401 stale_signature(check your server’s clock); - the same signed request a second time:
409 replayed. Sign each request afresh, including retries; - a body over 64 KB:
413 payload_too_large.
Outbound calls through a workflow
Section titled “Outbound calls through a workflow”There is no endpoint that places a phone call directly. To call a customer from your systems, build a workflow with an API / webhook trigger and an Outbound call step, then start a run with the number in its input:
curl -X POST "https://api.nuacem.dev/workflow-api/public/v1/workflows/flw_xxxx/runs" \ -H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{"input": {"phone": "+919800000000", "policyNo": "POL-2231"}, "correlation": {"policyNo": "POL-2231"}}'In the workflow, the Outbound call step dials the input’s phone number (for example input.phone) with the agent you choose. The step’s outcomes (completed, no_answer, busy, voicemail) lead to the next steps, so the workflow can retry, send a message or end. Follow the run with GET /runs/{runId} or a webhook.
Outbound calling needs a phone carrier and outgoing calls set up for your organisation. Ask your NuacemOne contact if the step is not available in your console.