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.

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-webhookMethod 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:

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-webhookIn this example, the default value of the
abcenvironment variable is123before the pipeline is triggered. After the pipeline is triggered, it prints the new variable value456.
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:
Disable the webhook trigger.
Have a user who can successfully run the pipeline re-enable the webhook trigger.
Send the webhook request again to verify.