Starting runs
A run starts at a trigger step. A workflow can have more than one trigger, for example one for an agent and one for your API, so the same steps serve both.
Only the live (published) version of a workflow starts from outside the console. Drafts run only in the test window.
| Trigger | Started by |
|---|---|
| Channel inbound (beta) | A customer on a channel; test window only for now |
| API / webhook | Your server, with a secret key or a signed request |
| Business event | An event your system sends |
| Schedule | The clock |
| Started by an agent | An agent, during a conversation |
Channel inbound
Section titled “Channel inbound”The Channel inbound trigger describes a workflow that begins with a customer on voice, WhatsApp, web chat or another channel. It is followed by agent steps that hold the conversation, for example a front desk agent that hands over to a specialist.
- Number or entry point is the phone number, WhatsApp sender or chat widget. Left empty, it is bound when you deploy.
- Language sets the conversation language. Empty uses the agent’s own.
- Business hours, when set, gives the run
trigger.withinHours(trueorfalse), so a Condition can route out-of-hours contacts.
For live traffic today, customers reach the use case’s entry agent, and the agent starts workflows with a Started by an agent trigger.
API / webhook
Section titled “API / webhook”The API / webhook trigger lets your systems start a run.
curl -X POST "https://api.nuacem.dev/workflow-api/public/v1/workflows/WORKFLOW_ID/runs" \ -H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY" -H "Content-Type: application/json" \ -d '{"input": {"customerRef": "C-1001", "amount": 1250.5}, "correlation": {"customerRef": "C-1001"}}'- Use a workspace secret key (
vcx_sk_…). Publishable keys are refused, and so are keys limited to particular agents. inputmust match the trigger’s Input fields. A bad payload is refused with422 invalid_input.correlationis optional. It links the run to a customer or case so later events can find it (see Correlation).- Allowed API clients can limit which keys may start this workflow, by key id (
key_…). Empty allows any secret key of the workspace. - Respond: Immediately returns the run id at once; read the status later or receive a webhook. On completion holds the call until the run ends or the response timeout passes, and returns the outcome and the End step’s output.
- A workflow without an API / webhook trigger returns
409 no_api_trigger.
Read a run with GET /runs/{runId} and stop it with POST /runs/{runId}/cancel. You see a customer-safe view only: status, outcome and the status label. See the Workflows API guide and the Node and Python SDKs.
The workflow’s Deploy button, in the builder toolbar, shows ready-made requests for its triggers, with an example input built from its input fields.
Signed webhook
Section titled “Signed webhook”Some systems cannot send an API key. They can call a signed URL instead:
POST https://api.nuacem.dev/workflow-api/public/v1/hooks/{orgId}/{workspaceId}/workflows/{workflowId}The body is the same as for the API. Sign each request with the workspace’s inbound secret (Settings → Developers → Signed workflow hooks):
X-VoiceCX-Timestamp: the current Unix time in seconds;X-VoiceCX-Signature:v1=followed by the hex HMAC-SHA256 of"<timestamp>.<raw body>"with the secret.
Requests older than five minutes are refused, and each signature is accepted only once (409 replayed). The same trigger rules as the API then apply. See Verifying signatures for the signing scheme.
Business event
Section titled “Business event”The Business event trigger starts a run when your system sends an event with that name, such as payment.failed.
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": "payment.failed", "eventId": "pay-evt-20931", "correlation": {"customerRef": "C-1001"}, "data": {"customerRef": "C-1001", "amount": 4999, "phone": "+919800000000"}}'One event does two things:
- It starts every live workflow in the workspace whose Business event trigger names the event.
- It wakes running runs that wait for this event with a Wait for event step and whose correlation matches the event’s
correlation.
An event with no correlation starts workflows but never wakes running ones, so it cannot reach every waiting customer at once.
The trigger’s settings:
- Correlation keys: fields in the event’s
datathat identify the customer or case, such ascustomerRef. They become the new run’s correlation. - Only when: an expression; when it is false, the run ends at once with the outcome
filtered. Example:input.amount > 1000. - Map event fields: stores values from the event (
input) under names the workflow uses (data). - Ignore repeats for: a second event with the same correlation within this time returns the existing run instead of starting another.
eventId is your own unique id for the event. Sending the same eventId again does nothing, so you can retry safely. The response tells you which runs were started and which were woken.
When a run is waiting, put the correlation values in the event’s data as well as in correlation: the Wait for event step checks its correlation keys against data.
Schedule
Section titled “Schedule”The Schedule trigger starts runs on a five-field cron schedule, such as 0 10 * * 1-5 for 10:00 on weekdays.
- The schedule uses the trigger’s time zone, or the workflow’s.
- First day, Last day and Skip these days (holidays as
YYYY-MM-DD) are honoured. - Every scheduled run gets
input.scheduledFor, the time it was due. - After a period when runs could not start, only the latest missed time within the last hour runs.
With Who it runs for set to MCP tool, a tool returns the list of customers (for example, policies expiring in 30 days). You choose One per item, where each item becomes a run’s input (up to 500 items), or One for all, where the whole list arrives as input.items.
Publishing a workflow with a Schedule trigger turns the schedule on. Removing the trigger and publishing, or deleting the workflow, turns it off.
Started by an agent
Section titled “Started by an agent”The Started by an agent trigger lets an agent start the workflow during a conversation.
Each published workflow with this trigger becomes a tool for the agents it allows (Agents that may start it; empty allows any agent in the workspace). The tool’s arguments are the trigger’s Input fields, and its description comes from the workflow’s name and description and the trigger’s label. Write these so the model knows when to use it, for example “Book the appointment once the patient has confirmed the doctor and time.”
Tell the agent in its instructions when to start the workflow. The agent fills the input fields from the conversation. If a required field is missing, the agent is told which, so it can ask the customer.
The agent setting decides what the agent gets back:
- Immediately: the agent gets the run id and carries on.
- On completion: the agent waits for the outcome, the status label and the End step’s output, up to the response timeout (default 20 seconds). Keep this short; the customer is waiting.
Runs an agent starts are linked to the conversation (correlation conversationId), so you can follow them from the customer’s journey. They are not linked to your own ids. If your systems must later send events to these runs, have your system start the run through the API with its own correlation instead.
An agent in the test window starts test runs, never live ones.
Correlation
Section titled “Correlation”A run’s correlation is a small set of key-value pairs that identify who or what the run is about, such as {"customerRef": "C-1001"} or {"appointmentId": "APT-1042"}.
Correlation is used to:
- wake waiting runs when an event arrives;
- choose whose shared context Read context and Write context use (
customerRef,caseRef,conversationId); - link runs to a customer’s journey;
- ignore repeated business events within a time window.
Set it when the run starts: correlation in the API body, or Correlation keys on a Business event trigger.
Duplicate requests
Section titled “Duplicate requests”Networks retry. NuacemOne gives you three ways to make a retry safe:
| Where | Setting | Effect |
|---|---|---|
| API / webhook trigger | Duplicate key: the name of an input field, such as requestId |
A second request with the same value returns the first run (deduplicated: true) instead of starting another. |
| Events | eventId |
The same eventId is processed once. |
| Business event trigger | Ignore repeats for | An event with the same correlation within the window returns the existing run. |
Use a value that is unique per piece of work, such as your order id, not per HTTP attempt.