查询自动化任务运行事件

查询一条自动化任务运行记录的生命周期事件。

GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agent-automation-runs/{run_id}/events

调用前准备

准备运行记录 ID、有目标工作区访问权限的个人访问令牌和目标工作区 ID。

请求参数

curl "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agent-automation-runs/$RUN_ID/events?limit=50&offset=0" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

字段

类型

必填

说明

workspace_id

string

工作区 ID。

run_id

string

运行记录 ID。

字段

类型

必填

说明

limit

integer

返回数量。

offset

integer

返回列表的起始位置。

成功响应

{
  "code": 0,
  "data": {
    "items": [
      {
        "id": "event_01",
        "workspace_id": "ws_01",
        "run_id": "run_01",
        "automation_task_id": "task_01",
        "type": "status_changed",
        "status": "running",
        "message": "运行已开始。",
        "created_at": "2026-08-18T04:00:00Z"
      }
    ],
    "total": 1,
    "limit": 50,
    "offset": 0
  }
}

成功时返回 200data.items 为事件列表,data.total 为匹配总数。

本文中,字段路径中的 [] 表示数组中的每一项。例如,items[].name 表示 items 数组中每一项的 name 字段。

字段

类型

说明

code

integer

成功时为 0。

字段

类型

说明

data.items

array

运行生命周期事件。

data.total

integer

匹配记录总数。

data.limit

integer

本页请求的最大记录数。

data.offset

integer

本页第一条记录的零基偏移量。

字段

类型

说明

data.items[].id

string

事件、工作区、运行和任务标识。

data.items[].workspace_id

string

事件、工作区、运行和任务标识。

data.items[].run_id

string

事件、工作区、运行和任务标识。

data.items[].automation_task_id

string

事件、工作区、运行和任务标识。

data.items[].type

string

事件类型、可选状态和说明。

data.items[].status

string

事件类型、可选状态和说明。

data.items[].message

string

事件类型、可选状态和说明。

data.items[].created_at

string

事件创建时间,使用 RFC 3339 格式。

错误响应

{
  "code": 3,
  "message": "<错误信息>"
}

字段

类型

说明

400

2INVALID_ARGUMENT

路径参数无效。建议:检查工作区和运行 ID。

401

6UNAUTHENTICATED

缺少有效身份凭据。建议:检查 API Key。

404

3NOT_FOUND

运行记录不存在。建议:先查询运行列表。

503

15UNAVAILABLE

自动化任务服务不可用。建议:稍后重试。

后续操作

事件中的状态用于辅助诊断;最终输出请查询自动化任务运行结果

最后更新于