By invoking the StartWorkflow API, you can submit a media workflow template task to implement an automated media processing flow based on the workflow template.
Operation description
Currently, only media assets from Intelligent Media Services or ApsaraVideo VOD are supported as workflow inputs.
When submitting a flow task, you must specify a workflow template. You can create a workflow template in the Intelligent Media Services console or use a system preset workflow template.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ice:StartWorkflow |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| WorkflowId |
string |
Yes |
The ID of the workflow template. To view the template ID, log on to the IMS console and choose Configurations > Workflow Template. |
******f0e54971ecbffd472190****** |
| TaskInput |
string |
No |
The workflow input. Only media assets are supported. |
{ "Type": "Media", "Media": "******30706071edbfe290b488******" }或 { "Type": "OSS", "Media": "oss://bucket/path/to/video.mp4" } |
| UserData |
string |
No |
The user-defined data in the JSON format, which cannot be up to 512 bytes in length. You can specify a custom callback URL. For more information, see Configure a callback upon editing completion. |
{"NotifyAddress":"https://xx.xx.xxx"}或{"NotifyAddress":"ice-callback-demo"} |
| SkipInputVerification |
boolean |
No |
Specifies whether to skip verification of the input path supported by the pipeline. This parameter takes effect only when the pipeline input is an OSS file. We recommend that you do not skip this verification to avoid faults caused by incorrect paths. If this parameter is not specified, verification is performed by default. Valid values:
|
false |
Workflow Trigger Matching Rules
When an OSS file triggers a workflow, the system applies the following matching policy: using the path of the newly added file as the basis, it checks the location bound to the workflow. If the file path contains the string specified in the rule, the rule matches; otherwise, it does not match. For example, given the file path:
http://bucket.oss-cn-hangzhou.aliyuncs.com/A/B/C/test1.flv, the following rules apply:
1. http://bucket.oss-cn-hangzhou.aliyuncs.com/A/B/C/ Match
2. http://bucket.oss-cn-hangzhou.aliyuncs.com/A/B/ Match
3. http://bucket.oss-cn-hangzhou.aliyuncs.com/A/ Match
4. http://bucket.oss-cn-hangzhou.aliyuncs.com/ Match
5. http://bucket.oss-cn-hangzhou.aliyuncs.com/A/B/C/test.flv Match
6. http://bucket.oss-cn-hangzhou.aliyuncs.com/A/B/CC/ No match
7. http://bucket.oss-cn-hangzhou.aliyuncs.com/A/B2/ No match
8. http://bucket.oss-cn-hangzhou.aliyuncs.com/A2/B/C/ No match
When creating a new media workflow, do not configure the input path of one workflow as a prefix of another workflow's input path. Otherwise, a single incremental file may trigger two workflow execution instances. For example, if two workflows have input paths configured as test and test1 respectively, uploading a file to the test1 folder also satisfies the test prefix condition, thereby triggering two workflow execution instances.
Matching File Name Extensions
Only multimedia files can trigger workflows. The Media Library service determines whether a file is multimedia based on its file name extension. A file either has no extension (i.e., the file name does not contain the extension separator “.”), or its extension must comply with the following rules:
For .swf files, screenshot and transcoding quality are not guaranteed.
| Type | File Name Extensions |
| Video | 3gp, asf, avi, dat, dv, flv, f4v, gif, m2t, m3u8, m4v, mj2, mjpeg, mkv, mov, mp4, mpe, mpg, mpeg, mts, ogg, qt, rm, rmvb, swf, ts, vob, wmv, webm |
| Audio | aac, ac3, acm, amr, ape, caf, flac, m4a, mp3, ra, wav, wma, aiff |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
******42-E8E1-4FBB-8E52-F4225C****** |
| TaskId |
string |
The ID of the workflow task. |
******22dad741d086a50325f9****** |
Examples
Success response
JSON format
{
"RequestId": "******42-E8E1-4FBB-8E52-F4225C******",
"TaskId": "******22dad741d086a50325f9******"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.