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

# Get workflow

> Returns the workflow and exactly ONE of its versions. Which one is up to `version`; by default it is the active (published) version that runs, falling back to the draft when nothing has been activated yet. The `workflow` object always reports `activeVersionNumber`, `latestPublishedVersionNumber` and `draftDirty`, so a client can tell what else exists — unpublished edits, or a newer published version than the one that runs — and ask for it by number in a second call.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/workflows/{id}
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/{id}:
    get:
      tags:
        - Workflows
      summary: Get workflow
      description: >-
        Returns the workflow and exactly ONE of its versions. Which one is up to
        `version`; by default it is the active (published) version that runs,
        falling back to the draft when nothing has been activated yet. The
        `workflow` object always reports `activeVersionNumber`,
        `latestPublishedVersionNumber` and `draftDirty`, so a client can tell
        what else exists — unpublished edits, or a newer published version than
        the one that runs — and ask for it by number in a second call.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: 4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641
        - name: version
          in: query
          required: false
          schema:
            type: string
            example: active
          description: >-
            Which version of the workflow to return. Takes any of: a version
            number (`3`, or `v3`); `0` or `draft` for the unpublished draft;
            `latest` for the newest published version; `active` for the one
            serving traffic; or the version row's uuid. Defaults to `active`,
            falling back to the draft when nothing has been activated yet.
      responses:
        '200':
          description: The workflow and the version that was selected
          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.
                      activeVersionNumber:
                        type: integer
                        nullable: true
                        description: >-
                          Version number that runs. Null until a version is
                          activated.
                      latestPublishedVersionNumber:
                        type: integer
                        nullable: true
                        description: >-
                          Newest published version number. Higher than
                          `activeVersionNumber` when a newer version is
                          published but not activated. Null before the first
                          publish.
                      draftDirty:
                        type: boolean
                        description: >-
                          True when the draft's definition or schemas differ
                          from the latest published version — i.e. there are
                          unpublished edits. Fetch them with `?version=draft`.
                  version:
                    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
                    nullable: true
                    description: >-
                      The one version this call selected, in full — the version
                      that runs by default, or whatever `version` named.
                      `version_number` says which it is (0 is the draft). Null
                      only for a workflow with neither an active version nor a
                      draft.
              example:
                workflow:
                  id: 4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641
                  org_id: 2b9d7c31-8e4f-4a2b-9d61-77c0a3f5e812
                  name: Refund triage
                  description: Classifies a refund request and fetches the order
                  active_version_id: e81b4a72-0c95-4f38-a6d2-5b17e9c4038f
                  owner_kind: org
                  owner_external_id: null
                  activeVersionNumber: 2
                  latestPublishedVersionNumber: 2
                  draftDirty: false
                version:
                  id: e81b4a72-0c95-4f38-a6d2-5b17e9c4038f
                  workflow_id: 4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641
                  version_number: 2
                  rev: 1
                  definition:
                    steps:
                      classify:
                        kind: agent
                        config:
                          prompt: Classify the request.
                          model_slug: openai/gpt-4o-mini
                        prompt: classify {{ $.input.text }}
                    flow:
                      - type: step
                        ref: classify
                    output_text: Classified as {{ $.steps.classify.category }}.
                  input_schema:
                    type: object
                    properties:
                      text:
                        type: string
                  output_schema: null
                  change_message: Tighten the classifier prompt
                  created_at: '2026-08-04T10:22:05.117Z'
                  updated_at: '2026-08-04T10:22:05.117Z'
        '400':
          description: >-
            Missing identity headers, an unparseable `version`, or the workflow
            belongs to another organization
        '404':
          description: Workflow not found, or it has no such version
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````