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

# 获取人工介入表单

> 获取暂停中的人工介入表单内容。需要 WebApp 提交方式。

调用人工介入接口的端到端流程，参见 [API 集成流程](/zh/self-host/use-dify/nodes/hitl-api-integration-flow)。



## OpenAPI

````yaml /zh/api-reference/openapi_workflow.json get /form/human_input/{form_token}
openapi: 3.0.1
info:
  title: 工作流应用 API
  description: 工作流应用提供无会话支持，适用于翻译、文章写作、摘要 AI 等场景。
  version: 1.0.0
servers:
  - url: https://{api_base_url}
    description: 工作流应用 API 的基础 URL。自部署时，替换为你的 API 基础 URL。
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: API 基础 URL 的主机与路径，不含 `https://` 前缀。
security:
  - ApiKeyAuth: []
tags:
  - name: 工作流
    description: 用于执行和管理工作流的操作。
  - name: 文件操作
    description: 文件上传和下载操作。
  - name: 终端用户
    description: 终端用户信息相关操作。
  - name: 语音与文字转换
    description: 语音转文字和文字转语音转换。
  - name: 应用配置
    description: 应用设置、参数和元数据。
  - name: 人工介入
    description: 暂停等待人工输入的工作流恢复操作。
paths:
  /form/human_input/{form_token}:
    get:
      tags:
        - 人工介入
      summary: 获取人工介入表单
      description: >-
        获取暂停中的人工介入表单内容。需要 WebApp 提交方式。


        调用人工介入接口的端到端流程，参见 [API
        集成流程](/zh/self-host/use-dify/nodes/hitl-api-integration-flow)。
      operationId: getWorkflowHumanInputForm
      parameters:
        - name: form_token
          in: path
          required: true
          schema:
            type: string
          description: 暂停表单的访问令牌，由流式模式下执行工作流或发送对话消息接口返回的 `human_input_required` 事件提供。
      responses:
        '200':
          description: 表单内容获取成功。
          content:
            application/json:
              schema:
                type: object
                properties:
                  form_content:
                    type: string
                    description: 已替换工作流变量的预渲染表单正文。
                  inputs:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          description: >-
                            表单输入控件类型。可用值：`paragraph`（多行文本输入）、`select`（从列表中单选）、`file`（单个文件上传）和
                            `file-list`（多个文件上传）。
                        output_variable_name:
                          type: string
                          description: 引用该输入提交值在工作流中使用的变量名。对应提交 `inputs` 对象中的键。
                        default:
                          type: object
                          nullable: true
                          description: >-
                            `paragraph` 输入的原始默认值配置。客户端不应直接解析此字段，请使用
                            `resolved_default_values` 来展示默认值。其他输入类型或未配置默认值时为
                            `null`。
                          properties:
                            type:
                              type: string
                              description: >-
                                默认值来源。`constant` 表示将 `value` 作为字面字符串；`variable`
                                表示 `selector` 指向工作流变量。
                            selector:
                              type: array
                              items:
                                type: string
                              description: >-
                                当 `type` 为 `variable` 时的变量引用路径（例如 `["node_id",
                                "var_name"]`）。至少包含两个元素。
                            value:
                              type: string
                              description: 当 `type` 为 `constant` 时的字面默认值。始终为字符串。
                        option_source:
                          type: object
                          description: '`select` 输入的选项来源。仅当 `type` 为 `select` 时出现。'
                          properties:
                            type:
                              type: string
                              enum:
                                - variable
                                - constant
                              description: >-
                                选项来源。`constant` 表示 `value` 直接列出选项；`variable` 表示
                                `selector` 指向提供选项的 `array[string]` 工作流变量。
                            selector:
                              type: array
                              items:
                                type: string
                              description: 当 `type` 为 `variable` 时的变量引用路径。
                            value:
                              type: array
                              items:
                                type: string
                              description: 当 `type` 为 `constant` 时的字面选项列表。
                        allowed_file_types:
                          type: array
                          items:
                            type: string
                            enum:
                              - image
                              - document
                              - audio
                              - video
                              - custom
                          description: >-
                            接收人可上传的文件类别。`file` 和 `file-list`
                            输入会包含此字段。可用值：`image`、`document`、`audio`、`video`、`custom`。
                        allowed_file_extensions:
                          type: array
                          items:
                            type: string
                          description: >-
                            当 `allowed_file_types` 包含 `custom`
                            时允许的文件扩展名。每个扩展名都需要包含前导 `.`，例如 `.md`。`file` 和
                            `file-list` 输入会包含此字段。
                        allowed_file_upload_methods:
                          type: array
                          items:
                            type: string
                            enum:
                              - local_file
                              - remote_url
                          description: >-
                            接收人可使用的上传方式。可用值：`local_file`、`remote_url`。`file` 和
                            `file-list` 输入会包含此字段。
                        number_limits:
                          type: integer
                          description: 接收人可上传的最大文件数。仅 `file-list` 输入会包含此字段。
                    description: 表单输入字段定义。
                  resolved_default_values:
                    type: object
                    additionalProperties:
                      type: string
                    description: >-
                      用于在表单中展示的预渲染默认值，按输入的 `output_variable_name` 分组。仅当
                      `paragraph`
                      输入的默认值可由工作流变量解析时填充；无可解析默认值的输入为空。客户端请直接展示这些值，无需在前端再次解析
                      `default`。所有值均为字符串。
                  user_actions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          maxLength: 20
                          pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                          description: >-
                            操作按钮的标识。当接收人选择该按钮时，作为 `action` 传入
                            [提交人工介入表单](/api-reference/人工介入/提交人工介入表单)。
                        title:
                          type: string
                          maxLength: 100
                          description: 显示给接收人的按钮文本。
                        button_style:
                          type: string
                          description: 按钮的视觉样式。可用值：`primary`、`default`、`accent`、`ghost`。
                    description: 可用的提交操作。
                  expiration_time:
                    type: integer
                    format: int64
                    description: Unix 时间戳（秒），超过该时间后表单将不可提交。
                    nullable: true
              examples:
                success:
                  summary: 响应示例
                  value:
                    form_content: >-
                      Please review the draft, set a priority, and confirm or
                      request changes.
                    inputs:
                      - type: paragraph
                        output_variable_name: feedback
                        default:
                          type: constant
                          selector: []
                          value: ''
                      - type: select
                        output_variable_name: priority
                        option_source:
                          type: constant
                          selector: []
                          value:
                            - low
                            - medium
                            - high
                      - type: file
                        output_variable_name: attachment
                        allowed_file_types:
                          - image
                          - document
                        allowed_file_extensions: []
                        allowed_file_upload_methods:
                          - local_file
                          - remote_url
                      - type: file-list
                        output_variable_name: attachments
                        allowed_file_types:
                          - image
                          - document
                        allowed_file_extensions: []
                        allowed_file_upload_methods:
                          - local_file
                          - remote_url
                        number_limits: 5
                    resolved_default_values:
                      feedback: ''
                    user_actions:
                      - id: approve
                        title: Approve
                        button_style: primary
                      - id: reject
                        title: Request changes
                        button_style: default
                    expiration_time: 1745510400
        '404':
          description: '`not_found`：未找到表单。'
          content:
            application/json:
              examples:
                not_found:
                  summary: not_found
                  value:
                    status: 404
                    code: not_found
                    message: 未找到表单
        '412':
          description: |-
            - `human_input_form_submitted`：表单已被提交。表单为一次性使用；无论由哪位用户提交，首个响应即生效。
            - `human_input_form_expired`：在提交到达之前表单已过期。
          content:
            application/json:
              examples:
                human_input_form_submitted:
                  summary: human_input_form_submitted
                  value:
                    status: 412
                    code: human_input_form_submitted
                    message: 该表单已被其他用户提交，form_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890
                human_input_form_expired:
                  summary: human_input_form_expired
                  value:
                    status: 412
                    code: human_input_form_expired
                    message: 该表单已过期，form_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key 认证。对于所有 API 请求，请在 `Authorization` HTTP 头中包含您的 API Key，并加上
        `Bearer ` 前缀。示例：`Authorization: Bearer {API_KEY}`。**强烈建议将 API Key
        存储在服务端，不要在客户端共享或存储，以避免 API Key 泄漏导致严重后果。**

````