All Products
Search
Document Center

Object Storage Service:Triggers

Last Updated:Sep 23, 2026

You can use triggers to process new files in an Object Storage Service (OSS) bucket. For example, you can convert new .docx files to the .pdf format or transcode .mov files to the .mp4 format. Unlike batch processing, a trigger processes only new files that are added to a bucket after the trigger is created. It does not process existing files.

Note
  • The APIs and software development kits (SDKs) for the new data processing feature are available in regions that have IMM endpoints.

  • Triggers are asynchronous tasks that run in the background. The time required for a task to complete varies. Therefore, the output file is not immediately available for access after the source file is uploaded.

  • After a trigger is created, it generates a data processing task for each new file. Task execution incurs fees. For more information, see Billing.

Usage notes

  • A trigger generates data processing tasks for files that meet the specified conditions. We recommend that you test the trigger with a small number of files.

  • If you suspend a trigger, it immediately stops generating new data processing tasks. However, tasks that are already submitted continue to run.

  • The output path must not be the same as the input path or have the input path as a prefix. This prevents trigger loops and overwriting source files.

  • The output path cannot end with a forward slash (/). You must specify a full output object path, including the extension. The object name can include variables. For more information about variables, see Variables.

  • The filename must contain at least one variable. Otherwise, multiple output files will overwrite each other.

  • When you use the {key}, {barename}, or {basename} variables in the output path, ensure that the output path is different from the input path. Otherwise, source objects might be overwritten or trigger recursive processing.

  • A file generated by a trigger cannot be reused as an input.

  • Triggers support only Standard storage class files.

Create a trigger

  1. Log on to the OSS console.

  2. In the navigation pane on the left, click Buckets and then click the name of the destination bucket.

  3. In the navigation pane on the left, choose Data Processing.

  4. You can select document processing, ApsaraVideo Media Processing, or other data processing capabilities (this example uses document processing).

  5. Click the Trigger tab, and then click Create Trigger.

  6. In the Create Trigger panel, configure Input Configuration, Output Configuration, Permission Configuration, and Notification Configuration.

    Parameter

    Description

    Input Bucket

    The bucket that contains the files to process.

    Path Prefix

    The path prefix of the files to process.

    Filter Rule

    Filters the files to process based on the path prefix and filter rule.

    • All: All files in the directory specified by the Path Prefix parameter are processed.

    • File Prefix: Processes data for files whose names match a specific prefix in the directory specified by Path Prefix. To specify multiple prefixes, separate them with commas (,).

    • File Suffix: Data processing is performed on files that have a specific suffix in the directory specified by the path prefix. To specify multiple suffixes, separate them with a comma (,).

    Style

    The style that you want to use to process objects. If no style is available, select Add Style from the drop-down list to create a style.

    Output Path

    The storage path for the processed files.

    The path cannot end with a forward slash (/). Use variables in the output path. Otherwise, the output of multiple tasks will overwrite each other. For more information, see Variables.

    Stop on Task Submission Failure

    Select whether to break immediately if a submitted task fails.

    • Break: If an error occurs during subtask submission, the trigger immediately fails and stops.

    • Ignore: If a subtask fails to be submitted, the trigger continues to run.

    Service Role

    The role that grants IMM the permissions to access other cloud resources, such as OSS. We recommend that you use the AliyunIMMBatchTriggerRole service role. If the service role does not exist, you can create it on the Resource Access Management (RAM) page.

    Message Queue

    You can configure a message queue to receive the results of data processing tasks upon completion. When a task is complete, a notification that contains the processing result can be sent to a lightweight message queue. For more information, see Quick Start.

  7. Click OK.

Query a trigger

  1. Log on to the OSS console.

  2. In the navigation pane on the left, click Buckets, and then click the name of the destination bucket.

  3. In the navigation pane on the left, choose Data Processing, and then select the required processing type, such as Document Processing or ApsaraVideo Media Processing.

  4. Click the Trigger tab to view the list of triggers.

    The following table describes the trigger statuses.

    Status

    Description

    Ready

    A newly created task has this status.

    Running

    The task is executing normally.

    Success

    The task has completed successfully.

    Paused

    The task is paused. No new tasks are triggered. Tasks that have already started will continue to run until they finish.

    Failed

    The task has failed. An error occurred during execution, and the task cannot recover automatically.

  5. In the Trigger ID search box, enter a trigger ID and click the search icon.

  6. To view the details of a trigger, click View Details in the Actions column.

  7. Click the expand icon next to a trigger ID to view all tasks for that trigger. You can search for tasks by file path or status.