You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Workflow
CreateWorkflow
Copy page
Download PDF
CreateWorkflow
Description​
This interface creates a workflow for audio transcoding.​
Notes​
  • Currently, only workflows for audio transcoding are supported.​
  • A single bucket workflow can have up to 1000 rules. The total size of all rules serialized in JSON cannot exceed 20KB.​
Request syntax​
​
PUT /?workflow HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Mon, 19 May 2025 08:02:50 GMT​
Authorization: authorization string​
​
{​
"Rules": [​
{​
"ID": "my-wf-rule-1",​
"Enabled": true,​
"Prefix": "my-audio-dir/",​
"ExtFilter": {​
"AudioExts": [ "wav" ]​
},​
"Topology": [​
[ "my-op-1" ]​
],​
"Operations": {​
"AudioTranscode": [​
{​
"OperationID": "my-op-1",​
"Format": "mp3",​
"Bitrate": 128000,​
"Output": {​
"Region": "cn-beijing",​
"Bucket": "my-bucket",​
"Object": "test.mp3"​
}​
}​
]​
}​
}​
]​
}​
​
Request parameters and headers ​
For common request headers, see Common Parameters.​
​
Field name​
Location​
Type​
Required​
Example value​
Description​
workflow​
Query​
String​
Yes​
-​
Represents the special identifier for the CreateWorkflow request.​
​
Request body elements​
​
Field name​
Type​
Required​
Example value​
Description​
Rules​
Content​
Yes​
-​
Workflow configuration information.​
ID​
String​
Yes​
my-wf-rule-1​
Name of the workflow, described as follows:​
  • Length must not exceed 255.​
  • Name must be unique.​
Parent node: Rules​
Enabled​
String​
Yes​
true​
Enable this workflow. The value descriptions are as follows:​
  • true: enable the workflow. Once the object is uploaded to the specified path, the workflow will run automatically.​
  • false: stop the workflow.​
parent node: Rules​
Prefix​
String​
Yes​
my-audio-dir/​
Path bound to the workflow.​
Uploading files to this path triggers the workflow execution. If not specified, the entire bucket is bound, and uploading files to the bucket triggers the workflow execution.​
Parent node: Rules​
ExtFilter​
Content​
Yes​
-​
Media type.​
Parent node: Rules​
AudioExts​
Content​
Yes​
wav​
media type,​
only this media type can trigger workflow execution; currently only supports the value wav.​
Parent node: ExtFilter​
Topology​
String​
Yes​
my-op-1​
Template names included in the workflow.​
Operations​
Content​
Yes​
-​
Template information.​
Parent node: Rules​
AudioTranscode​
Content​
Yes​
-​
Audio transcode template information.​
Parent node: Operations​
OperationID​
String​
Yes​
my-op-1​
Name of the workflow template.​
Parent node: AudioTranscode​
Format​
String​
Yes​
mp3​
Transcode output format, currently only supports mp3.​
Parent node: AudioTranscode​
Bitrate​
Number​
Yes​
128000​
Transcoding bitrate, currently only supports the value 128000.​
Parent node: AudioTranscode​
Output​
Content​
Yes​
-​
Location where files are stored.​
Parent node: AudioTranscode​
Region​
String​
Yes​
cn-beijing​
Region where the transcoded audio file is stored​
Parent node: Output​
Bucket​
String​
Yes​
my-bucket​
Bucket for storing transcoded audio files.​
Parent node: Output​
Object​
String​
Yes​
test.mp3​
Name of the transcoded audio file.​
Parent node: Output​
​
Response headers​
The response contains common headers. For more information, see Common Parameters.​
Response body elements​
Sample response​
Sample request​
​
PUT /?workflow HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Mon, 19 May 2025 08:02:50 GMT​
Authorization: authorization string​
{​
"Rules": [​
{​
"ID": "my-wf-rule-1",​
"Enabled": true,​
"Prefix": "my-audio-dir/",​
"ExtFilter": {​
"AudioExts": [ "wav" ]​
},​
"Topology": [​
[ "my-op-1" ]​
],​
"Operations": {​
"AudioTranscode": [​
{​
"OperationID": "my-op-1",​
"Format": "mp3",​
"Bitrate": 128000,​
"Output": {​
"Region": "cn-beijing",​
"Bucket": "my-bucket",​
"Object": "test.mp3"​
}​
}​
]​
}​
}​
]​
}​
​
Sample response​
​
HTTP/1.1 200 OK​
x-tos-id-2: f91b0c03a01300c1-a444cd0 ​
x-tos-request-id: f91b0c03a01300c1-a444cd0 ​
Date: Mon, 19 May 2025 08:02:50 GMT​
server: TosServer​
Content-Length: 0​
​
​
Last updated: 2025.12.03 16:14:57