What is a pipeline

Updated at:

A pipeline executes multiple processing tasks in sequence. You can use a pipeline to chain multiple tasks and apply different operations to a file in a specific order.

Access rules

Data processing uses parameters such as action1 and action2 in the URL. If a pipeline contains multiple tasks, the tasks are executed in the specified order. Tasks are separated by a vertical bar (|).

The following rule first applies action1 to the file, then applies action2, and finally outputs the result.

  • Access rule for synchronous processing pipelines: <File URL>?x-oss-process=<action1>|<action2>.

  • Asynchronous processing supports only POST requests. The access rule for asynchronous pipelines is:

    POST <File URL>?x-oss-async-process HTTP/1.1
    Host: <HOST HEADER>
    Date: <DATE HEADER>
    Authorization: <AUTH HEADER>
    
    x-oss-async-process=<action1>|<action2>

Limits

  • Synchronous processing: Pipelines are supported for image processing. Pipelines are not supported for online document preview or online document editing.

  • Asynchronous processing: You can append only sys/saveas and /notify to the end of an asynchronous processing task. For example:

    POST /example.docx?x-oss-async-process HTTP/1.1
    Host: doc-demo.oss-cn-hangzhou.aliyuncs.com
    Date: Fri, 28 Oct 2022 06:40:10 GMT
    Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e
     
     // Convert the file example.docx to a PNG image.
    x-oss-async-process=doc/convert,target_png,source_docx|sys/saveas,b_dGVzdC1idWNrZXQ,o_ZG9jX2ltYWdlcy97aW5kZXh9LnBuZw/notify,topic_ZG9jX2ltYWdlcw

Usage examples

Image processing

Example 1

Resize an image to a height of 300 pixels and add the text watermark "Hello Image Service!".

https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg@300h|watermark=2&text=SGVsbG8g5Zu-54mH5pyN5YqhIQ

Example 2

Add the text watermark "Hello, Image Service!" to the bottom-right corner of an image, and then add the image watermark panda.png to the center.

https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg@watermark=2&text=SGVsbG8g5Zu-54mH5pyN5YqhIQ&p=9|watermark=1&object=cGFuZGEucG5n&t=90&p=5

Document processing

Example

  • Processing method

    1. Convert the DOCX file example.docx to a PNG image.

    2. Store the converted image in the oss://test-bucket/doc_images/ path and send a notification to the doc_images MNS topic.

  • Processing URL

    https://doc-demo.oss-cn-hangzhou.aliyuncs.com/example.docx?x-oss-async-process=doc/convert,target_png,source_docx|sys/saveas,b_dGVzdC1idWNrZXQ,o_ZG9jX2ltYWdlcy97aW5kZXh9LnBuZw/notify,topic_ZG9jX2ltYWdlcw

    • action1: doc/convert,target_png,source_docx. This action converts a DOCX file to a PNG image.

    • action2: sys/saveas,b_dGVzdC1idWNrZXQ,o_ZG9jX2ltYWdlcy97aW5kZXh9LnBuZw/notify,topic_ZG9jX2ltYWdlcw. This action stores the converted image in the oss://test-bucket/doc_images/ path and sends a notification to the doc_images MNS topic after the conversion is complete.