查询指定自动化任务的运行历史¶
读取一个任务定义下的运行记录,用返回的运行ID继续查询详情、事件和结果。
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agent-automation-tasks/{automation_task_id}/runs
请求参数¶
curl --get "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agent-automation-tasks/$AUTOMATION_TASK_ID/runs" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "limit=50" --data-urlencode "offset=0"
参数 |
类型 |
必填 |
说明 |
|---|---|---|---|
|
string |
是 |
当前环境的有效个人访问令牌;另需满足工作区访问条件。 |
|
string |
是 |
与路径 workspace_id 一致。 |
|
string |
是 |
工作区 ID,不能混用其他环境的标识。 |
|
string |
否 |
八种运行状态之一;省略不按状态筛选。 |
|
string |
否 |
RFC 3339 时间,包含起点。 |
|
string |
否 |
RFC 3339 时间,不包含终点。 |
|
integer |
否 |
默认50,最大200;按返回的limit继续翻页。 |
|
integer |
否 |
默认0,负数归零。 |
|
string |
是 |
自动化任务定义的ID,不是运行ID。 |
返回结果¶
{
"code": 0,
"data": {
"items": [
{
"id": "run-example",
"workspace_id": "workspace-example",
"automation_task_id": "task-example",
"automation_task_version": 1,
"trigger_type": "manual",
"trigger_config_snapshot": {
"mode": "cron",
"cron_expression": "TZ=UTC 0 9 * * *"
},
"status": "queued",
"created_at": "2026-11-11T01:00:00Z",
"updated_at": "2026-11-11T01:00:00Z"
}
],
"total": 1,
"limit": 50,
"offset": 0
}
}
字段 |
类型 |
说明 |
|---|---|---|
|
integer |
成功为0。 |
|
object[] |
本页运行记录,空时[];字段见运行对象。 |
|
integer |
当前筛选范围的总条数,不是本页条数。 |
|
integer |
本次生效的页大小。 |
|
integer |
本次生效的偏移。 |
查询范围与分页¶
按created_at降序、同时间id升序。按返回的offset+limit取下一页,达到total或返回空页时停止;并发新增或状态变化可使偏移分页重复/遗漏,不把它当快照游标。运行ID用于详情/事件/结果,automation_task_id用于任务定义。
合法但未匹配任何运行的任务ID可返回空列表;该入口未先查询父任务,200空列表不证明父任务存在。
参数归一化、时间边界见查询规则,错误与鉴权层次见错误及环境。SDK/CLI有通用资源调用入口,不能因没有专用列表方法判为功能不可用。