Skip to main content

Webhook Target

The webhook target is a built-in automation target that sends a message to any HTTP webhook endpoint whenever an automation condition fires. It is the most general-purpose integration target — any external system that accepts incoming webhooks can be connected to OpenDataDSL automations using this target.

Built-in targets

Built-in targets are provided by OpenDataDSL and referenced using the @ prefix on their script name (e.g. @WebhookTarget). They are available to all tenants without any additional configuration.


webhook — Send a webhook message​

Inputs​

InputRequiredDescription
url✅The webhook URL to send the message to
template✅The ID of a mustache script stored in the platform, used to format the message payload

The payload sent to the webhook is always formatted using the mustache template — the raw entity is not sent directly. This ensures the webhook receives exactly the structure the external system expects.


Using this target in an automation​

Notify an external system when a dataset completes​

//#region Send a webhook notification when a dataset completes
ab = AutomationBuilder("dataset", "private", "MY_PROVIDER.FEED.PRODUCT")
ab.addCondition("complete")
ab.setTarget("webhook")
ab.setProperty("url", "https://external-system.example.com/hooks/dataset-ready")
ab.setProperty("template", "my-scripts\\templates\\DatasetWebhookPayload")
ab.icon = "wifi text-orange"
ab.enabled = true
save ${automation:ab}
//#endregion

Notify an external system when a curve build fails​

//#region Send a webhook alert when a curve build fails
ab = AutomationBuilder("curve", "private", "MY_CURVE_OBJECT:CLOSE")
ab.addCondition("failed")
ab.setTarget("webhook")
ab.setProperty("url", "https://external-system.example.com/hooks/alerts")
ab.setProperty("template", "my-scripts\\templates\\CurveFailedWebhookPayload")
ab.icon = "wifi text-orange"
ab.enabled = true
save ${automation:ab}
//#endregion

Formatting the webhook payload​

The template input points to a mustache script stored in the platform. The script receives the triggered entity as its data context and should produce a JSON payload in the format the receiving webhook expects.

A simple example template for a dataset completion event:

{
"event": "dataset.complete",
"id": "{{_id}}",
"timestamp": "{{_updated}}"
}

The exact payload structure depends entirely on what the receiving system requires — consult its webhook documentation for the expected format.


Pre-configured webhook target​

For webhooks where the URL is fixed — such as a shared integration endpoint for a specific external system — you can create a custom target with the URL pre-filled. Users setting up automations then only need to select the target and supply a template.

Creating the pre-configured target​

//#region Create a pre-configured webhook target for an external monitoring system
at = AutomationTarget()
at.publisher = "myorg"
at.code = "webhook-monitoring"
at.name = "Send to external monitoring system"
at.description = "Send a webhook notification to the external monitoring system"
at.icon = "wifi text-orange"
at.script = "@WebhookTarget"
at.template = "send a webhook message to the monitoring system using [template]"
at.allowTransformation = false
at.allowPropertyChange = true
at.services = ["*"]
at.actions = ["*"]

at.properties.url = "https://external-system.example.com/hooks/opendatadsl"

at.tags = ["Application"]
save at
//#endregion

Using the pre-configured target in an automation​

Once saved, automations using webhook-monitoring only need a template property:

//#region Notify the monitoring system when a dataset becomes late
ab = AutomationBuilder("dataset", "private", "MY_PROVIDER.FEED.PRODUCT")
ab.addCondition("late")
ab.setTarget("webhook-monitoring")
ab.setProperty("template", "my-scripts\\templates\\DatasetLateWebhookPayload")
ab.icon = "wifi text-orange"
ab.enabled = true
save ${automation:ab}
//#endregion

Choosing between webhook and other notification targets​

The webhook target is the right choice when integrating with external systems that have their own incoming webhook support. For common platforms, dedicated targets are also available:

TargetBest for
webhookAny external system with an incoming webhook endpoint
teamsMicrosoft Teams channels
jiraCreating JIRA tasks
emailEmail notifications
queueInternal OpenDataDSL message queues