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

# Retrieve Workflow

> Get a workflow with its current version.

```bash cURL theme={null}
curl --request GET \
  --url "https://api.roe-ai.com/v1/workflows/YOUR_WORKFLOW_ID/" \
  --header "Authorization: Bearer YOUR_API_KEY"
```


## OpenAPI

````yaml GET /v1/workflows/{workflow_id}/
openapi: 3.1.0
info:
  title: Roe API
  version: 1.0.0
  description: Complete API documentation for Roe platform
servers:
  - url: https://api.roe-ai.com
    description: Production API
security: []
paths:
  /v1/workflows/{workflow_id}/:
    get:
      tags:
        - v1
      summary: Get a workflow
      description: Get a workflow with its current version.
      operationId: v1_workflows_retrieve
      parameters:
        - in: path
          name: workflow_id
          schema:
            type: string
            format: uuid
          required: true
        - name: organization_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            Organization ID. This is required for access control. It can be
            provided via query or request body depending on the endpoint.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowDetail'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetailResponse'
          description: ''
      security:
        - apiKeyAuth: []
components:
  schemas:
    WorkflowDetail:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 200
        agent_id:
          type: string
          format: uuid
          readOnly: true
          description: >-
            The workflow's id as an agent. Calling a workflow by it is
            deprecated; the agent_id filter finds the workflow it belongs to.
        current_version_id:
          type:
            - string
            - 'null'
          format: uuid
          readOnly: true
        creator:
          oneOf:
            - $ref: '#/components/schemas/UserInfo'
            - type: 'null'
          readOnly: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          readOnly: true
        current_version:
          oneOf:
            - $ref: '#/components/schemas/WorkflowVersionDetail'
            - type: 'null'
          readOnly: true
      required:
        - agent_id
        - creator
        - current_version
        - current_version_id
        - id
        - name
        - updated_at
    ErrorDetailResponse:
      type: object
      description: 'DRF default error body: NotFound, PermissionDenied, Http404, etc.'
      properties:
        detail:
          type: string
          description: Human-readable error detail
      required:
        - detail
    UserInfo:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        email:
          type: string
          format: email
          title: Email address
          maxLength: 254
        first_name:
          type: string
          maxLength: 150
        last_name:
          type: string
          maxLength: 150
        display_name:
          type: string
          readOnly: true
      required:
        - display_name
        - email
        - id
    WorkflowVersionDetail:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        workflow_id:
          type: string
          format: uuid
          readOnly: true
        version_name:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        format_version:
          type: integer
          maximum: 32767
          minimum: 0
        is_current:
          type: boolean
          readOnly: true
        read_only:
          type: boolean
          readOnly: true
          description: >-
            Saved in the old graph format: it still runs, but can only be edited
            by saving a new version.
        created_at:
          type: string
          format: date-time
        definition:
          oneOf:
            - $ref: '#/components/schemas/WorkflowDefinition'
            - type: 'null'
          readOnly: true
          description: The steps, in the block format. Null for a read-only version.
        input_definitions: {}
        conversion_reasons:
          type: array
          items:
            type: string
          readOnly: true
          description: Why a read-only version couldn't be converted to the block format.
      required:
        - conversion_reasons
        - definition
        - id
        - is_current
        - read_only
        - workflow_id
    WorkflowDefinition:
      additionalProperties: false
      properties:
        format_version:
          const: 2
          default: 2
          type: integer
        inputs:
          items:
            $ref: '#/components/schemas/InputField'
          type: array
        steps:
          items:
            discriminator:
              mapping:
                agent: '#/components/schemas/AgentStep'
                approval: '#/components/schemas/ApprovalBlock'
                connection: '#/components/schemas/ConnectionStep'
                edit_fields: '#/components/schemas/EditFieldsStep'
                for_each: '#/components/schemas/ForEachBlock'
                if: '#/components/schemas/IfBlock'
                merge: '#/components/schemas/MergeStep'
                parallel: '#/components/schemas/ParallelBlock'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/AgentStep'
              - $ref: '#/components/schemas/ConnectionStep'
              - $ref: '#/components/schemas/EditFieldsStep'
              - $ref: '#/components/schemas/MergeStep'
              - $ref: '#/components/schemas/IfBlock'
              - $ref: '#/components/schemas/ForEachBlock'
              - $ref: '#/components/schemas/ApprovalBlock'
              - $ref: '#/components/schemas/ParallelBlock'
          minItems: 1
          type: array
        result:
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
      required:
        - steps
        - result
      type: object
    InputField:
      description: One input a step needs or a workflow declares.
      properties:
        key:
          type: string
        data_type:
          default: text/plain
          type: string
        description:
          type: string
          default: ''
        required:
          type: boolean
          default: true
        accepts_multiple_files:
          type: boolean
          default: false
      required:
        - key
      type: object
    AgentStep:
      additionalProperties: false
      properties:
        id:
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
        kind:
          const: agent
          default: agent
          type: string
        base_agent_id:
          type: string
        agent_version_id:
          type: string
        input_mapping:
          type: object
          additionalProperties:
            type: string
      required:
        - kind
        - id
        - base_agent_id
        - agent_version_id
      type: object
    ApprovalBlock:
      additionalProperties: false
      description: Steps that run once someone approves the agent step just before.
      properties:
        id:
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
        kind:
          const: approval
          default: approval
          type: string
        approval:
          $ref: '#/components/schemas/GateKind'
          default: manual
        steps:
          items:
            discriminator:
              mapping:
                agent: '#/components/schemas/AgentStep'
                approval: '#/components/schemas/ApprovalBlock'
                connection: '#/components/schemas/ConnectionStep'
                edit_fields: '#/components/schemas/EditFieldsStep'
                for_each: '#/components/schemas/ForEachBlock'
                if: '#/components/schemas/IfBlock'
                merge: '#/components/schemas/MergeStep'
                parallel: '#/components/schemas/ParallelBlock'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/AgentStep'
              - $ref: '#/components/schemas/ConnectionStep'
              - $ref: '#/components/schemas/EditFieldsStep'
              - $ref: '#/components/schemas/MergeStep'
              - $ref: '#/components/schemas/IfBlock'
              - $ref: '#/components/schemas/ForEachBlock'
              - $ref: '#/components/schemas/ApprovalBlock'
              - $ref: '#/components/schemas/ParallelBlock'
          minItems: 1
          type: array
      required:
        - kind
        - id
        - steps
      type: object
    ConnectionStep:
      additionalProperties: false
      description: |-
        Calls one operation of a saved connection, such as an API lookup or a
        Slack message. Credentials stay with the connection.
      properties:
        id:
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
        kind:
          const: connection
          default: connection
          type: string
        connection_id:
          type: string
        setup_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
        operation:
          type: string
        input_mapping:
          type: object
          additionalProperties:
            type: string
      required:
        - kind
        - id
        - connection_id
        - operation
      type: object
    EditFieldsStep:
      additionalProperties: false
      properties:
        id:
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
        kind:
          const: edit_fields
          default: edit_fields
          type: string
        fields:
          type: object
          additionalProperties:
            type: string
      required:
        - kind
        - id
        - fields
      type: object
    ForEachBlock:
      additionalProperties: false
      properties:
        id:
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
        kind:
          const: for_each
          default: for_each
          type: string
        items:
          type: string
        item_name:
          default: item
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
        parallel:
          type: boolean
          default: true
        steps:
          items:
            discriminator:
              mapping:
                agent: '#/components/schemas/AgentStep'
                approval: '#/components/schemas/ApprovalBlock'
                connection: '#/components/schemas/ConnectionStep'
                edit_fields: '#/components/schemas/EditFieldsStep'
                for_each: '#/components/schemas/ForEachBlock'
                if: '#/components/schemas/IfBlock'
                merge: '#/components/schemas/MergeStep'
                parallel: '#/components/schemas/ParallelBlock'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/AgentStep'
              - $ref: '#/components/schemas/ConnectionStep'
              - $ref: '#/components/schemas/EditFieldsStep'
              - $ref: '#/components/schemas/MergeStep'
              - $ref: '#/components/schemas/IfBlock'
              - $ref: '#/components/schemas/ForEachBlock'
              - $ref: '#/components/schemas/ApprovalBlock'
              - $ref: '#/components/schemas/ParallelBlock'
          minItems: 1
          type: array
      required:
        - kind
        - id
        - items
        - steps
      type: object
    IfBlock:
      additionalProperties: false
      properties:
        id:
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
        kind:
          const: if
          default: if
          type: string
        conditions:
          items:
            $ref: '#/components/schemas/Condition'
          minItems: 1
          type: array
        combine:
          allOf:
            - $ref: '#/components/schemas/CombineEnum'
          default: all
        then:
          items:
            discriminator:
              mapping:
                agent: '#/components/schemas/AgentStep'
                approval: '#/components/schemas/ApprovalBlock'
                connection: '#/components/schemas/ConnectionStep'
                edit_fields: '#/components/schemas/EditFieldsStep'
                for_each: '#/components/schemas/ForEachBlock'
                if: '#/components/schemas/IfBlock'
                merge: '#/components/schemas/MergeStep'
                parallel: '#/components/schemas/ParallelBlock'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/AgentStep'
              - $ref: '#/components/schemas/ConnectionStep'
              - $ref: '#/components/schemas/EditFieldsStep'
              - $ref: '#/components/schemas/MergeStep'
              - $ref: '#/components/schemas/IfBlock'
              - $ref: '#/components/schemas/ForEachBlock'
              - $ref: '#/components/schemas/ApprovalBlock'
              - $ref: '#/components/schemas/ParallelBlock'
          type: array
        otherwise:
          items:
            discriminator:
              mapping:
                agent: '#/components/schemas/AgentStep'
                approval: '#/components/schemas/ApprovalBlock'
                connection: '#/components/schemas/ConnectionStep'
                edit_fields: '#/components/schemas/EditFieldsStep'
                for_each: '#/components/schemas/ForEachBlock'
                if: '#/components/schemas/IfBlock'
                merge: '#/components/schemas/MergeStep'
                parallel: '#/components/schemas/ParallelBlock'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/AgentStep'
              - $ref: '#/components/schemas/ConnectionStep'
              - $ref: '#/components/schemas/EditFieldsStep'
              - $ref: '#/components/schemas/MergeStep'
              - $ref: '#/components/schemas/IfBlock'
              - $ref: '#/components/schemas/ForEachBlock'
              - $ref: '#/components/schemas/ApprovalBlock'
              - $ref: '#/components/schemas/ParallelBlock'
          type: array
      required:
        - kind
        - id
        - conditions
      type: object
    MergeStep:
      additionalProperties: false
      description: |-
        One value from several steps' outputs, leaving out any that didn't run,
        such as the side of an If that wasn't taken.
      properties:
        id:
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
        kind:
          const: merge
          default: merge
          type: string
        mode:
          allOf:
            - $ref: '#/components/schemas/ModeEnum'
          default: append
        sources:
          items:
            type: string
          minItems: 1
          type: array
      required:
        - kind
        - id
        - sources
      type: object
    ParallelBlock:
      additionalProperties: false
      properties:
        id:
          maxLength: 200
          pattern: ^[A-Za-z_]\w*$
          type: string
        kind:
          const: parallel
          default: parallel
          type: string
        lanes:
          items:
            items:
              discriminator:
                mapping:
                  agent: '#/components/schemas/AgentStep'
                  approval: '#/components/schemas/ApprovalBlock'
                  connection: '#/components/schemas/ConnectionStep'
                  edit_fields: '#/components/schemas/EditFieldsStep'
                  for_each: '#/components/schemas/ForEachBlock'
                  if: '#/components/schemas/IfBlock'
                  merge: '#/components/schemas/MergeStep'
                  parallel: '#/components/schemas/ParallelBlock'
                propertyName: kind
              oneOf:
                - $ref: '#/components/schemas/AgentStep'
                - $ref: '#/components/schemas/ConnectionStep'
                - $ref: '#/components/schemas/EditFieldsStep'
                - $ref: '#/components/schemas/MergeStep'
                - $ref: '#/components/schemas/IfBlock'
                - $ref: '#/components/schemas/ForEachBlock'
                - $ref: '#/components/schemas/ApprovalBlock'
                - $ref: '#/components/schemas/ParallelBlock'
            minItems: 1
            type: array
          minItems: 2
          type: array
      required:
        - kind
        - id
        - lanes
      type: object
    GateKind:
      description: |-
        What opens a gate: an org admin's explicit approval (manual) or the
        reviewer's verdict decision on the source agent's result (feedback).
      enum:
        - manual
        - feedback
      type: string
    Condition:
      additionalProperties: false
      properties:
        field:
          type: string
        operator:
          allOf:
            - $ref: '#/components/schemas/OperatorEnum'
          default: equals
        value:
          default: null
      required:
        - field
      type: object
    CombineEnum:
      enum:
        - all
        - any
      type: string
    ModeEnum:
      enum:
        - append
        - combine
      type: string
    OperatorEnum:
      enum:
        - equals
        - not_equals
        - contains
        - greater_than
        - less_than
        - is_empty
        - is_not_empty
        - is_true
        - is_false
      type: string
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key passed as a Bearer token. This is the scheme used
        by the public SDK surface.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.