Feature Description
Cloud Infinite supports customizing a callback URL. After task completion, the system sends an HTTP POST request to this URL with notification content in the request body. You can confirm it by the configured callback address to promptly learn about task processing progress and status, so that perform other business operations.
Callback Content
After task completion, the system will send callback content to the callback URL you have set, showing the complete node data as follows:
<Response>
<EventName>TaskFinish</EventName>
<JobsDetail>
<Code>Success</Code>
<CreationTime>2022-06-30T18:47:18+0800</CreationTime>
<EndTime>2022-06-30T18:47:30+0800</EndTime>
<Input>
<BucketId>test-123456789</BucketId>
<Object>input/demo.mp3</Object>
<Region>ap-chongqing</Region>
</Input>
<JobId>j035aca66f86211ec8a5a87e016101404</JobId>
<Message>SUCCESS</Message>
<Operation>
<Output>
<Bucket>test-123456789</Bucket>
<Object>output/nr.wav</Object>
<Region>ap-chongqing</Region>
</Output>
<UserData>This is my NoiseReduction job.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<QueueId>p2242ab62c7c94486915508540933a2c6</QueueId>
<StartTime>2022-06-30T18:47:20+0800</StartTime>
<State>Success</State>
<Tag>NoiseReduction</Tag>
</JobsDetail>
</Response>
The data are as follows:
|
Response | None. | Container for saving results | Container |
Container node Response content:
|
EventName | Response | Fixed Value: TaskFinish | String |
JobsDetail | Response | | Container array |
If the task is triggered by a workflow, Response.JobsDetail.Input will also include the CosHeaders node, with a data type of Container array.
Container node CosHeaders content:
|
Key | Response.JobsDetail.Input.CosHeaders | Custom Header name | String |
Value | Response.JobsDetail.Input.CosHeaders | Custom Header value | String |
If the task is triggered by a workflow, Response.JobsDetail will also include the Workflow node, with a data type of Container.
Container node Workflow content:
|
RunId | Response.Workflow | workflow instance ID | String |
WorkflowId | Response.Workflow | workflow ID | String |
WorkflowName | Response.Workflow | workflow name | String |
Name | Response.Workflow | workflow node name | String |
Practical Case
Case 1: Task Callback Triggered by API
<Response>
<EventName>TaskFinish</EventName>
<JobsDetail>
<Code>Success</Code>
<CreationTime>2022-06-30T18:47:18+0800</CreationTime>
<EndTime>2022-06-30T18:47:30+0800</EndTime>
<Input>
<BucketId>test-123456789</BucketId>
<Object>input/demo.mp3</Object>
<Region>ap-chongqing</Region>
</Input>
<JobId>j035aca66f86211ec8a5a87e016101404</JobId>
<Message>SUCCESS</Message>
<Operation>
<Output>
<Bucket>test-123456789</Bucket>
<Object>output/nr.wav</Object>
<Region>ap-chongqing</Region>
</Output>
<UserData>This is my NoiseReduction job.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<QueueId>p2242ab62c7c94486915508540933a2c6</QueueId>
<StartTime>2022-06-30T18:47:20+0800</StartTime>
<State>Success</State>
<Tag>NoiseReduction</Tag>
</JobsDetail>
</Response>
Case 2: Task Callback Triggered by API in JSON Format
{
"EventName": "TaskFinish",
"JobsDetail": [{
"Code": "Success",
"CreationTime": "2022-06-30T18:47:18+0800",
"EndTime": "2022-06-30T18:47:30+0800",
"Input": {
"BucketId": "test-123456789",
"Object": "input/demo.mp3",
"Region": "ap-chongqing"
},
"JobId": "j035aca66f86211ec8a5a87e016101404",
"Message": "SUCCESS",
"Operation": {
"Output": {
"Bucket": "test-123456789",
"Object": "output/nr.wav",
"Region": "ap-chongqing"
},
"UserData": "This is my NoiseReduction job.",
"JobLevel": "0"
},
"QueueId": "p2242ab62c7c94486915508540933a2c6",
"StartTime": "2022-06-30T18:47:20+0800",
"State": "Success",
"Tag": "NoiseReduction"
}]
}