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

# Create workflow

> Creates a workflow. Its v0 draft is created automatically (do not create it yourself). Returns the workflow + the empty draft.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workflows
openapi: 3.1.0
info:
  title: Sidenet API
  version: 1.0.0
  description: >-
    Sidenet HTTP endpoints exposed by the Sidenet Studio. All routes require an
    api key that can be generated through the studio in studio.sidenet.ai.
servers:
  - url: https://api.sidenet.ai
security:
  - bearerAuth: []
paths:
  /v1/workflows:
    post:
      tags:
        - Workflows
      summary: Create workflow
      description: >-
        Creates a workflow. Its v0 draft is created automatically (do not create
        it yourself). Returns the workflow + the empty draft.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  example: Refund triage
                description:
                  type: string
                  example: Classifies a refund request and fetches the order
      responses:
        '201':
          description: The new workflow and the empty v0 draft created with it
          content:
            application/json:
              schema:
                type: object
                properties:
                  workflow:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      org_id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                      active_version_id:
                        type: string
                        format: uuid
                        nullable: true
                        description: Null until a published version is activated.
                      owner_kind:
                        type: string
                        enum:
                          - org
                          - chatter
                        description: >-
                          `org` for Studio-authored workflows, `chatter` for
                          ones an end user built through a builder agent.
                      owner_external_id:
                        type: string
                        nullable: true
                        description: >-
                          The owning end user's external id when `owner_kind` is
                          `chatter`; null otherwise.
                  draft:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      workflow_id:
                        type: string
                        format: uuid
                      version_number:
                        type: integer
                        description: >-
                          0 is the mutable draft; every published version is 1
                          or above.
                      rev:
                        type: integer
                        description: >-
                          Server-owned change counter, bumped on every save of
                          the draft. Read-only — useful to tell whether a draft
                          moved since you last read it.
                      definition:
                        type: object
                        description: >-
                          The steps + flow graph, plus the optional
                          `output_text` result-message template. Its JSON Schema
                          — the same one the builder UI validates against — is
                          served by GET /v1/workflows/definition-schema.
                      input_schema:
                        type: object
                        nullable: true
                        description: >-
                          JSON Schema for the run input. Null means
                          unconstrained.
                      output_schema:
                        type: object
                        nullable: true
                        description: >-
                          JSON Schema for the run output. Null means
                          unconstrained.
                      change_message:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                    description: >-
                      The auto-created draft, at `version_number` 0 and with no
                      steps yet.
        '400':
          description: Invalid body or missing headers
        '500':
          description: Create failed
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````