Skip to main content
POST
/
workflows
/
{id}
/
edges
Add an edge to a workflow
curl --request POST \
  --url https://api.dialnexa.com/v1/workflows/{id}/edges \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from_node_id": "node_abc",
  "to_node_id": "node_xyz",
  "label": "COMPLETED"
}
'
{
  "id": "edge_abc",
  "workflow_id": "wf_abc123",
  "from_node_id": "node_abc",
  "to_node_id": "node_xyz",
  "label": "COMPLETED"
}
Creates a directed edge between two nodes in a workflow. Edges encode the “what happens next” decision: after a lead finishes the step at from_node_id, the workflow checks each outgoing edge in order, picks the first edge whose label matches the outcome, and moves the lead to to_node_id. Unlabelled edges always match, they are the default next step for sequential flows. Labelled edges are required for CONDITIONAL nodes and recommended for any node where the outcome can branch.

When to use this

  • Building a new workflow: connect freshly created nodes into a graph after using Create Node.
  • Adding a branch: split a sequential workflow into multiple outcome-based paths.
  • Rewiring a workflow: after deleting an obsolete edge, create the replacement transition.
If you are editing a workflow that is currently active, be aware that edge changes take effect on the next scheduling tick. In-flight leads already past from_node_id are not affected.

Basic transition

For simple linear workflows, create one edge from each node to the next:
{
  "from_node_id": "node_call_1",
  "to_node_id": "node_wait_2days"
}

Conditional transitions

For CONDITIONAL nodes, create one edge per branch and set the label to match the branch name:
{
  "from_node_id": "node_check_outcome",
  "to_node_id": "node_second_call",
  "label": "FAILED"
}
{
  "from_node_id": "node_check_outcome",
  "to_node_id": "node_converted",
  "label": "COMPLETED"
}
Common label values for call-outcome branches are COMPLETED, FAILED, NO_ANSWER, and BUSY. For boolean conditions, use true and false. Custom values are accepted, but they must match what your CONDITIONAL node emits.

Path parameters

ParameterDescription
idThe workflow ID, for example wfl_m3v7zb9rk2px.

Errors

  • 404 Not Found is returned when either node does not exist or does not belong to this workflow.
  • 409 Conflict is returned when an edge with the same from_node_id, to_node_id, and label already exists.

Request

curl "https://api.dialnexa.com/v1/workflows/wfl_m3v7zb9rk2px/edges" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from_node_id": "node_v8p3kz1mq7ry", "to_node_id": "node_t2n6bw4pq9rz"}'

Response

{
  "id": "edge_h4q8zn2vr6bx",
  "workflow_id": "wfl_m3v7zb9rk2px",
  "from_node_id": "node_v8p3kz1mq7ry",
  "to_node_id": "node_t2n6bw4pq9rz",
  "label": null,
  "created_at": "2024-04-01T08:10:00.000Z"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Body

application/json
from_node_id
string
required

ID of the source node.

Example:

"node_abc"

to_node_id
string
required

ID of the destination node.

Example:

"node_xyz"

label
string

Condition label for this transition, used by conditional nodes.

Example:

"COMPLETED"

Response

201 - application/json

Created.

id
string
Example:

"edge_abc"

workflow_id
string
Example:

"wf_abc123"

from_node_id
string
Example:

"node_abc"

to_node_id
string
Example:

"node_xyz"

label
string | null
Example:

"COMPLETED"