Skip to main content
Version: Release SaaS

Webhook event tasks

Webhook event tasks are extensible automated tasks that wait for events from both webhooks endpoints and deployment provider webhook sources, and complete when the incoming event matches the specified condition.

Using the Wait For Json Event Task

In Digital.ai Release there is a supplied generic webhook task Webhook: Wait for Json event.

picture 3

The input options for the Webhook: Wait for Json event task are:

OptionDescription
Event SourceConfigured HTTP Endpoint for webhooks or webhook sources to listen on.
ConditionThe condition that must be satisfied to transition the task from in-progress to complete.
Received eventOutput property bound to a text variable that will store the JSON of the webhook event (optional).

Note: The task will listen for incoming events only while it is in the In progress state.

See Deployment Provider Event Source Properties to learn more about the properties you can use to build your condition for deployment provider event sources.

Condition Script

The webhook task condition is a script that determines when the task completes:

If the script returns True, the task will complete.

If the script returns False, the task will stay in progress.

If there is an error with the script, the task will fail.

In the script, you can access the following properties: event, headers, parameters. event is the parsed JSON body of the webhook event, while headers and parameters are the HTTP request headers and parameters.

The event, headers, parameters data is also accessible using dot access, for example, event.commits[0].author, but the regular dict access is still available.

Using the Wait for Deployment Event Task

Use the generic Webhook: Wait for Deployment Event task to listen to deployment events from deployment provider event sources.

The input options for the Webhook: Wait for Deployment Event task are:

OptionDescription
Event SourceConfigured deployment provider event sources to listen to.
Application TitleThe title of the application to wait for.
Environment TitleThe title of the environment (the application will be deployed to) to wait for.
Application VersionThe version of the application to wait for.
Deployment StatusesThe deployment status to wait for. Default is success.

picture 1

This task, if configured, waits for the matching event on the deployment provider event source and completes when the event occurs.

picture 2

There are no output properties for this task.