All Products
Search
Document Center

ApsaraVideo Media Processing:AddMediaWorkflow

Last Updated:Jul 17, 2023

Creates a media workflow.

Operation Description

You can call this operation to define the topology, activities, and dependencies of a media workflow. The topology is represented by a directed acyclic graph (DAG) in the console. For more information, see Media workflow activities. You can view and run the workflows that are created by calling this operation in the ApsaraVideo Media Processing (MPS) console.

Limits on QPS

You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. For more information, see QPS limit.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
NamestringYes

The name of the media workflow.

  • The value cannot be empty.
  • The name cannot be the same as that of an existing media workflow within the current Alibaba Cloud account.
  • The name can be up to 64 characters in length.
  • The name can contain only UTF-8 characters.
mediaworkflow-example
TopologystringYes

The topology of the media workflow. The value must be a JSON object that contains the activity list and activity dependencies. For more information, see the Sample topology section of this topic.

TriggerModestringNo

The trigger mode of the media workflow. Valid values:

  • OssAutoTrigger: The media workflow is automatically triggered.
  • NotInAuto: The media workflow is not automatically triggered.
OssAutoTrigger

Sample topology


{
  "Activities": {
    "Act-Transcode-M3U8": {
      "Parameters": {
        "Outputs": [
          {
            "OutputObject": "transcode%2F%7BObjectPrefix%7D%7BFileName%7D",
            "TemplateId": "957d1719ee85ed6527b90cf62726****"
          }
        ],
        "OutputBucket": "example-vod-hls",
        "OutputLocation": "oss-cn-hangzhou"
      },
      "Type": "Transcode"
    },
    "Act-Start": {
      "Name": "Act-Start",
      "Parameters": {
        "PipelineId": "130266f58161436a80bf07cb12c8****",
        "InputFile": {
          "Bucket": "example-vod",
          "Location": "oss-cn-hangzhou"
        }
      },
      "Type": "Start"
    },
    "Act-Report": {
      "Name": "Act-Report",
      "Parameters": {
      },
      "Type": "Report"
    }
  },
  "Dependencies": {
    "Act-Transcode-M3U8": [
      "Act-Report"
    ],
    "Act-Start": [
      "Act-Transcode-M3U8"
    ],
    "Act-Report": [
    ]
  }
}

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

F1D21261-ADB9-406A-1234-491382139D59
MediaWorkflowobject

The information about the media workflow.

CreationTimestring

The time when the media workflow was created.

016-04-01T05:29:37Z
MediaWorkflowIdstring

The ID of the media workflow. We recommend that you keep this ID for later operations on this workflow.

e00732b977da427d9177a4deb1aa****
Statestring

The status of the media workflow. By default, the created workflow is in the Active state.

Active
TriggerModestring

The trigger mode of the media workflow. Valid values:

  • OssAutoTrigger: The media workflow is automatically triggered.
  • NotInAuto: The media workflow is not automatically triggered.
OssAutoTrigger
Namestring

The name of the media workflow.

mediaworkflow-example
Topologystring

The topology of the media workflow. The value is a JSON object that contains the activity list and activity dependencies.

Examples

Sample success responses

JSONformat

{
  "RequestId": "F1D21261-ADB9-406A-1234-491382139D59",
  "MediaWorkflow": {
    "CreationTime": "016-04-01T05:29:37Z",
    "MediaWorkflowId": "e00732b977da427d9177a4deb1aa****",
    "State": "Active",
    "TriggerMode": "OssAutoTrigger",
    "Name": "mediaworkflow-example",
    "Topology": ""
  }
}

Error codes

For a list of error codes, visit the Service error codes.