Workflow task completion
ApsaraVideo VOD sends a WorkflowTaskComplete event when all tasks in a workflow are complete. This topic covers the event content and a callback example.
Event type
WorkflowTaskComplete
Event description
Triggered when all tasks in a workflow are complete. This event applies only to new versions of workflows.
Event content
|
Parameter name |
Type |
Required |
Description |
|
EventType |
String |
Yes |
The event type. Fixed value: WorkflowTaskComplete. |
|
EventTime |
String |
Yes |
The time when the event occurred, in UTC format: yyyy-MM-ddTHH:mm:ssZ. |
|
WorkflowId |
String |
Yes |
The workflow ID. |
|
Status |
String |
Yes |
The workflow task status.
|
|
VideoId |
String |
Yes |
The video ID. |
|
TaskId |
String |
Yes |
The task ID. |
|
ActivityResults |
String |
Yes |
The task node results as a JSON string. For field details, see the following table. |
|
TaskInput |
String |
Yes |
The task input as a JSON string. For field details, see the following table. |
|
CreateTime |
String |
Yes |
The time when the task was created, in UTC format: yyyy-MM-ddTHH:mm:ssZ. |
|
ModifiedTime |
String |
Yes |
The time when the task was last modified, in UTC format: yyyy-MM-ddTHH:mm:ssZ. |
|
FinishTime |
String |
Yes |
The time when the task was completed, in UTC format: yyyy-MM-ddTHH:mm:ssZ. |
|
UserId |
String |
Yes |
The user ID. |
ActivityResults is a JSON string that contains the execution status and result of each activity node in the workflow. Each key (ActivityId) represents a workflow node instance, and its value contains the execution details of that node.
|
Name |
Type |
Required |
Example |
|
Status |
String |
Yes |
Succeed |
|
StartTime |
String |
Yes |
2025-10-15T01:50:30Z |
|
EndTime |
String |
Yes |
2025-10-15T02:00:33Z |
|
ActivityId |
String |
Yes |
VideoTranslation |
|
ActivityInstanceId |
String |
Yes |
ce87026be902... |
|
Result |
JSONObject |
Yes |
{ "Status": "Finished", "JobType": "VideoTranslation", "MediaId": "b0e8xxx281ed0102", "ModifiedTime": "2025-10-15T02:00:32Z", "UserData": "{\"VodSrc\":\"Workflow\"}", "CreateTime": "2025-10-15T01:50:30Z", "JobId": "0f5daxxxx4e5897f147" } |
TaskInput is a JSON string that contains the input data for the workflow, including the metadata and storage location of the media file to be processed.
|
Name |
Type |
Required |
Example |
|
Type |
String |
Yes |
Media |
|
Media |
String |
Yes |
c066a7898e2c71f08b23752281edxxxx |
|
Title |
String |
Yes |
title-sample.mp4 |
|
StorageLocation |
String |
Yes |
sample-bucket.oss-cn-shanghai.aliyuncs.com |
Callback example
Notes on the callback example:
-
For HTTP callbacks, the following content is the body of the HTTP POST request.
-
For MNS callbacks, the following content is the body of the message.
{
"Status": "Succeed",
"TaskId": "xxx",
"VideoId": "xxx",
"ActivityResults":"{\"VodSnapshot_53e77\":{\"ActivityId\":\"VodSnapshot\",\"ActivityInstanceId\":\"xxxx\",\"EndTime\":\"2025-04-01T02:29:50Z\",\"Result\":\"{\\\"RequestId\\\":\\\"xxx\\\",\\\"EventType\\\":\\\"SnapshotComplete\\\",\\\"UserId\\\":xxx,\\\"MessageBody\\\":{\\\"Status\\\":\\\"success\\\",\\\"VideoId\\\":\\\"xxx\\\",\\\"EventType\\\":\\\"SnapshotComplete\\\",\\\"EventTime\\\":\\\"2025-04-01T02:29:48Z\\\",\\\"TriggerSource\\\":\\\"{\\\\\\\"ActivityInstanceId\\\\\\\":\\\\\\\"xxx\\\\\\\",\\\\\\\"BizType\\\\\\\":\\\\\\\"ice-workflow\\\\\\\"}\\\"}}\",\"StartTime\":\"2025-04-01T02:29:46Z\",\"Status\":\"Succeed\"}}",
"TaskInput": "{\"Type\":\"Media\",\"Media\":\"xxx\",\"Title\":\"xxx\",\"StorageLocation\":\"xxx\"}",
"ModifiedTime": "2025-04-01T02:33:12Z",
"FinishTime": "2025-04-01T02:33:12Z",
"UserId": "xxx",
"CreateTime": "2025-04-01T02:29:43Z",
"WorkflowId": "xxx"
}