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

# 创建运行应用异步任务

> 异步触发工作流应用运行，立即返回 run_id，不等待执行完成。



## OpenAPI

````yaml api-reference/adp-api.yaml POST /open/agentic_engine/laiye/v1/app/run/create/task
openapi: 3.1.0
info:
  title: ADP API
  version: 1.0.0
  description: >-
    Laiye ADP 官方 OpenAPI
    接口规范，覆盖文档抽取、解析与转换，抽取应用管理、Webhook、人机协同、积分查询，以及工作流发现、运行、导出和文件管理。
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://adp.laiye.com
    description: ADP 生产环境
security: []
tags:
  - name: 文档抽取
    description: 从上传的文档中抽取结构化字段。
  - name: 文档解析
    description: 识别上传文档中的文字、版面块和位置信息。
  - name: 文档转换
    description: 将 PDF、Office、OFD 和图片转换为页面图片或电子表格结构。
  - name: 应用管理
    description: 创建、修改、删除和查询抽取应用及配置。
  - name: Webhook
    description: 查询事件目录并管理事件回调。
  - name: 账户
    description: 查询账户积分和使用情况。
  - name: 工作流
    description: 查询业务工作流模板、运行工作流应用并查询执行结果。
  - name: 工作流文件
    description: 上传和管理工作流应用使用的文件。
  - name: 人机协同
    description: 配置审核触发规则，查询协同任务并提交人工修正。
paths:
  /open/agentic_engine/laiye/v1/app/run/create/task:
    post:
      tags:
        - 工作流
      summary: 创建运行应用异步任务
      description: 异步触发工作流应用运行，立即返回 run_id，不等待执行完成。
      operationId: createDocFlowRunTask
      requestBody:
        $ref: '#/components/requestBodies/DocFlowRunRequest'
      responses:
        '200':
          $ref: '#/components/responses/DocFlowRunResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - EngineApiKeyAuth: []
components:
  requestBodies:
    DocFlowRunRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocFlowRunRequest'
          example:
            application_id: app_abc123
            inputs:
              query: 请帮我分析这份采购单
            files:
              - url: >-
                  https://adp.laiye.com/web/agentic_doc_processor/laiye/file/2003c711818811f1a36200163e358400
                name: 采购单.pdf
                mime_type: application/pdf
  responses:
    DocFlowRunResponse:
      description: 工作流运行结果。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocFlowRunResponse'
          example:
            code: success
            message: ''
            data:
              run_id: run_xyz789
              status: succeeded
              output:
                result: 采购单分析完成
              error: null
              started_at: '2026-04-30T10:00:00Z'
              ended_at: '2026-04-30T10:00:15Z'
    ValidationError:
      description: 参数校验错误。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HTTPValidationError'
          example:
            detail:
              - type: greater_than
                loc:
                  - query
                  - limit
                msg: Input should be greater than 0
                input: 0
                ctx:
                  gt: 0
  schemas:
    DocFlowRunRequest:
      type: object
      additionalProperties: false
      properties:
        application_id:
          type: string
        release_version_id:
          type: string
        session_id:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/DocFlowInputFile'
        inputs:
          type: object
          additionalProperties: true
          description: 工作流输入参数对象。可用字段由目标工作流发布版本的入参配置决定。
          properties:
            query:
              type: string
              description: 常见的文本输入字段示例；工作流也可以定义其他任意字段。
      required:
        - application_id
    DocFlowRunResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                run_id:
                  type: string
                status:
                  type: string
                  enum:
                    - pending
                    - running
                    - succeeded
                    - failed
                    - cancelled
                    - paused
                    - timeout
                output:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                error:
                  type:
                    - string
                    - 'null'
                started_at:
                  type:
                    - string
                    - 'null'
                  format: date-time
                ended_at:
                  type:
                    - string
                    - 'null'
                  format: date-time
    HTTPValidationError:
      type: object
      description: FastAPI/Pydantic 请求参数校验错误。
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      required:
        - detail
    DocFlowInputFile:
      type: object
      additionalProperties: false
      properties:
        url:
          type: string
        name:
          type: string
        mime_type:
          type: string
        size:
          type: integer
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: 文件随工作流传递的自定义元数据。
      required:
        - url
        - name
        - mime_type
    SimpleResponse:
      type: object
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: 业务码。成功通常为 success 或 200。
        message:
          type: string
          description: 返回信息。
        tips:
          type:
            - string
            - 'null'
          description: 详细信息，默认为空。
    ValidationErrorItem:
      type: object
      additionalProperties: true
      properties:
        type:
          type: string
          description: 校验错误类型。
        loc:
          type: array
          description: 错误字段在请求中的位置。
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
          description: 可读的错误说明。
        input:
          description: 导致校验失败的输入值。
        ctx:
          type: object
          additionalProperties: true
          description: 校验器提供的补充上下文。
        url:
          type: string
          format: uri
          description: Pydantic 错误说明链接。
      required:
        - type
        - loc
        - msg
  securitySchemes:
    EngineApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 用于调用工作流接口的 API Key。

````

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