Trigger jobs outside Erathos
Last updated
Last updated
To register a webhook, you need to provide the following information:
description: A text description to help identify the functionality of the webhook.
jobs: A list of Job IDs (UUIDs) that should trigger the webhook. These IDs can be found through the Jobs endpoint in the workspace.
method: The type of HTTP request (GET, POST, PATCH, PUT).
url: The destination URL where the webhook will be sent.
header: Additional fields to include in the request, such as Content-Type and Authorization.
body: The request body, which can include static or dynamic data, using execution metadata.
rules: A list of conditions that must be met for the webhook to be triggered. All rules must be satisfied for the webhook to be sent.
variable_name: The name of the metadata variable available (check the Erathos Metadata section).
operation: One of the accepted operations depending on the variable type (check the Rules section).
value: A string or list of strings corresponding to the desired values.
The url, header, and body fields support the use of dynamic values in the format ${{variables.my_variable}}
, ${{secrets.my_secrets}}
, ${{erathos.rows}}
. These references will be replaced with real values before sending the webhook, using variables and secrets previously registered by the user, as well as metadata values from the execution that triggered the webhook.
Below is an example of a webhook that triggers the execution of a DAG in Airflow after the successful completion of a Job, with execution between 00:00 and 08:00 on weekdays, and only if at least one record has been transferred:
More examples are available in the Templates section.
After building your webhook, send a request to the Create Webhook endpoint to register it.