> ## Documentation Index
> Fetch the complete documentation index at: https://dialnexa.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Edge

> Connect two workflow nodes with a directed transition, optionally labelled for conditional branches.

<Warning>
  **Legacy endpoint - deprecated.** Unversioned endpoints are scheduled for removal on **July 31, 2026**. A public v1 replacement is not currently listed in the v1 reference. This endpoint remains available for existing integrations until then.
</Warning>

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](/docs/api-reference/workflow-nodes/create).
* **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:

```json theme={null}
{
  "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:

```json theme={null}
{
  "from_node_id": "node_check_outcome",
  "to_node_id": "node_second_call",
  "label": "FAILED"
}
```

```json theme={null}
{
  "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

| Parameter | Description                                      |
| --------- | ------------------------------------------------ |
| `id`      | The 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.

## Related endpoints

* [List Edges](/docs/api-reference/workflow-edges/list): fetch all transitions in a workflow.
* [Delete Edge](/docs/api-reference/workflow-edges/delete): remove a transition.
* [Create Node](/docs/api-reference/workflow-nodes/create): add a node before connecting it.
* [List Nodes](/docs/api-reference/workflow-nodes/list): confirm node IDs before creating an edge.


## OpenAPI

````yaml POST /workflows/{id}/edges
openapi: 3.0.0
info:
  title: DialNexa API
  description: >-
    Public REST API for the DialNexa voice AI platform. Versioned endpoints are
    under /v1; unversioned endpoints are legacy and deprecated.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: API Keys
  - name: Agent Functions
  - name: Agents V1
  - name: Agents2
  - name: Batch Calls
  - name: Batch Calls V1
  - name: Call Logs
  - name: Calls
  - name: Calls V1
  - name: Campaign Leads
  - name: Campaigns
  - name: External Webhooks
  - name: Knowledge Base
  - name: Knowledge Base V1
  - name: LLMs
  - name: LLMs V1
  - name: Languages
  - name: Languages V1
  - name: Organization Phone Numbers
  - name: Organization Phone Numbers V1
  - name: Phone Number Pricing
  - name: Phone Number Pricing V1
  - name: Transcribers
  - name: Transcribers V1
  - name: User Webhooks
  - name: User Webhooks V1
  - name: V1
  - name: Voices
  - name: Voices V1
  - name: Webcall
  - name: Workflow Leads
  - name: Workflow Leads V1
  - name: Workflows
  - name: Workflows V1
paths:
  /workflows/{id}/edges:
    post:
      tags:
        - Workflows
      summary: Create an edge in a workflow
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 
      operationId: WorkflowsController_createEdge
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEdgeDto'
      responses:
        '201':
          description: Edge created successfully
      deprecated: true
components:
  schemas:
    CreateEdgeDto:
      type: object
      properties:
        from_node_id:
          type: string
          description: ID of the source node
          example: node_abc123
        to_node_id:
          type: string
          description: ID of the target node
          example: node_xyz789
        label:
          type: string
          description: Label for the edge (e.g., "FAILED", "COMPLETED", "true", "false")
          example: COMPLETED
          maxLength: 50
      required:
        - from_node_id
        - to_node_id
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````