The app_task_status
routine returns
information about a single task.
This topic contains the following sections:
mysql> SELECT mysql_tasks.app_task_status(
IN 'app_user_id' VARCHAR(255),
IN 'task_id' VARCHAR (36);
Following are app_task_status
parameters:
app_user_id
(VARCHAR(255)): specifies the the application-managed user ID of the user who created the task.task_id
(VARCHAR (36)): specifies the unique task ID (UUID
) of the task for which the status information is required.
mysql> SELECT JSON_PRETTY(mysql_tasks.app_task_status('app_user_01', @task_id));
The output is similar to the following:
| {
"id": "a516b352-574c-11f0-9604-020017205654",
"data": {
"Task result": "Finished..."
},
"name": "demo task name",
"alias": "Wed-3",
"status": "COMPLETED",
"message": "Execution finished.",
"progress": 100,
"row_hash": "de3195fc0e2427d9b91cf03b920b96f2",
"task_data": {
"sleep": 5,
"mysqlMetadata": {
"autoGc": true,
"events": [
"`demo_db`.`a516a336-574c-11f0-9604-020017205654`",
"`demo_db`.`a516a3f8-574c-11f0-9604-020017205654`"
]
},
"refresh_period": 1
},
"task_type": "demo task type",
"server_uuid": "5172a252-8a06-11ef-b3bb-02001727ecef",
"progress_bar": "##########",
"connection_id": 1650,
"starting_time": "2025-07-02 13:58:35.000000",
"scheduled_time": "2025-07-02 13:58:35.000000",
"estimated_remaining_time": 0.00000,
"estimated_completion_time": "2025-07-02 13:58:40.000000"
} |
This example returns the current status of the
asynchronous task with the specified application-managed
user ID and task ID stored in the session variable
@task_id
.