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

# Get a workflow

> One workflow with its steps (`nodes`, credentials redacted), connections (`edges`) and the input fields its steps read.



## OpenAPI

````yaml GET /api/workflows/{id}
openapi: 3.1.0
info:
  title: HITL API
  version: 1.0.0
  description: >-
    Run the workflows you build in HITL, follow each run until a person has
    answered, and manage who reviews them.
servers:
  - url: https://api.hitl.sh/v1
security:
  - bearerAuth: []
tags:
  - name: Workflows
  - name: Runs
  - name: Reviewers
  - name: Webhooks
  - name: Account
  - name: Uploads
paths:
  /api/workflows/{id}:
    get:
      tags:
        - Workflows
      summary: Get a workflow
      description: >-
        One workflow with its steps (`nodes`, credentials redacted), connections
        (`edges`) and the input fields its steps read.
      operationId: workflows-get
      parameters:
        - name: id
          in: path
          required: true
          description: The workflow id
          schema:
            type: string
            example: 6af2ce4e8207961501f59472
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                  msg:
                    type: string
                  data:
                    $ref: '#/components/schemas/Workflow'
              example:
                data:
                  id: 6af2ce4e8207961501f59472
                  name: Refund approval
                  description: >-
                    A support lead approves, denies or escalates refunds over
                    $100.
                  status: active
                  trigger:
                    type: webhook
                    webhook_id: wf_26db308d0ea2bfd5427999311a169b3b
                  steps: 6
                  has_review: true
                  runnable: true
                  execution_count: 4
                  last_executed_at: '2026-11-10T08:00:07.228Z'
                  created_at: '2026-11-10T07:57:02.477Z'
                  updated_at: '2026-11-10T07:57:05.452Z'
                  nodes:
                    - id: trigger-1
                      type: trigger
                      data:
                        label: Webhook
                        triggerType: webhook
                        workflowIcon:
                          color: peach
                          type: set
                          value: receipt
                    - id: review-1
                      type: review
                      data:
                        label: Approve refund
                        priority: high
                        requestText: >-
                          **Refund request**


                          | | |

                          |---|---|

                          | Customer | {{trigger.body.customer.name}}
                          ({{trigger.body.customer.email}}) |

                          | Order | {{trigger.body.order_id}} |

                          | Amount | ${{trigger.body.amount}}
                          {{trigger.body.currency}} |


                          **Reason:** {{trigger.body.reason}}
                        responseConfig:
                          options:
                            - label: Approve refund
                              value: approve
                            - label: Deny
                              value: deny
                            - label: Escalate to manager
                              value: escalate
                          required: true
                        responseType: single_select
                        timeout: '7200'
                    - id: condition-1
                      type: condition
                      data:
                        field: response.value
                        label: Approved?
                        operator: equals
                        value: approve
                    - id: action-1
                      type: action
                      data:
                        actionType: webhook
                        body: >-
                          {"order_id": "{{trigger.body.order_id}}", "amount":
                          {{trigger.body.amount}}, "approved_by":
                          "{{response.by.name}}"}
                        label: Issue the refund
                        method: POST
                        name: Issue the refund
                        url: https://httpbin.org/post
                    - id: action-2
                      type: action
                      data:
                        actionType: webhook
                        body: >-
                          {"order_id": "{{trigger.body.order_id}}", "decision":
                          "{{response.value}}"}
                        label: Email the customer
                        method: POST
                        name: Email the customer
                        url: https://httpbin.org/post
                    - id: end-1
                      type: end
                      data:
                        label: End
                  edges:
                    - id: e1
                      source: trigger-1
                      target: review-1
                    - id: e2
                      source: review-1
                      target: condition-1
                    - id: e3
                      source: condition-1
                      target: action-1
                      source_handle: 'yes'
                    - id: e4
                      source: condition-1
                      target: action-2
                      source_handle: 'no'
                    - id: e5
                      source: action-1
                      target: end-1
                    - id: e6
                      source: action-2
                      target: end-1
                  input_fields:
                    - path: amount
                      used_by:
                        - action-1
                        - review-1
                    - path: currency
                      used_by:
                        - review-1
                    - path: customer.email
                      used_by:
                        - review-1
                    - path: customer.name
                      used_by:
                        - review-1
                    - path: order_id
                      used_by:
                        - action-1
                        - action-2
                        - review-1
                    - path: reason
                      used_by:
                        - review-1
                error: false
                msg: Workflow retrieved
        '401':
          $ref: '#/components/responses/E401'
        '404':
          $ref: '#/components/responses/E404'
components:
  schemas:
    Workflow:
      allOf:
        - $ref: '#/components/schemas/WorkflowSummary'
        - type: object
          properties:
            nodes:
              type: array
              items:
                $ref: '#/components/schemas/Step'
            edges:
              type: array
              items:
                $ref: '#/components/schemas/Edge'
            input_fields:
              type: array
              items:
                $ref: '#/components/schemas/InputField'
    WorkflowSummary:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - active
            - paused
            - draft
        trigger:
          type: object
          properties:
            type:
              type: string
              enum:
                - webhook
                - email
                - schedule
                - manual
                - google_sheets_row
            webhook_id:
              type: string
        steps:
          type: integer
          description: Number of steps, trigger and end included
        has_review:
          type: boolean
          description: The workflow has at least one review step
        runnable:
          type: boolean
          description: Active, so `POST /run` will start it
        execution_count:
          type: integer
        last_executed_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Step:
      type: object
      required:
        - id
        - type
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - trigger
            - review
            - ai
            - ai_classifier
            - data_source
            - condition
            - transform
            - action
            - end
        position:
          type: object
          properties:
            x:
              type: number
            'y':
              type: number
        data:
          type: object
          description: >-
            The step's settings. For a review step: `label`, `requestText`
            (Markdown, may use `{{trigger.body.<path>}}`), `responseType`,
            `responseConfig`, `priority`, `timeout` (seconds, as a string).
            Credentials are redacted in answers.
          additionalProperties: true
    Edge:
      type: object
      required:
        - source
        - target
      properties:
        id:
          type: string
        source:
          type: string
        target:
          type: string
        source_handle:
          type: string
          description: 'Which exit of the source step: `yes` / `no` for a condition'
    InputField:
      type: object
      properties:
        path:
          type: string
          example: customer.email
        used_by:
          type: array
          items:
            type: string
          description: Ids of the steps that read it
    Error:
      type: object
      required:
        - error
        - msg
      properties:
        error:
          type: boolean
          example: true
        msg:
          type: string
          description: What went wrong, in plain words
        code:
          type: string
          description: >-
            A machine-readable reason, when there is one (for example
            `confirmation_required`)
  responses:
    E401:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: true
            msg: Invalid API key
    E404:
      description: Not found, or not yours
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: true
            msg: Workflow not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key: `hitl_live_…`'

````

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