Task Management¶
APIs for dispatching, querying, reassigning, and cancelling task chains on AMRs.
AddTaskChain¶
Dispatches a sequence of tasks to AMRs. The system creates a task chain and assigns it to a robot based on the provided parameters.
POST /task/add
Request¶
task_chain TaskChain required¶
Metadata for the task chain, including target area, robot assignment, and priority.
tasks repeated Task required¶
Ordered sequence of tasks to be executed by the assigned AMR.
JSON Request Example¶
{
"taskChain": {
"areaId": 1,
"amrId": 0,
"groupId": 0,
"priority": 10,
"isReturn": 1,
"taskSeq": "ORDER-2025-001",
"name": "Pickup and Deliver",
"fromDetail": "WMS"
},
"tasks": [
{
"taskType": "TASK_TYPE_LOAD",
"mapId": 1,
"endPointCode": "PICKUP_01"
},
{
"taskType": "TASK_TYPE_UNLOAD",
"mapId": 1,
"endPointCode": "DROPOFF_02"
}
]
}
Response¶
| Field | Message Type | Description |
|---|---|---|
task_chain_id |
int32 |
ID of the newly created task chain. |
JSON Response Example¶
ReassignTaskByAmrId¶
Reassigns tasks for a specific robot. Allows modifying the remaining tasks in a robot's current task chain.
PUT /taskChain/reassignByAmrId/{amr_id}
Request¶
| Field | Message Type | Description |
|---|---|---|
amr_id |
int32 |
Robot ID to reassign tasks for. Passed as a path parameter. |
sequence |
int32 |
Position of the reassignment point in the task chain. |
is_retained |
bool |
Whether to retain subsequent sub-tasks after the reassignment point. |
reassign_tasks |
repeated Task |
New tasks to be assigned. |
JSON Request Example¶
Response¶
(Empty response on success)
JSON Response Example¶
ReassignTaskByTaskChainId¶
Reassigns tasks under a specific task chain. Similar to ReassignTaskByAmrId but targets a task chain directly.
PUT /taskChain/reassignByTaskChainId/{task_chain_id}
Request¶
| Field | Message Type | Description |
|---|---|---|
task_chain_id |
int32 |
Task chain ID to reassign. Passed as a path parameter. |
sequence |
int32 |
Position of the reassignment point in the task chain. |
is_retained |
bool |
Whether to retain subsequent sub-tasks after the reassignment point. |
reassign_tasks |
repeated Task |
New tasks to be assigned. |
JSON Request Example¶
Response¶
(Empty response on success)
JSON Response Example¶
FinishTaskChain¶
Marks a dispatch confirmation (E2 / TASK_TYPE_SYSTEM_CONFIRM) task as completed. Call this to unblock a task chain that is waiting for upper system confirmation.
GET /taskChain/endFinishPauseIsFalseTask/{task_chain_id}
Request¶
| Field | Message Type | Description |
|---|---|---|
task_chain_id |
int32 |
Task chain ID to finish. Passed as a path parameter. |
JSON Request Example¶
Note
The task_chain_id is passed as a URL path parameter.
Response¶
(Empty response on success)
JSON Response Example¶
QueryTaskChain¶
Retrieves task chain information including status, timing, and assigned robot details. Supports querying multiple task chains at once.
GET /task/getTaskChainByIds
Request¶
| Field | Message Type | Description |
|---|---|---|
task_chain_ids |
repeated int32 |
List of task chain IDs to query. |
JSON Request Example¶
Response¶
| Field | Message Type | Description |
|---|---|---|
task_chains |
repeated QueryTaskChainInfo |
List of task chain info with their subtasks. |
Each QueryTaskChainInfo contains:
task_chain_state— Chain-level metadata and statustask_states— Ordered list of subtask execution states
JSON Response Example¶
{
"taskChains": [
{
"taskChainState": {
"areaId": 1,
"amrId": 5,
"groupId": 0,
"priority": 10,
"isReturn": 1,
"taskSeq": "ORDER-2025-001",
"name": "Pickup and Deliver",
"createTime": "2025-01-15T10:00:00Z",
"startTime": "2025-01-15T10:01:00Z",
"finishTime": "",
"id": 12345,
"comeFrom": 0,
"fromDetail": "WMS",
"status": "TASK_CHAIN_STATUS_IN_PROGRESS"
},
"taskStates": [
{
"taskType": "TASK_TYPE_LOAD",
"mapId": 1,
"endPointCode": "PICKUP_01",
"taskChainId": 12345,
"status": "TASK_STATUS_COMPLETED",
"createTime": "2025-01-15T10:00:00Z",
"startTime": "2025-01-15T10:01:00Z",
"finishTime": "2025-01-15T10:05:00Z",
"loading": 0,
"id": 100001,
"amrId": 5
},
{
"taskType": "TASK_TYPE_UNLOAD",
"mapId": 1,
"endPointCode": "DROPOFF_02",
"taskChainId": 12345,
"status": "TASK_STATUS_EXECUTING",
"createTime": "2025-01-15T10:00:00Z",
"startTime": "2025-01-15T10:05:30Z",
"finishTime": "",
"loading": 1,
"id": 100002,
"amrId": 5
}
]
}
]
}
CancelTaskChain¶
Cancels a task chain. Only available for task chains that have not been fully completed.
POST /task/cancel/{task_chain_id}
Request¶
| Field | Message Type | Description |
|---|---|---|
task_chain_id |
int32 |
Task chain ID to cancel. Passed as a path parameter. |
force |
bool |
If true, force cancel even if a task is currently in progress. |
JSON Request Example¶
Response¶
(Empty response on success)