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 the X-API-Key Header.

  • $WORKSPACE_ID: Target workspace ID, passed through the X-Workspace-ID Header and also as workspace_id in the path.

  • $RUN_ID: To query the running record ID of the event, use it as run_id in 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

workspace_id

string

Yes

Workspace ID.

run_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

limit

integer

No

Return the quantity.

offset

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

code

integer

0 on success.

data.items

array

Run life cycle events.

data.items[].id

string

Event, workspace, run, and task identifiers.

data.items[].workspace_id

string

Event, workspace, run, and task identifiers.

data.items[].run_id

string

Event, workspace, run, and task identifiers.

data.items[].automation_task_id

string

Event, workspace, run, and task identifiers.

data.items[].type

string

Event type, optional status, and description.

data.items[].status

string

Event type, optional status, and description.

data.items[].message

string

Event type, optional status, and description.

data.items[].created_at

string

Event creation time, using RFC 3339 format.

data.total

integer

Total number of matches, current page size, and offset.

data.limit

integer

Total number of matches, current page size, and offset.

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

400

2(INVALID_ARGUMENT)

The path parameter is invalid.

Check workspace and run ID.

401

6(UNAUTHENTICATED)

Lack of valid identity credentials.

Check API Key.

503

15(UNAVAILABLE)

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.

Last updated on