Skip to main content

Automation Targets

An automation target defines what happens when an automation fires. Every automation has exactly one target, which receives the triggering data and acts on it: sending an email, running a process, writing to storage, building a curve, and so on.

Every target has an id made of a publisher and a code, publisher.code. All built-in targets are published by OpenDataDSL, so their ids start with odsl., for example odsl.email or odsl.blob. You use this full id in the target field of an automation.

Targets come in two kinds:

  • Built-in targets: provided by OpenDataDSL and available to all tenants
  • Custom targets: created by you, either wrapping a built-in target with fixed properties, or backed by your own ODSL script. See Custom Targets

Built-in targets​

The Transform and Property change columns show whether the target supports the @transformer property and property-change filtering (see Special @ properties below).

Communication​

IdNameTransformProperty changePage
odsl.emailSend an emailYesYesEmail Target
odsl.email_attachmentSend an email with an attachmentYesYesEmail Target
odsl.teamsSend a Teams messageNoYesTeams Target
odsl.webhookSend a webhook messageNoYesWebhook Target
odsl.jiraCreate a JIRA taskNoYesJIRA Target

Storage​

IdNameTransformProperty changePage
odsl.blobSave to an Azure BlobYesYesAzure Storage Targets
odsl.adlsSave to an Azure Data LakeYesYesAzure Storage Targets

Queuing​

IdNameTransformProperty changePage
odsl.queueSend a message to a queueYesYesQueue Target
odsl.queue_subjectSend a message to a queue with a subjectYesYesQueue Target

Compute​

IdNameTransformProperty changePage
odsl.processRun a processNoYesProcess Target
odsl.scriptRun a scriptNoYesScript Target
odsl.reportRun a reportNoYesReport Target
odsl.report_rangeRun a report with a rangeNoYesReport Target
odsl.export_groupExport a group of dataNoYesExport Group Target

Curve and TimeSeries​

These build automations are created and removed automatically by the platform when you save or delete a Smart or Event Curve or TimeSeries.

IdNameTransformProperty changePage
odsl.curveBuild a Smart CurveNoNoCurve Build Targets
odsl.ecurveBuild an Event CurveNoNoCurve Build Targets
odsl.timeseriesBuild a Smart TimeSeriesNoNoTimeSeries Build Targets
odsl.etimeseriesBuild an Event TimeSeriesNoNoTimeSeries Build Targets

Dataset​

IdNameTransformProperty changePage
odsl.qualitycheckRun dataset quality checksNoNoDataset Check Targets
odsl.criticalcheckRun dataset critical checksNoNoDataset Check Targets

Extensions​

These targets belong to extensions. The extension creates and maintains the automations that use them, so you don't normally create them yourself.

IdNameMaintained by
odsl.validationRun validation checksThe Validation extension
odsl.compositionBuild compositionComposer
odsl.data_reconciliationRun a data reconciliation taskThe Data Reconciliation extension

What an automation looks like​

An automation is made up of:

FieldDescription
targetThe target id, for example odsl.email
templateThe sentence describing the automation, made from the condition prefix and the target's template
iconThe icon shown in the portal
enabledWhether the automation is active, defaults to true
conditionsA list of conditions, each with source, service, id and action
propertiesThe values for the target's inputs, plus any default properties the target needs

The name of the automation is generated from the template by replacing each [input] with its value, and the owner is set to whoever saves it. The automation runs with the owner's policies.

Templates​

Each target has a template such as send an email to [to] with subject [subject]. The automation template is that text with a prefix describing the condition, for example:

When 'ICE.NDEX.NLB' is late, send an email to [to] with subject [subject]

The portal only lists an automation against an item when its template is exactly one of the offers the platform makes for that item, so always build the template from the rules on Automation Basics.

Creating an automation​

The explicit pattern below always works. Set the target, template, icon, conditions and properties yourself, including any default properties the target needs (here attachment set to false).

a = AutomationBuilder("dataset", "private", "ICE.NDEX.NLB").build()

c = SimpleObject()
c.source = "private"
c.service = "dataset"
c.id = "ICE.NDEX.NLB"
c.action = "late"
conds = []
conds.add(c)
a.conditions = conds

a.target = "odsl.email"
a.template = "When 'ICE.NDEX.NLB' is late, send an email to [to] with subject [subject]"
a.icon = "envelope-at text-outlook"
a.properties.to = "ops@mycompany.com"
a.properties.subject = "ICE.NDEX.NLB is late"
a.properties.attachment = false
a.enabled = true
save ${automation:a}

The builder shortcut​

If you know the exact text of one of the item's offers, withAutomationTemplate copies the target, icon, conditions and the target's default properties from that offer. You then only set the inputs and build the automation.

ab = AutomationBuilder("dataset", "private", "ICE.NDEX.NLB")
ab.withAutomationTemplate("When 'ICE.NDEX.NLB' is late, send an email to [to] with subject [subject]")
ab.set("to", "ops@mycompany.com")
ab.set("subject", "ICE.NDEX.NLB is late")
a = ab.build()
save ${automation:a}
Exact match only

withAutomationTemplate only works when the text matches an offer exactly, character for character. If nothing matches, no error is raised but the automation is left empty, so it has no target or conditions. Use the explicit pattern when in doubt.

The only builder methods are withAutomationTemplate, set and build. Everything else (target, template, icon, conditions, properties, enabled) is set on the automation returned by build().

Finding, testing and deleting automations​

// Find all your email automations
find ${automation} where target = "odsl.email"

// Get and delete an automation by its id
a = ${automation:"6720f1c2a5b3c4d5e6f70812"}
delete ${automation:"6720f1c2a5b3c4d5e6f70812"}

Automation ids are assigned by the platform. To test an automation once, call GET https://api.opendatadsl.com/api/automation/v1/<id>?_run=true, optionally adding &_ondate=YYYY-MM-DD. The run is logged in the automation log with the reason Test Run. Automations on * (any item) cannot be test run.


Properties added automatically​

As well as the properties you set, the target receives:

PropertyDescription
idThe id of the item that triggered the automation
ondateThe curve date or dataset ondate, when there is one
rangeThe range, for timeseries

Special @ properties​

Some targets accept special @ properties that control when the automation fires and what data the target receives.

PropertyDescription
@transformerThe name of a mustache script, or inline mustache text, applied to the data before the target receives it. Only for targets that support transformation
@propertyNameThe name of the property on the triggering item to filter on
@propertyValueThe value the property must have. Use * to match any change of the property

@propertyName and @propertyValue must both be set for the filter to apply:

  • On an update condition (targets with property-change support), the automation only fires when that property changed to the given value, or on any change of it when the value is *
  • On a create or delete condition (any target), the automation only fires when the record's property equals the given value

These properties change the template. For example:

UseTemplate
TransformerWhen 'ICE.NDEX.NLB' is late, transform the data using [@transformer], then send an email to [to] with subject [subject]
Property changeWhen property [@propertyName] on 'MY_OBJECT:CURVE' is set to [@propertyValue], send an email to [to] with subject [subject]
Property set on createWhen 'anything' is created with property [@propertyName] set to [@propertyValue], send an email to [to] with subject [subject]

See Automation Basics for the full template rules.


Custom targets​

You can create your own targets to pre-configure built-in targets for your team, or to back a target with your own ODSL script. Common patterns include:

  • Fixing a Teams or webhook URL so users never handle it directly
  • Fixing a storage account and container so users only need to give a path and file name
  • Backing a target with an ODSL script for logic that no built-in target covers

See Custom Targets for the full guide.