Webhook Triggers: Adding and Setting

Here's how to add and configure a Webhook Trigger:

Adding a Simple Webhook Trigger (HTTP)

To add a Webhook trigger, follow these steps:

  1. Click on "Start with a trigger".

  2. Click on the plus sign of the "Webhook" option. You will then open the modal to configure it and view more information.

  3. This modal is divided into two areas: Info banner, Settings and Request specifications.

Settings

By default, the Webhook address is predefined on the platform, and you can copy it from the specific icon - located on the right-hand side of the screen.

In addition, there is the option to "Request authentication". Without using OpenAPI, you'll only have the option to enable request authentication with User (default) and Password (mandatory), which won't be required when running the flow within the platform:

Request specifications

Flows can be triggered using the following MEDIA TYPE formats:

  1. application/json

  2. application/x-www-form-urlencoded)

Select one of the two, according to your needs, using the arrow in the right-hand corner.

Execution limit

You can manage the number of executions of your Webhook Trigger through the "Execution Limit", i.e. determining the maximum number of times the WebHook will be requested over a period of time.

To do this, choose the number and time measure (second, minute or hour) you want.

BODY

Under "Use Body in request", use the enable button to show the feature. By default, the Body tab is displayed:

This field allows you to use a body in JSON format, which you may or may not want to convert to YAML. When used, it appears as a parameter with the same name (body) in the other components of the flow, and you can filter your data using a SMOP or the Data Transformation tool module.

If you want to use the JSON format for platform to convert the code into YAML, use this tab of the Webhook trigger configuration and click "Generate Schema".

The platform will check that your JSON is valid and, if everything is OK, it will generate your YAML schema automatically.

Optionally, you can just use the BODY, without generating a YAML schema, by clicking "Save" to save your changes. This will prevent the platform from validating the type of parameter used.

Adding a Webhook Trigger with OpenAPI Schemas (HTTP)

As well as adding a simple Webhook trigger, we can add an OpenAPI - optional settings, but which allow us to pass parameters directly to the trigger, right at the start of the POST request.

To get started, under "Use Body in request", use the enable button to activate the feature. Next, choose the "Open API Schemas" tab.

Here, you will have the option of specifying your schema by adding parameters if you want to write your schema directly in YAML. Any parameters you add must be contained in the webhook_requestvariable. In the example above, we have a simple schema, with the csv parameter, which must be of string type. This parameter must be entered at the time of the POSTMAN (or similar) request. For better visualization, here is the same code in text:

components:
  schemas:
    webhook_request:
      type: object
      properties:
        csv:
          type: string

To finalize the trigger settings, click on "Save".

Read also:


Last updated