> ## Documentation Index
> Fetch the complete documentation index at: https://enzohealth-12c99f25.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a workflow



## OpenAPI

````yaml GET /v1/workflows/{workflowId}
openapi: 3.0.3
info:
  title: Enzo API
  description: OpenAPI compliant REST API built using tRPC with Next.js
  version: 1.0.0
servers:
  - url: https://app.enzo.health/api
security: []
externalDocs:
  url: https://docs.enzo.health/api
paths:
  /v1/workflows/{workflowId}:
    get:
      tags:
        - Workflow
      summary: Get a workflow
      operationId: workflow-getWorkflow
      parameters:
        - in: path
          name: workflowId
          description: >-
            [Where to find my workflow's
            ID?](../how-to#how-to-find-my-workflowid)
          schema:
            type: string
            description: >-
              [Where to find my workflow's
              ID?](../how-to#how-to-find-my-workflowid)
          required: true
        - in: query
          name: migrateToLatestVersion
          description: >-
            If enabled, the workflow will be converted to the latest schema
            version
          schema:
            type: boolean
            default: false
            description: >-
              If enabled, the workflow will be converted to the latest schema
              version
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  workflow:
                    type: object
                    properties:
                      version:
                        type: string
                        default: '1'
                      groups:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            title:
                              type: string
                            graphCoordinates:
                              type: object
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            blocks:
                              type: array
                              items:
                                $ref: '#/components/schemas/block'
                          required:
                            - id
                            - title
                            - graphCoordinates
                            - blocks
                      events:
                        type: array
                        maxItems: 1
                        minItems: 1
                        items:
                          oneOf:
                            - $ref: '#/components/schemas/event'
                      id:
                        type: string
                      name:
                        type: string
                      icon:
                        type: string
                        nullable: true
                      edges:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            from:
                              anyOf:
                                - type: object
                                  properties:
                                    blockId:
                                      type: string
                                    itemId:
                                      type: string
                                  required:
                                    - blockId
                                - type: object
                                  properties:
                                    eventId:
                                      type: string
                                  required:
                                    - eventId
                            to:
                              type: object
                              properties:
                                groupId:
                                  type: string
                                blockId:
                                  type: string
                              required:
                                - groupId
                          required:
                            - id
                            - from
                            - to
                      variables:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            groupId:
                              type: string
                            isSessionVariable:
                              type: boolean
                            value:
                              nullable: true
                              anyOf:
                                - type: string
                                - type: array
                                  items:
                                    type: string
                                    nullable: true
                          required:
                            - id
                            - name
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      folderId:
                        type: string
                        nullable: true
                      publicId:
                        type: string
                        nullable: true
                      organizationId:
                        type: string
                      resultsTablePreferences:
                        type: object
                        nullable: true
                        properties:
                          columnsOrder:
                            type: array
                            items:
                              type: string
                          columnsVisibility:
                            type: object
                            additionalProperties:
                              type: boolean
                          columnsWidth:
                            type: object
                            additionalProperties:
                              type: number
                        required:
                          - columnsOrder
                          - columnsVisibility
                          - columnsWidth
                      isArchived:
                        type: boolean
                      isClosed:
                        type: boolean
                    required:
                      - version
                      - groups
                      - events
                      - id
                      - name
                      - icon
                      - edges
                      - variables
                      - createdAt
                      - updatedAt
                      - folderId
                      - publicId
                      - organizationId
                      - resultsTablePreferences
                      - isArchived
                      - isClosed
                  currentUserMode:
                    type: string
                    enum:
                      - guest
                      - read
                      - write
                required:
                  - workflow
                  - currentUserMode
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - Authorization: []
components:
  schemas:
    block:
      oneOf:
        - $ref: '#/components/schemas/textInput'
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Condition
                - Validation
            items:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  outgoingEdgeId:
                    type: string
                  content:
                    type: object
                    properties:
                      logicalOperator:
                        type: string
                        enum:
                          - OR
                          - AND
                      comparisons:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            variableId:
                              type: string
                            comparisonOperator:
                              type: string
                              enum:
                                - Equal to
                                - Not equal
                                - Contains
                                - Does not contain
                                - Greater than
                                - Less than
                                - Is set
                                - Is empty
                                - Starts with
                                - Ends with
                                - Matches regex
                                - Does not match regex
                            value:
                              type: string
                          required:
                            - id
                required:
                  - id
          required:
            - id
            - type
            - items
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Set variable
            options:
              oneOf:
                - type: object
                  properties:
                    variableId:
                      type: string
                    isExecutedOnClient:
                      type: boolean
                    expressionToEvaluate:
                      type: string
                    isCode:
                      type: boolean
                - type: object
                  properties:
                    variableId:
                      type: string
                    isExecutedOnClient:
                      type: boolean
                    type:
                      type: string
                      enum:
                        - Now
                        - Yesterday
                        - Tomorrow
                    timeZone:
                      type: string
                  required:
                    - type
                - type: object
                  properties:
                    variableId:
                      type: string
                    isExecutedOnClient:
                      type: boolean
                    type:
                      type: string
                      enum:
                        - Today
                        - Moment of the day
                        - Empty
                        - Environment name
                        - User ID
                        - Result ID
                        - Random ID
                        - Phone number
                        - Contact name
                  required:
                    - type
                - type: object
                  properties:
                    variableId:
                      type: string
                    isExecutedOnClient:
                      type: boolean
                    type:
                      type: string
                      enum:
                        - Custom
                    expressionToEvaluate:
                      type: string
                    isCode:
                      type: boolean
                  required:
                    - type
                - type: object
                  properties:
                    variableId:
                      type: string
                    isExecutedOnClient:
                      type: boolean
                    type:
                      type: string
                      enum:
                        - Map item with same index
                    mapListItemParams:
                      type: object
                      properties:
                        baseItemVariableId:
                          type: string
                        baseListVariableId:
                          type: string
                        targetListVariableId:
                          type: string
                  required:
                    - type
                - type: object
                  properties:
                    variableId:
                      type: string
                    isExecutedOnClient:
                      type: boolean
                    type:
                      type: string
                      enum:
                        - Append value(s)
                    item:
                      type: string
                  required:
                    - type
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Workflow link
            options:
              type: object
              properties:
                workflowId:
                  type: string
                groupId:
                  type: string
                mergeResults:
                  type: boolean
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Wait
            options:
              type: object
              properties:
                secondsToWaitFor:
                  type: string
                shouldPause:
                  type: boolean
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Jump
            options:
              type: object
              properties:
                groupId:
                  type: string
                blockId:
                  type: string
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Email
            options:
              type: object
              properties:
                credentialsId:
                  type: string
                isCustomBody:
                  type: boolean
                isBodyCode:
                  type: boolean
                recipients:
                  type: array
                  items:
                    type: string
                subject:
                  type: string
                body:
                  type: string
                replyTo:
                  type: string
                cc:
                  type: array
                  items:
                    type: string
                bcc:
                  type: array
                  items:
                    type: string
                attachmentsVariableId:
                  type: string
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Webhook
              description: Legacy name for HTTP Request block
            options:
              type: object
              properties:
                variablesForTest:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      variableId:
                        type: string
                      value:
                        type: string
                    required:
                      - id
                responseVariableMapping:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      variableId:
                        type: string
                      bodyPath:
                        type: string
                    required:
                      - id
                isAdvancedConfig:
                  type: boolean
                isCustomBody:
                  type: boolean
                isExecutedOnClient:
                  type: boolean
                webhook:
                  type: object
                  properties:
                    queryParams:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          key:
                            type: string
                          value:
                            type: string
                        required:
                          - id
                    headers:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          key:
                            type: string
                          value:
                            type: string
                        required:
                          - id
                    method:
                      type: string
                      enum:
                        - POST
                        - GET
                        - PUT
                        - DELETE
                        - PATCH
                        - HEAD
                        - CONNECT
                        - OPTIONS
                        - TRACE
                    url:
                      type: string
                    body:
                      type: string
                timeout:
                  type: number
                  minimum: 1
                  maximum: 120
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Google Sheets
            options:
              oneOf:
                - type: object
                  properties:
                    credentialsId:
                      type: string
                    sheetId:
                      type: string
                    spreadsheetId:
                      type: string
                    action:
                      type: string
                      enum:
                        - Get data from sheet
                    filter:
                      type: object
                      properties:
                        comparisons:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              column:
                                type: string
                              comparisonOperator:
                                type: string
                                enum:
                                  - Equal to
                                  - Not equal
                                  - Contains
                                  - Does not contain
                                  - Greater than
                                  - Less than
                                  - Is set
                                  - Is empty
                                  - Starts with
                                  - Ends with
                                  - Matches regex
                                  - Does not match regex
                              value:
                                type: string
                            required:
                              - id
                        logicalOperator:
                          type: string
                          enum:
                            - OR
                            - AND
                    cellsToExtract:
                      type: array
                      items:
                        type: object
                        properties:
                          column:
                            type: string
                          id:
                            type: string
                          variableId:
                            type: string
                        required:
                          - id
                    totalRowsToExtract:
                      type: string
                      enum:
                        - All
                        - First
                        - Last
                        - Random
                  required:
                    - action
                - type: object
                  properties:
                    credentialsId:
                      type: string
                    sheetId:
                      type: string
                    spreadsheetId:
                      type: string
                    action:
                      type: string
                      enum:
                        - Insert a row
                    cellsToInsert:
                      type: array
                      items:
                        type: object
                        properties:
                          column:
                            type: string
                          value:
                            type: string
                          id:
                            type: string
                        required:
                          - id
                  required:
                    - action
                - type: object
                  properties:
                    credentialsId:
                      type: string
                    sheetId:
                      type: string
                    spreadsheetId:
                      type: string
                    action:
                      type: string
                      enum:
                        - Update a row
                    cellsToUpsert:
                      type: array
                      items:
                        type: object
                        properties:
                          column:
                            type: string
                          value:
                            type: string
                          id:
                            type: string
                        required:
                          - id
                    filter:
                      type: object
                      properties:
                        comparisons:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              column:
                                type: string
                              comparisonOperator:
                                type: string
                                enum:
                                  - Equal to
                                  - Not equal
                                  - Contains
                                  - Does not contain
                                  - Greater than
                                  - Less than
                                  - Is set
                                  - Is empty
                                  - Starts with
                                  - Ends with
                                  - Matches regex
                                  - Does not match regex
                              value:
                                type: string
                            required:
                              - id
                        logicalOperator:
                          type: string
                          enum:
                            - OR
                            - AND
                  required:
                    - action
                - type: object
                  properties:
                    credentialsId:
                      type: string
                    sheetId:
                      type: string
                    spreadsheetId:
                      type: string
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Human Review
            options:
              type: object
              properties:
                recipients:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      email:
                        type: string
                    required:
                      - id
                      - email
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - SMS
            options:
              type: object
              properties:
                credentialsId:
                  type: string
                isCustomBody:
                  type: boolean
                recipients:
                  type: array
                  items:
                    type: string
                body:
                  type: string
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Esign
            options:
              type: object
              properties:
                isCustomBody:
                  type: boolean
                templateId:
                  type: string
                recipients:
                  type: array
                  items:
                    type: string
                body:
                  type: string
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Phone Call
            options:
              type: object
              properties:
                credentialsId:
                  type: string
                recipient:
                  type: string
                objective:
                  type: string
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Extract
            blockId:
              type: string
            options:
              type: object
              properties:
                processorId:
                  type: string
                responseVariableMapping:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      variableId:
                        type: string
                      bodyPath:
                        type: string
                    required:
                      - id
                variableId:
                  type: string
          required:
            - id
            - type
        - type: object
          properties:
            id:
              type: string
            outgoingEdgeId:
              type: string
            type:
              type: string
              enum:
                - Classify
            blockId:
              type: string
            options:
              type: object
              properties:
                workflowId:
                  type: string
                variableId:
                  type: string
          required:
            - id
            - type
      title: Block
    event:
      type: object
      properties:
        id:
          type: string
        outgoingEdgeId:
          type: string
        graphCoordinates:
          type: object
          properties:
            x:
              type: number
            'y':
              type: number
          required:
            - x
            - 'y'
        type:
          type: string
          enum:
            - start
      required:
        - id
        - graphCoordinates
        - type
      description: Event
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.UNAUTHORIZED:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Authorization not provided
        code:
          type: string
          description: The error code
          example: UNAUTHORIZED
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
    error.FORBIDDEN:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Insufficient access
        code:
          type: string
          description: The error code
          example: FORBIDDEN
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
    error.NOT_FOUND:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Not found
        code:
          type: string
          description: The error code
          example: NOT_FOUND
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Not found error (404)
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
    textInput:
      type: object
      properties:
        id:
          type: string
        outgoingEdgeId:
          type: string
        type:
          type: string
          enum:
            - text input
        options:
          type: object
          properties:
            labels:
              type: object
              properties:
                placeholder:
                  type: string
                button:
                  type: string
            variableId:
              type: string
            isLong:
              type: boolean
      required:
        - id
        - type
      title: Text
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````