Start automated task running¶
Manually start an enabled scheduled automation task and create a run record.
POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-automation-tasks/{automation_task_id}/runs
Preparation before calling¶
First Query automation task detailsConfirm that the task is enabled and obtain the task ID. Prepare a personal access token and target workspace ID that has access to the target workspace.
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.$TASK_ID: The automation task ID to start, asautomation_task_idin the path.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-automation-tasks/$TASK_ID/runs" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"payload": {
"date": "2026-08-18"
}
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
|
string |
Yes |
Automation task ID. |
Request body¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
object |
No |
Input data for this run. |
|
object |
No |
Additional context for this trigger. |
Successful response¶
Returns 201 on success. The fact that the request has been submitted does not mean that the agent has completed execution; please continue to query the running details or results.
{
"code": 0,
"data": {
"id": "run_01",
"workspace_id": "ws_01",
"automation_task_id": "task_01",
"automation_task_version": 1,
"trigger_type": "manual",
"trigger_config_snapshot": {
"mode": "cron"
},
"status": "queued",
"created_at": "2026-08-18T04:00:00Z",
"updated_at": "2026-08-18T04:00:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
New run, workspace, and automation task identifiers. |
|
string |
New run, workspace, and automation task identifiers. |
|
string |
New run, workspace, and automation task identifiers. |
|
integer |
The task version used in this run. |
|
string |
Trigger type and configuration snapshot fixed to manual triggering. |
|
object |
Trigger type and configuration snapshot fixed to manual triggering. |
|
string |
Initial running status; please refer to the subsequent query status. |
|
string |
Creation and last update times, using RFC 3339 format. |
|
string |
Creation and last update times, using RFC 3339 format. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body is invalid, the task is not a manually runnable enabled scheduled task, or the input does not meet the task constraints. |
Check task status, triggering methods and inputs. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity has not been verified for workspace access and valid roles. |
Use an identity and a valid role with access to the workspace. |
|
|
The automated task does not exist. |
Check the task details first. |
|
|
The task has conflicting activities running, or the task status conflicts. |
Wait for the existing run to end or refresh the task status before trying again. |
|
|
Run executor, input snapshot or workflow submission services are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Log data.id. Running a call does not mean it is finished. Use this ID to Query automation task running details to track the status; after entering the final state, Query the results of automated task execution.