> ## 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.

# Create Workflow

> Create a multi-step calling workflow with conditional logic.

<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>

A workflow is a sequence of steps (nodes) connected by transitions (edges) that a lead moves through over time. Each node can be a voice call, a time delay, a conditional branch, or an application action. The outcome of each step determines which path the lead takes next.

## When to use workflows

Workflows are ideal for:

* **Lead nurture sequences:** Call a lead, wait 2 days, call again if no answer, then mark them as unresponsive after 3 attempts.
* **Re-engagement drips:** Try a prospect twice, then route them to a different agent script if there is still no answer.
* **Conditional follow-ups:** After a first call, if the lead said "interested", route them to a booking agent; if they said "not interested", mark them as closed.

## Workflow vs. campaign

|               | Campaign                                 | Workflow                                 |
| ------------- | ---------------------------------------- | ---------------------------------------- |
| Structure     | Flat, where all leads get the same calls | Multi-step with conditional branching    |
| Lead progress | Linear                                   | Moves through nodes based on outcomes    |
| Best for      | Simple bulk outreach                     | Drip sequences and decision-tree calling |

## Getting started

1. **Create the workflow** with this endpoint.
2. **Add nodes** via [Create Node](/docs/api-reference/workflow-nodes/create), with one node per step.
3. **Connect nodes** via [Create Edge](/docs/api-reference/workflow-edges/create) to define transitions.
4. **Enrol leads** via [Upload Workflow Leads](/docs/api-reference/v1/workflow-leads/add).
5. **Activate** the workflow via [Activate](/docs/api-reference/workflows/activate).


## OpenAPI

````yaml POST /workflows
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:
    post:
      tags:
        - Workflows
      summary: Create a new workflow
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 
      operationId: WorkflowsController_create
      parameters:
        - name: x-organization-id
          in: header
          description: RSA encrypted organization ID (base64 format)
          required: true
          schema:
            type: string
            example: BASE64_ENCRYPTED_ORG_ID_HERE
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkflowDto'
      responses:
        '201':
          description: Workflow created successfully
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
      deprecated: true
components:
  schemas:
    CreateWorkflowDto:
      type: object
      properties:
        title:
          type: string
          description: Title of the workflow (max 100 characters)
          example: Customer Onboarding Workflow
          maxLength: 100
        description:
          type: string
          description: Description of the workflow
          example: Automated workflow for customer onboarding process
        status:
          type: string
          description: Status of the workflow
          enum:
            - draft
            - active
            - paused
            - completed
            - cancelled
          example: draft
      required:
        - title
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````