Skip to content

Quickstart: start a workflow

  • A published workflow whose trigger is API / webhook. See Starting runs.
  • A secret key (vcx_sk_…). See API keys. Keep it on your server.

In the console, open Workflows → New workflow and add:

  1. API / webhook trigger with one input field, appointmentId (text, required).
  2. Wait for one minute, so you can watch the run while it waits.
  3. End with the outcome confirmed.

Publish it. The workflow’s Deploy drawer shows its id (flw_…) and a ready-made request body.

Terminal window
curl -X POST "https://api.nuacem.dev/workflow-api/public/v1/workflows/flw_xxxxxxxx/runs" \
-H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"input": {"appointmentId": "A-1042"}, "correlation": {"patientRef": "P-77"}}'

The answer carries the run’s id. The same call with the Node SDK:

const NuacemOne = require('./nuacemone.js');
const client = NuacemOne.client({
key: process.env.NUACEMONE_SECRET_KEY,
gateway: 'https://api.nuacem.dev/voice-gw',
workflows: 'https://api.nuacem.dev/workflow-api',
});
const run = await client.workflows.start('flw_xxxxxxxx', { input: { appointmentId: 'A-1042' } });
Terminal window
curl "https://api.nuacem.dev/workflow-api/public/v1/runs/RUN_ID" \
-H "X-VoiceCX-Key: $NUACEMONE_SECRET_KEY"

Rather than polling, add an endpoint in Settings → Developers → Workflow webhooks. NuacemOne posts run.completed, run.failed and other events to it, signed so you can check they came from us. See Workflow events.