Creates a media workflow.
Operation description
This operation defines the topology (DAG), activities, and dependencies of a media workflow. For more information about activities, see Introduction to media workflow activities. Workflows created by using this operation can be viewed and called in the ApsaraVideo Media Processing console.
ApsaraVideo Media Processing media workflows can only be automatically triggered by prefixes (file paths). They cannot be triggered by file name extensions. For detailed trigger rules, see File trigger matching rules for media workflows.
QPS limit
The QPS limit for a single user is 100 calls per second. If the limit is exceeded, API calls are throttled, which may affect your business. Call the API operation at a reasonable rate. For more information, see QPS limits.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mts:AddMediaWorkflow |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
The name of the media workflow.
|
mediaworkflow-example |
| Topology |
string |
Yes |
The topology of the media workflow. The value is a JSON object that includes the activity list and activity dependencies. For more information, see the Topology example section below. Note
The region of OSS must be the same as the region of ApsaraVideo Media Processing. |
{"Activities": {"mediaworkflow-example": {"Parameters": {"Outputs": "[{\"OutputObject\":\"examplebucket/output/{RunId}/TRANSCODE_165941222****/{FileName}\",\"TemplateId\":\"S00000001-200010\",\"TemplateName\":\"MP4-Smooth\"}]","OutputBucket": "examplebucket","OutputLocation": "oss-cn-shanghai"},"Type": "Transcode"},"Act-Start": {"Parameters": {"PipelineId": "a7d481f07d8c45da88c71853ce7d****","InputFile": "{\"Bucket\":\"example-input\",\"Location\":\"oss-cn-shanghai\",\"ObjectPrefix\":\"mps-test/input/\"}"},"Type": "Start"},"Act-Report": {"Parameters": {"PublishType": "Manual"},"Type": "Report"}},"Dependencies": {"mediaworkflow-example": ["Act-Report"],"Act-Start": ["mediaworkflow-example"],"Act-Report": []}} |
| TriggerMode |
string |
No |
The trigger mode. Valid values:
|
OssAutoTrigger |
Topology example
The region of OSS must be the same as the region of ApsaraVideo Media Processing.
{
"Activities": {
"mediaworkflow-example": {
"Parameters": {
"Outputs": "[{\"OutputObject\":\"examplebucket/output/{RunId}/TRANSCODE_165941222****/{FileName}\",\"TemplateId\":\"S00000001-200010\",\"TemplateName\":\"MP4-Smooth\"}]",
"OutputBucket": "examplebucket",
"OutputLocation": "oss-cn-shanghai"
},
"Type": "Transcode"
},
"Act-Start": {
"Parameters": {
"PipelineId": "a7d481f07d8c45da88c71853ce7d****",
"InputFile": "{\"Bucket\":\"example-input\",\"Location\":\"oss-cn-shanghai\",\"ObjectPrefix\":\"mps-test/input/\"}"
},
"Type": "Start"
},
"Act-Report": {
"Parameters": {
"PublishType": "Manual"
},
"Type": "Report"
}
},
"Dependencies": {
"mediaworkflow-example": ["Act-Report"],
"Act-Start": ["mediaworkflow-example"],
"Act-Report": []
}
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
F1D21261-ADB9-406A-1234-491382139D59 |
| MediaWorkflow |
object |
The detailed information of the media workflow. |
|
| CreationTime |
string |
The creation time. The time follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format. The time is displayed in UTC. |
016-04-01T05:29:37Z |
| MediaWorkflowId |
string |
The ID of the media workflow. We recommend that you save this ID for subsequent operations on the workflow. |
e00732b977da427d9177a4deb1aa**** |
| State |
string |
The state of the media workflow. A newly created workflow is in the Active state by default. |
Active |
| TriggerMode |
string |
The trigger mode. Valid values:
|
OssAutoTrigger |
| Name |
string |
The name of the media workflow. |
mediaworkflow-example |
| Topology |
string |
The topology of the media workflow. The value is a JSON object that includes the activity list and activity dependencies. |
{"Activities": {"mediaworkflow-example": {"Parameters": {"Outputs": "[{\"OutputObject\":\"examplebucket/output/{RunId}/TRANSCODE_165941222****/{FileName}\",\"TemplateId\":\"S00000001-200010\",\"TemplateName\":\"MP4-Smooth\"}]","OutputBucket": "examplebucket","OutputLocation": "oss-cn-shanghai"},"Type": "Transcode"},"Act-Start": {"Parameters": {"PipelineId": "a7d481f07d8c45da88c71853ce7d****","InputFile": "{\"Bucket\":\"example-input\",\"Location\":\"oss-cn-shanghai\",\"ObjectPrefix\":\"mps-test/input/\"}"},"Type": "Start"},"Act-Report": {"Parameters": {"PublishType": "Manual"},"Type": "Report"}},"Dependencies": {"mediaworkflow-example": ["Act-Report"],"Act-Start": ["mediaworkflow-example"],"Act-Report": []}} |
Examples
Success response
JSON format
{
"RequestId": "F1D21261-ADB9-406A-1234-491382139D59",
"MediaWorkflow": {
"CreationTime": "016-04-01T05:29:37Z",
"MediaWorkflowId": "e00732b977da427d9177a4deb1aa****",
"State": "Active",
"TriggerMode": "OssAutoTrigger",
"Name": "mediaworkflow-example",
"Topology": "{\"Activities\": {\"mediaworkflow-example\": {\"Parameters\": {\"Outputs\": \"[{\\\"OutputObject\\\":\\\"examplebucket/output/{RunId}/TRANSCODE_165941222****/{FileName}\\\",\\\"TemplateId\\\":\\\"S00000001-200010\\\",\\\"TemplateName\\\":\\\"MP4-Smooth\\\"}]\",\"OutputBucket\": \"examplebucket\",\"OutputLocation\": \"oss-cn-shanghai\"},\"Type\": \"Transcode\"},\"Act-Start\": {\"Parameters\": {\"PipelineId\": \"a7d481f07d8c45da88c71853ce7d****\",\"InputFile\": \"{\\\"Bucket\\\":\\\"example-input\\\",\\\"Location\\\":\\\"oss-cn-shanghai\\\",\\\"ObjectPrefix\\\":\\\"mps-test/input/\\\"}\"},\"Type\": \"Start\"},\"Act-Report\": {\"Parameters\": {\"PublishType\": \"Manual\"},\"Type\": \"Report\"}},\"Dependencies\": {\"mediaworkflow-example\": [\"Act-Report\"],\"Act-Start\": [\"mediaworkflow-example\"],\"Act-Report\": []}}"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.