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

# Create Workflow API

> Create a new workflow with an empty draft, ready for a definition to be saved and published.

<Note>
  The new workflow's draft starts at revision `0`. Save a definition with the [Save Draft API](/docs/api-reference/workflows/save-draft), then [validate](/docs/api-reference/workflows/validate) and [publish](/docs/api-reference/workflows/publish) it before running contacts.
</Note>


## OpenAPI

````yaml POST /workflows
openapi: 3.1.0
info:
  title: Bolna API
  description: >-
    Use and leverage Bolna Voice AI using APIs through HTTP requests from any
    language in your applications and workflows.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bolna.ai
    description: Production server
security:
  - bearerAuth: []
paths:
  /workflows:
    post:
      description: >-
        Creates a new workflow with an empty draft at revision `0`. Save a
        definition with the [Save Draft
        API](/api-reference/workflows/save-draft), then validate and publish it.
      requestBody:
        description: Workflow to create.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowCreateRequest'
        required: true
      responses:
        '201':
          description: Workflow created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
        '422':
          description: >-
            Validation error — e.g. `name` is empty or longer than 120
            characters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
components:
  schemas:
    WorkflowCreateRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
          description: Display name of the workflow.
          example: Loan follow-up
    Workflow:
      type: object
      required:
        - id
        - name
        - status
      properties:
        id:
          type: string
          format: uuid
          description: Unique workflow id.
        name:
          type: string
          description: Display name.
        status:
          type: string
          enum:
            - active
            - archived
          description: Workflow status.
        latest_published_version:
          type: integer
          nullable: true
          description: >-
            Number of the newest published version, or `null` if nothing is
            published yet.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    WorkflowError:
      type: object
      description: >-
        Error envelope returned by every workflow endpoint. `detail.code` is a
        stable machine-readable code; extra keys (such as `current_revision` on
        `revision_conflict`, `execution_id` on `duplicate_run`, or `issues` on
        `invalid_definition`) ride alongside it.
      required:
        - detail
      properties:
        detail:
          type: object
          additionalProperties: true
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: revision_conflict
            message:
              type: string
              description: Human-readable explanation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````