Webhook Triggers: Adding and Setting
Last updated
Last updated
Here's how to add and configure a Webhook Trigger:
To add a Webhook trigger, follow these steps:
Click on "Start with a trigger".
Click on the plus sign of the "Webhook" option. You will then open the modal to configure it and view more information.
This modal is divided into two areas: Info banner, Settings and Request specifications.
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:
Flows can be triggered using the following MEDIA TYPE formats:
application/json
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.
Under "Use Body in request", use the enable button to show the feature. By default, the Body tab is displayed:
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.
If there is an error, check the error message, make the necessary corrections and try again.
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_request
variable. 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:
To finalize the trigger settings, click on "Save".
Read also:
.
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 tool module.