> ## 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.

# 导出工作流运行记录（受限预览）

> 将指定工作流运行记录导出为 Excel、Word、Markdown 或 JSON，并返回临时下载地址及运行摘要。公开合同要求显式提供至少一个 run_id，不开放后端“空列表导出应用全部运行”的兼容行为。

当前实现单次最多处理 200 个运行、最多生成 500,000 行，临时文件通常约 1 小时有效。受限预览：路由只校验 API Key 和租户，没有独立的管理员角色或应用可见性校验。仅可在受控租户中，由管理员导出自己确认有权访问的 application_id 和 run_ids。导出内容可能包含工作流输入、节点输出和业务数据；下载后应按原始数据等级保护。




## OpenAPI

````yaml api-reference/adp-api.yaml POST /open/agentic_engine/laiye/v1/app/runs/export
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/runs/export:
    post:
      tags:
        - 工作流
      summary: 导出工作流运行记录（受限预览）
      description: >
        将指定工作流运行记录导出为 Excel、Word、Markdown 或 JSON，并返回临时下载地址及运行摘要。公开合同要求显式提供至少一个
        run_id，不开放后端“空列表导出应用全部运行”的兼容行为。


        当前实现单次最多处理 200 个运行、最多生成 500,000 行，临时文件通常约 1 小时有效。受限预览：路由只校验 API Key
        和租户，没有独立的管理员角色或应用可见性校验。仅可在受控租户中，由管理员导出自己确认有权访问的 application_id 和
        run_ids。导出内容可能包含工作流输入、节点输出和业务数据；下载后应按原始数据等级保护。
      operationId: exportWorkflowRuns
      requestBody:
        $ref: '#/components/requestBodies/WorkflowRunExportRequest'
      responses:
        '200':
          $ref: '#/components/responses/WorkflowRunExportResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - EngineApiKeyAuth: []
components:
  requestBodies:
    WorkflowRunExportRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WorkflowRunExportRequest'
          example:
            application_id: app_abc123
            run_ids:
              - run_xyz789
            format: excel
            report_mode: merged
            include_failed_runs: false
            max_text_length: 10000
  responses:
    WorkflowRunExportResponse:
      description: 工作流运行记录导出结果。下载地址按临时敏感链接处理。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WorkflowRunExportResponse'
    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:
    WorkflowRunExportRequest:
      type: object
      additionalProperties: false
      properties:
        application_id:
          type: string
          minLength: 1
          description: 工作流应用 ID。
        run_ids:
          type: array
          minItems: 1
          maxItems: 200
          uniqueItems: true
          description: 明确授权导出的运行 ID。公共合同不允许 null 或空数组导出全部运行。
          items:
            type: string
            minLength: 1
        node_ids:
          type: array
          uniqueItems: true
          description: 可选的节点 ID 列表；省略时包含运行中的全部可导出节点。
          items:
            type: string
            minLength: 1
        format:
          type: string
          enum:
            - excel
            - word
            - markdown
            - json
          default: excel
        report_mode:
          type: string
          enum:
            - merged
            - per_run
          default: merged
          description: merged 合并为一份报告；per_run 按运行拆分。
        include_failed_runs:
          type: boolean
          default: false
        primary_key_variable:
          type: string
          description: 可选的工作流输入变量名，用作导出主键。
        max_text_length:
          type: integer
          minimum: 1
          maximum: 30000
          default: 10000
          description: 单个文本值导出的最大字符数；当前路由实际默认 10000。
      required:
        - application_id
        - run_ids
    WorkflowRunExportResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              oneOf:
                - $ref: '#/components/schemas/WorkflowRunExportData'
                - type: 'null'
    HTTPValidationError:
      type: object
      description: FastAPI/Pydantic 请求参数校验错误。
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      required:
        - detail
    SimpleResponse:
      type: object
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: 业务码。成功通常为 success 或 200。
        message:
          type: string
          description: 返回信息。
        tips:
          type:
            - string
            - 'null'
          description: 详细信息，默认为空。
    WorkflowRunExportData:
      type: object
      properties:
        file_id:
          type: string
        download_url:
          type: string
          format: uri
          description: 临时下载地址；当前实现通常约 1 小时，未作为稳定 SLA。
        filename:
          type: string
        file_size:
          type: integer
          minimum: 0
        format:
          type: string
          enum:
            - excel
            - word
            - markdown
            - json
        report_mode:
          type: string
          enum:
            - merged
            - per_run
        total_runs:
          type: integer
          minimum: 0
          maximum: 200
        included_runs:
          type: integer
          minimum: 0
          maximum: 200
        skipped_runs:
          type: integer
          minimum: 0
          maximum: 200
        run_summaries:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowRunExportSummary'
        export_time:
          type: string
          format: date-time
      required:
        - file_id
        - download_url
        - filename
        - file_size
        - format
        - report_mode
        - total_runs
        - included_runs
        - skipped_runs
        - run_summaries
        - export_time
    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
    WorkflowRunExportSummary:
      type: object
      properties:
        run_id:
          type: string
        status:
          type: string
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        ended_at:
          type:
            - string
            - 'null'
          format: date-time
        included_nodes:
          type: integer
          minimum: 0
        skipped_nodes:
          type: integer
          minimum: 0
      required:
        - run_id
        - status
        - started_at
        - ended_at
        - included_nodes
        - skipped_nodes
  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.