> ## Documentation Index
> Fetch the complete documentation index at: https://dify-6c0370d8-fix-template-upload-size-guidance.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 提交人工介入表单

> **适用于**：Chatflow、Workflow。

向暂停中的人工介入表单提交接收人的响应。接受后工作流将恢复；可通过 [流式获取工作流事件](/zh/api-reference/workflow-runs/stream-workflow-events) 跟踪恢复后的运行。需要 Web 应用提交方式。



## OpenAPI

````yaml /zh/api-reference/openapi_service.json post /form/human_input/{form_token}
openapi: 3.0.1
info:
  description: 用于 Dify 应用与知识库的 REST API。应用类接口使用应用 API 密钥认证，知识库类接口使用知识库 API 密钥认证。
  title: Dify 服务 API
  version: 1.0.0
servers:
  - description: Dify 服务 API 的基础 URL。自部署时，替换为你的 API 基础 URL。
    url: https://{api_base_url}
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: API 基础 URL 的主机与路径，不含 `https://` 前缀。
security:
  - ApiKeyAuth: []
tags:
  - description: 与聊天消息和交互相关的操作。
    name: 对话消息
  - description: 文件上传和预览操作。
    name: 文件操作
  - description: 终端用户信息相关操作。
    name: 终端用户
  - description: 用户反馈操作。
    name: 消息反馈
  - description: 与管理会话相关的操作。
    name: 会话管理
  - description: 文字转语音和语音转文字操作。
    name: 语音与文字转换
  - description: 获取应用设置和信息的操作。
    name: 应用配置
  - description: 与管理标注直接回复相关的操作。
    name: 标注管理
  - description: 暂停等待人工输入的工作流恢复操作。
    name: 人工介入
  - description: 用于执行和管理工作流的操作。
    name: 工作流运行
  - description: 文本生成相关操作。
    name: 文本生成消息
  - description: 用于管理知识库的操作，包括创建、配置和检索。
    name: 知识库
  - description: 用于在知识库中创建、更新和管理文档的操作。
    name: 文档
  - description: 用于管理分段和子分段的操作。
    name: 分段
  - description: 用于管理知识库元数据字段和文档元数据值的操作。
    name: 元数据
  - description: 用于管理知识库标签和标签绑定的操作。
    name: 标签
  - description: 用于获取可用模型的操作。
    name: 模型
  - description: 用于管理和运行知识流水线的操作，包括数据源插件和流水线执行。
    name: 知识流水线
paths:
  /form/human_input/{form_token}:
    post:
      tags:
        - 人工介入
      summary: 提交人工介入表单
      description: >-
        **适用于**：Chatflow、Workflow。


        向暂停中的人工介入表单提交接收人的响应。接受后工作流将恢复；可通过
        [流式获取工作流事件](/zh/api-reference/workflow-runs/stream-workflow-events)
        跟踪恢复后的运行。需要 Web 应用提交方式。
      operationId: submitChatflowHumanInputForm
      parameters:
        - description: 暂停表单的访问令牌，由流式模式下执行工作流或发送对话消息接口返回的 `human_input_required` 事件提供。
          in: path
          name: form_token
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            examples:
              approve:
                summary: 请求示例
                value:
                  action: approve
                  inputs:
                    attachment:
                      transfer_method: local_file
                      type: image
                      upload_file_id: 3c8fa1b2-7d4e-4f9a-b0c1-d2e3f4a5b6c7
                    attachments:
                      - transfer_method: local_file
                        type: document
                        upload_file_id: 1a77f0df-c0e6-461c-987c-e72526f341ee
                      - transfer_method: remote_url
                        type: document
                        url: https://example.com/report.pdf
                    feedback: 可以发布
                    priority: high
                  user: abc-123
            schema:
              properties:
                action:
                  description: >-
                    接收人选择的操作按钮 ID。必须与表单的 `user_actions` 列表（由
                    [获取人工介入表单](/zh/api-reference/human-input/get-human-input-form)
                    接口返回）中的某个 `id` 值匹配。
                  type: string
                inputs:
                  additionalProperties: true
                  description: >-
                    按各输入的 `output_variable_name` 作为键提交的值。段落和下拉选项输入为字符串；`file`
                    输入为单个文件映射；`file-list` 输入为文件映射数组。


                    文件映射为 `{transfer_method: local_file, upload_file_id, type}`
                    或 `{transfer_method: remote_url, url, type}`，其中 `type` 为该字段
                    `allowed_file_types` 中的一种。对于 `local_file`，`upload_file_id` 为
                    [上传文件](/zh/api-reference/files/upload-file) 返回的 `id`。


                    在执行、上传和提交各次调用中使用一致的 `user`。
                  type: object
                user:
                  description: >-
                    终端用户标识，由你的应用定义，需在应用内唯一。Service API 与 Web 应用的用户 ID
                    相互独立，即使取值相同也不指向同一用户。参见
                    [终端用户身份](/zh/api-reference/guides/end-user-identity)。
                  type: string
              required:
                - inputs
                - action
                - user
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                success:
                  summary: 响应示例
                  value: {}
              schema:
                type: object
          description: 表单提交成功。响应体为空对象。
        '400':
          content:
            application/json:
              examples:
                bad_request:
                  summary: bad_request
                  value:
                    code: bad_request
                    message: 表单接收人类型无效
                    status: 400
                invalid_form_data:
                  summary: invalid_form_data
                  value:
                    code: invalid_form_data
                    message: 缺少必填输入：feedback
                    status: 400
          description: |-
            - `bad_request`：表单接收人类型无效。
            - `invalid_form_data`：提交内容未通过表单定义的校验。
        '404':
          content:
            application/json:
              examples:
                not_found:
                  summary: not_found
                  value:
                    code: not_found
                    message: 未找到表单
                    status: 404
          description: '`not_found`：未找到表单。'
        '412':
          content:
            application/json:
              examples:
                human_input_form_expired:
                  summary: human_input_form_expired
                  value:
                    code: human_input_form_expired
                    message: 该表单已过期，form_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    status: 412
                human_input_form_submitted:
                  summary: human_input_form_submitted
                  value:
                    code: human_input_form_submitted
                    message: 该表单已被其他用户提交，form_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    status: 412
          description: |-
            - `human_input_form_submitted`：表单已被提交。表单为一次性使用；无论由哪位用户提交，首个响应即生效。
            - `human_input_form_expired`：在提交到达之前表单已过期。
components:
  securitySchemes:
    ApiKeyAuth:
      bearerFormat: API_KEY
      description: >-
        每个请求都通过 API Key 认证：`Authorization: Bearer {API_KEY}`。应用接口使用应用 API
        Key，知识库接口使用知识库 API Key（[快速开始](/zh/api-reference/guides/get-started)）。


        API Key 应保存在服务端，切勿嵌入客户端代码。缺失或无效的 Key 会返回 HTTP `401`（`unauthorized`）。
      scheme: bearer
      type: http

````