SFMC Automation Health Check
Updated: Aug 4, 2020
Need for Automation Health Check:
In most of the business world, to implement a use case in the Salesforce Marketing Cloud, we need to create lots and lots of automation.
It will be very hard to keep track of which automation runs and which automation didn't run or it failed everyday.
Why Do I Need to Monitor?
Let's say that one of the automation got error-ed out due to some new error or someone who has worked on it but they didn't activate it unknowingly or a file drop automation didn't run then you will either be with no data or wrong data.
This will have a series impact on business. I have seen people spend some hours monitoring automation as an ad-hoc activity. Now let's eliminate those!
There are a lot of blogs today, which will let you know how to pull all the automation status from Salesforce Marketing Cloud or a hard coded value of customer key appended on SSJS itself.
But the problem is, you would have created lots of automation and some you wouldn't even need. Why do you want to keep track of those?
In this blog, we are going to see how SSJS gets only the automation status which you needed to see in the Org. You can specify which automation you need to see in a data extension then run the SSJS in the org which will upserts the data into data extension with automation status. Post that you can send an email to SFMC Admins with those data extension records.
How cool is that!
Below SSJS will give you an idea of which automation has run which doesn't:
What does the above code do?
It is looking up all the rows in the data extension named 'Automation_Status'.
Taking each customer key one by one which is present in the same data extension.
Getting the status for each automation using the customer key and upsert in the same data extension
Create a data extension with columns as mentioned in the screenshot. In the above case its 'Automation_Status'
Add records for which you need to monitor Automation status
Specify the automation name and customer key
You can check on the same data extension once the cloud page or automation activity completes.
You can see that the status and scheduled time would have added for the specified automation in data extension.
You can also use this data in data extension to send an email to specified people who need to monitor.
Below is the code to send an email notification (view code snippet) which will pull the results from the same data extension and add it into email.
Hope now you have an idea of how to implement notification on Automation Studio status :).
Please feel free to leave your feedback/comment in case of any queries.