Easy Automations monitoring in Salesforce Marketing Cloud

We keep receiving questions about how people can monitor their automations’ statuses.

. As a typical example many companies have a very manual process to monitor if an automation has failed / successfully run:

  • Receive email alerts for each automation
  • Use an Excel file that list the day’s expected sends to manually track each day’s expected send
  • If an error, the result is logged  it in the excel file for  investigation

Unfortunately, there is not out of the box way to perform the monitoring of Automation Programs.

Some workarounds can be put together:

  • Use some email activities in your Automation Program, at different points which may help you track the progress
  • Request Salesforce to build a customized report which you can schedule

A popular SSJS script for Automation Health check below replicated by many developers retrieves the Automation status

var automationResultSet = Platform.Function.InvokeRetrieve(rr, retrieveStatus);

var Name = automationResultSet[0][“Name”];

var Status = automationResultSet[0][“Status”];

var ScheduledTime = automationResultSet[0][“ScheduledTime”];

if (ObjectId != “null”)


  if (Status == “-1”)

  var Print = ‘Error’;

  else if (Status == “0”)

  else if (Status == “1”)

  else if (Status == “2”)

  else if (Status == “3”)

  else if (Status == “4”)

  else if (Status == “5”)

  else if (Status == “6”)

  else if (Status == “7”)


   var Print = ‘InactiveTrigger’;

    Code Status


    -1   Error

     0   BuildingError

     1   Building

     2   Ready

     3   Running

     4   Paused

     5   Stopped

     6   Scheduled

     7   Awaiting Trigger

     8   InactiveTrigger

This code is not really helpful because the automation running time takes usually a few minutes, so the automation state is mostly paused, stopped, scheduled or awaiting for Trigger.

To get the automation error you need to run the script when the error is occurring, because after an error, automation is recovered and moves to a waiting state: scheduled or awaiting trigger.

It is not a result we want to see. What we need to consider is to look at the status of an automation instance, rather than the automation status in general.

To do it for a particular instance we would recommend retrieving the Automation instance and getting the instance status from over there.

    var cols = [‘Status’];

    var filter = {

      Property: “Name”,

      SimpleOperator: “equals”,

      Value: automation_name


    var result = proxy.retrieve(“AutomationInstance”, cols, filter);

SSJS script which uses this code retrieves the status of the automation instance: complete or error.

If the last instance of automation has failed then the status will be ERROR. Enumerating all automations in your business unit and retrieving the Automation instance allows you to monitor your automations. 

The SSJS script with the code above can be placed into automation which monitors other automations in a particular BU.

The result of the last automation instance can be placed into a data extension and emails can be sent to a particular audience who is in charge of automations.

Another option is to use the SSJS code into a Cloud page and to create a dashboard to see each automation instance last status.

“Digital Aquila –Marketing Automation experts” – can help you to optimize your Marketing Automation operational costs and identify the ROI you get from digital marketing efforts.

Digital Aquila are a team of marketing automation specialists with presence in Denver, New York, Atlanta, Boston, New York, Colorado Springs, Los Angeles, and Chicago. We also operate in Germany and Australia.

Digital Aquila is a certified Salesforce and HubSpot partner. Digital Aquila loves working with nonprofits, startups, travel, tourism and pharmaceutical businesses. Helping them to get the most of CRM and Marketing Automation.

Digital Aquila works with HubSpot, Salesforce, MailChimp, Moosend & Mailerite platforms.

We are marketing automation experts that work with you to grow your business.