{
    "$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": [
                {
                    "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" ]
                }
            ],
            "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_upcoming",
                    "type": "setWorkflowState",
                    "newWorkflowStateKey": "cust_compliance_documentation_sla_upcoming"
                }
            ]
        }
    ]
}