Webhook Trigger​Webhook ​Trigger

Trigger flows based on web-based events.

Webhook triggers generate a unique URL that you can use to automatically create new executions based on events in another application such as GitHub or Amazon EventBridge.

In order to use that URL, you have to add a secret key that secures your webhook URL.

yaml
type: "io.kestra.plugin.core.trigger.Webhook"

A Webhook trigger enables triggering a flow from a webhook URL. At trigger creation, a key must be set that is used on the URL that triggers the flow: /api/v1/executions/webhook/{namespace}/{flowId}/{key}. We advise to use a non-easy to find or remember key like a generated sequence of characters. Kestra accepts GET, POST, and PUT requests on this URL. The whole request body and headers are available as variables.

Example

yaml
id: trigger
namespace: company.team

tasks:
  - id: hello
    type: io.kestra.plugin.core.log.Log
    message: "Hello World! 🚀"

triggers:
  - id: webhook
    type: io.kestra.plugin.core.trigger.Webhook
    key: 4wjtkzwVGBM9yKnjm3yv8r

After the trigger is created, the key must be explicitly set in the webhook URL. You can execute the flow using the following URL:

bash
https://{kestra_domain}/api/v1/executions/webhook/{namespace}/{flowId}/4wjtkzwVGBM9yKnjm3yv8r

Make sure to replace kestra_domain, namespace, and flowId.

You can also copy the formed Webhook URL from the Triggers tab.


Check the Webhook task documentation for the list of the task properties and outputs.

Was this page helpful?