Query automation task running events¶
Query the life cycle events of an automated task running record.
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agent-automation-runs/{run_id}/events
Preparation before calling¶
Prepare the run ID, a personal access token with access to the target workspace, and the workspace ID. First query the run record to confirm that it can be read, then query or poll its events. If the detail request returns 404, verify the run ID before continuing.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed through theX-Workspace-IDHeader and also asworkspace_idin the path.$RUN_ID: To query the running record ID of the event, use it asrun_idin the path.
Request example¶
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"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
|
string |
Yes |
Run record ID. |
Query parameters¶
When limit or offset is not provided, the service returns 50 records by default and starts from record 0; the maximum value for limit is 200.
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
integer |
No |
Return the quantity. |
|
integer |
No |
Returns the starting position of the list. |
Successful response¶
Returns 200 on success. data.items is the event list, and data.total is the total number of matches. An empty array means this request returned no events; it does not prove that the run exists or has finished. A missing run can also return 200 with an empty list. Check the run details to confirm the record, and use run results for its status and final output.
{
"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
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
Run life cycle events. |
|
string |
Event, workspace, run, and task identifiers. |
|
string |
Event, workspace, run, and task identifiers. |
|
string |
Event, workspace, run, and task identifiers. |
|
string |
Event, workspace, run, and task identifiers. |
|
string |
Event type, optional status, and description. |
|
string |
Event type, optional status, and description. |
|
string |
Event type, optional status, and description. |
|
string |
Event creation time, using RFC 3339 format. |
|
integer |
Total number of matches, current page size, and offset. |
|
integer |
Total number of matches, current page size, and offset. |
|
integer |
Total number of matches, current page size, and offset. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
The following HTTP 503 response indicates that the service is unavailable. Do not rely on the event list returning 404 to determine whether a run exists.
{
"code": 15,
"message": "agent automation run service is not available"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The path parameter is invalid. |
Check workspace and run ID. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The automated task service is unavailable. |
Try again later. |
Follow-up operations¶
The status in the event is used to assist diagnosis; for the final output, please Query the results of automated task execution.