In this example, we will demonstrate how to configure an automation rule that detects deadlines, such as SLA dates for data products
The rule will first identify data products that have not been refreshed by their expected SLA date, and immediately notify the responsible users.
The components of the rule will need the following configuration:
| Trigger | Stream | Action |
|---|---|---|
| Daily schedule | Data products where the SLA Date is in 7 days | Set object status to SLA Upcoming, Notify the Owner and Steward |
Download the example automation rule here: Example - Deadline Notification.json
Download the example notification templates here: Example - Deadline Notification (Notification Template).json
Trigger
First, schedule the rule to run daily at 8 am using the cronPattern. This ensures that any SLA deadlines are checked for regularly.
{
"$schema": "https://schema.dawiso.com/automation-schema.json",
"automations": [
{
"key": "cust_deadline_notification",
"name": "Deadline Notification",
"triggers": [
{
"key": "schedule",
"type": "schedule",
"cronPattern": " 0 8 * * * "
}
]
}
]
}
Stream
Next, let’s define the conditions for selection objects. This stream filters for:
- Objects in the Compliance and Controls space
- Objects from the Compliance Documentation application
- Objects where the SLA Date is 7+ days older than today
{
"$schema": "https://schema.dawiso.com/automation-schema.json",
"automations": [
{
"key": "cust_deadline_notification",
"name": "Deadline Notification",
"triggers": [...],
"stream": [
{
"key": "logicalFormula",
"type": "logicalFormula",
"operator": "and",
"clauses": [
{
"type": "spaceFilter",
"operand": "in",
"values": ["Compliance and Controls"]
},
{
"type": "applicationFilter",
"operand": "in",
"applicationKeys": ["cust_compliance_documentation_app"]
},
{
"type": "attributeFilter",
"operand": "todayPlusXGreaterThan",
"attributeTypeKey": "cust_compliance_documentation_sla_date",
"value": "7"
}
]
},
{
"key": "selectUserObjectRelation",
"type": "selectUserObjectRelation",
"userRelationTypeKeys": ["core_business_owner", "core_steward"]
}
]
}
]
}
This example uses custom configuration. The example Compliance Documentation application (cust_compliance_documentation_app) is defined in a custom package, including the attribute SLA Date (cust_compliance_documentation_sla_date).
To use this application, either create a custom package using the same keys or replace the keys with values from your own packages.
This example rule is provided for illustrative purposes and will not work out of the box without these adjustments.
Action
Finally, these actions will be taken when an object meets our stream criteria:
- The workflow state of the object is set to SLA Upcoming.
- A notification is sent via email and in-app to the selected Owner and Steward.
To send the notification, a text template must be assigned using the notificationTemplateKey. The content of the notification is not defined directly in the automation rule, it must be configured separately in a package.
{
"$schema": "https://schema.dawiso.com/automation-schema.json",
"automations": [
{
"key": "cust_deadline_notification",
"name": "Deadline Notification",
"triggers": [...],
"stream": [...],
"actions": [
{
"key": "sendNotification_web_socket",
"type": "sendNotification",
"notificationTemplateKey": "cust_automation_notification_templates_web_socket"
},
{
"key": "sendNotification_email",
"type": "sendNotification",
"notificationTemplateKey": "cust_automation_notification_templates_email"
},
{
"key": "setWorkflowState_sla_upcoming",
"type": "setWorkflowState",
"newWorkflowStateKey": "cust_compliance_documentation_sla_upcoming"
},
]
}
]
}
This example uses more custom configuration, including:
- The workflow state key cust_compliance_documentation_sla_upcoming.
- Notification templates cust_automation_notification_templates. See the example below. These values are for illustration purposes only, to use them in your rule, make sure to first configure them in a package.
Notification Template
The notification templates used in this example are defined in a custom package (Settings > Packages > Resources). These templates are fully customizable and can be adapted to suit the needs of your organization, for example, to reflect internal terminology, tone, or escalation rules.
Click here to show the example message.
Title: Document ‘Information Security Policy’ Requires Update Before SLA Deadline
The document Information Security Policy is approaching its SLA deadline on Monday, 1 January 20xx. Please update the document as soon as possible. For support, contact the assigned Steward at name.surname@example.com.
These templates must exist in your environment for the rule to work. You can use your own templates or use our provided example.
{
"$schema": "https://schema.dawiso.com/package-schema.json",
"package": {
"key": "cust_automation_notification_templates",
"name": "Automation Notification Templates",
"autoInstall": false,
"assets": {
"notificationTemplates": [
{
"key": "web_socket",
"notificationTypeKey": "automation",
"notificationChannelKey": "web_socket",
"titleTemplate": "Document '{{currentObject}.name()}' Requires Update Before SLA Deadline",
"descriptionTemplate": "The document {{currentObject}.link()} is approaching its SLA deadline on {{currentObject}.attribute('cust_compliance_documentation_sla_date').format('D')}}. Please update the document as soon as possible. For support, contact the assigned Steward at {{currentObject}.userRelation('core_steward').email()}}.",
"enabled": true
},
{
"key": "email",
"notificationTypeKey": "automation",
"notificationChannelKey": "email",
"titleTemplate": "Document '{{currentObject}.name()}' Requires Update Before SLA Deadline",
"descriptionHtmlTemplate": "The document {{currentObject}.link()} is approaching its SLA deadline on {{currentObject}.attribute('cust_compliance_documentation_sla_date').format('D')}}. Please update the document as soon as possible. For support, contact the assigned Steward at {{currentObject}.userRelation('core_steward').email()}}.",
"enabled": true
}
]
}
}
}