Skip to main content
POST
/
workflows
/
{id}
/
nodes
Add a node to a workflow
curl --request POST \
  --url https://api.dialnexa.com/v1/workflows/{id}/nodes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "node_type": "VOICE_CALL",
  "label": "Initial Outreach Call",
  "position_x": 100,
  "position_y": 200,
  "config": {
    "agent_id": "agt_abc123",
    "from_phone_number": "+912234567890"
  }
}
'
{
  "id": "node_abc",
  "workflow_id": "wf_abc123",
  "node_type": "VOICE_CALL",
  "label": "Initial Outreach Call",
  "position_x": 100,
  "position_y": 200,
  "config": {
    "agent_id": "agt_abc123",
    "from_phone_number": "+912234567890"
  }
}
Adds a node to a workflow. Each node is one step in the sequence. After creating your nodes, connect them with edges to define how leads transition between steps.

Node types

node_typeWhat it does
VOICE_CALLPlaces an outbound call to the lead using the specified agent.
TIMEWaits for a configured duration before moving to the next step.
CONDITIONALBranches the workflow based on a condition (e.g., call outcome).
APPLICATIONTriggers an external action (e.g., a webhook or CRM update).
CONVERTEDTerminal node that marks the lead as successfully converted.
DROPPEDTerminal node that marks the lead as dropped from the sequence.

VOICE_CALL config example

{
  "node_type": "VOICE_CALL",
  "label": "First Outreach Call",
  "position_x": 100,
  "position_y": 100,
  "config": {
    "agent_id": "agt_abc123",
    "from_phone_number": "+912234567890"
  }
}

TIME delay config example

{
  "node_type": "TIME",
  "label": "Wait 2 Days",
  "config": {
    "delay_hours": 48
  }
}

CONDITIONAL config example

{
  "node_type": "CONDITIONAL",
  "label": "Check Call Outcome",
  "config": {
    "condition_field": "call_status",
    "branches": ["COMPLETED", "FAILED", "NO_ANSWER"]
  }
}
After creating a conditional node, add one edge per branch (labeled COMPLETED, FAILED, etc.) leading to the appropriate next node.

Request

curl "https://api.dialnexa.com/v1/workflows/wfl_m3v7zb9rk2px/nodes" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

Response

{
  "id": "node_v8p3kz1mq7ry",
  "workflow_id": "wfl_m3v7zb9rk2px",
  "node_type": "VOICE_CALL",
  "label": "First Outreach Call",
  "position_x": 100,
  "position_y": 100,
  "config": {
    "agent_id": "agt_k7m2nq9xw4p8",
    "from_phone_number": "+912234567890"
  },
  "created_at": "2024-04-01T08:05:00.000Z"
}

Authorizations

Authorization
string
header
required

Pass your API key as a Bearer token in the Authorization header.

Path Parameters

id
string
required

Workflow ID.

Body

application/json
node_type
enum<string>
required

The type of step this node represents.

Available options:
VOICE_CALL,
CONDITIONAL,
TIME,
APPLICATION,
CONVERTED,
DROPPED
Example:

"VOICE_CALL"

label
string
required
Example:

"Initial Outreach Call"

position_x
number
Example:

100

position_y
number
Example:

200

config
object

Configuration for the node type. For VOICE_CALL, include agent_id.

Example:
{
"agent_id": "agt_abc123",
"from_phone_number": "+912234567890"
}

Response

201 - application/json

Created.

id
string
Example:

"node_abc"

workflow_id
string
Example:

"wf_abc123"

node_type
string
Example:

"VOICE_CALL"

label
string
Example:

"Initial Outreach Call"

position_x
number
Example:

100

position_y
number
Example:

200

config
object
Example:
{
"agent_id": "agt_abc123",
"from_phone_number": "+912234567890"
}