All Products
Search
Document Center

Alibaba Cloud DevOps:Trigger a pipeline with a webhook

Last Updated:Dec 17, 2025

This topic describes how to use a webhook to trigger a pipeline.

Prerequisites

You can enable the webhook trigger to automate pipeline runs for seamless integration and efficient deployment.

高的 (17).png

Important

To use a webhook to trigger a pipeline, you must enable the webhook trigger. Webhook triggers are typically used for calls from third-party tools, but you can also configure them to trigger pipelines from your own systems.

Trigger a pipeline run with a webhook

Method 1: General webhook

After you enable the webhook trigger for a pipeline, you can run the following command to trigger the pipeline.

curl --header "Content-Type: application/json" --request POST --data "{}" http://flow-openapi.aliyun.com/pipeline/webhook/your-webhook

Method 2: Pipeline source webhook

The URL for a pipeline source webhook trigger is the same as the URL for a code source trigger. You can select a configuration method based on your scenario.

Method 3: Environment variable webhook

Webhooks can trigger pipelines using environment variables. You can use the default variable parameters and values, or you can define custom values in the run command. The following figure shows an example:

高的 (35).png

  • Trigger the pipeline and pass new values for the variable parameters.

    curl --header "Content-Type: application/json" --request POST --data "{\"abc\":\"456\"}" http://flow-openapi.aliyun.com/pipeline/webhook/your-webhook
  • In this example, the default value of the abc environment variable is 123 before the pipeline is triggered. After the pipeline is triggered, it prints the new variable value 456.

    高的 (37).png

You can use these methods to trigger pipeline runs for any third-party integration.

FAQ

Why did the webhook trigger fail with an "insufficient permissions" error?

When a webhook triggers a pipeline, the system runs the pipeline as the user who last enabled the webhook trigger. The pipeline runs with that user's permissions. If that user has insufficient permissions or their permissions are revoked, the trigger fails. Follow these steps to update the permissions:

  1. Disable the webhook trigger.

  2. Have a user who can successfully run the pipeline re-enable the webhook trigger.

  3. Send the webhook request again to verify.