Blog.
Data View: Automation Instance
By monitoring automation health, you may get a broad picture perspective of all automations within your business unit and increase the efficiency and success rate of your automations.
In Automation Studio, query the _AutomationInstance data view to prevent failures by identifying long-running processes and to solve failed automations by addressing the reason of failure.
Create the Data extension first, which will hold the query output.
Data extension columns
NAME | DESCRIPTION | DATA EXTENSION DATA TYPE | NULLABLE |
---|---|---|---|
MemberID | The unique ID of the business unit. | Number | |
AutomationName | The automation name. | Text | |
AutomationDescription | The automation description. | Text | X |
AutomationCustomerKey | The unique ID of the automation. | Text | |
AutomationType | The automation’s starting source. Possible values are Schedule, File Drop, or Trigger. | Text | |
AutomationNotificationRecipient_Complete | The email address where notifications about completed automations are sent. | Text | X |
AutomationNotificationRecipient_Error | The email address where notifications about automation errors are sent. | Text | X |
AutomationNotificationRecipient_Skip | The email address where notifications about skipped automations are sent. | Text | X |
AutomationStepCount | The number of steps in the automation. | Number | |
AutomationInstanceID | The unique ID of the automation run. | Text | |
AutomationInstanceIsRunOnce | Whether the automation was set to run once. 1 = true, 0 = false. | Boolean | |
FilenameFromTrigger | For file drop and trigger automations, the file that started the automation. | Text | X |
AutomationInstanceScheduledTime_UTC | For scheduled automations, the time that the run was scheduled to begin. | Date | X |
AutomationInstanceStartTime_UTC | The time that the automation run started. This value is null if the automation was skipped. | Date | X |
AutomationInstanceEndTime_UTC | The time that the automation run ended. This value is null if the automation was skipped or is still running. | Date | X |
AutomationInstanceStatus | The status of the automation run when the data view is queried. Possible values are QueuedFile, Initialized, Executing, Stopped, Complete, or Error. | Text | |
AutomationInstanceActivityErrorDetails | The message from the error log, if applicable. If a system or unclassified error occurs, the value is System Error. If multiple errors occur, only the first message is displayed. To get details on multiple errors, use the _AutomationActivityInstance view. | Text | X |
Which Automations Failed Yesterday?
By evaluating automations that failed yesterday, you can identify deficiencies with your automations and prevent future failures.
1234 | SELECT automationcustomerkey, AutomationInstanceActivityErrorDetails, AutomationName FROM [_automationinstance] WHERE automationinstancestatus = 'Error' AND automationinstanceendtime_utc >= Dateadd(day, -2, Getutcdate()) |
Which Automations Completed Yesterday?
Check that yesterday’s automations ran.
1234 | SELECT automationcustomerkey, AutomationInstanceActivityErrorDetails, AutomationName FROM [_automationinstance] WHERE automationinstancestatus = 'Complete' AND automationinstanceendtime_utc >= Dateadd(day, -2, Getutcdate()) |
Which Automations Skipped Yesterday?
Skipped activities indicate an unhealthy automation, such as too little time between scheduled automations. Or, when a running instance was halted, several file drop automation instances waited. Find automations skipped yesterday and decide whether to act using this query.
1234 | SELECT automationcustomerkey, AutomationInstanceActivityErrorDetails, AutomationName FROM [_automationinstance] WHERE automationinstancestatus = 'Skipped' AND automationinstanceendtime_utc >= Dateadd(day, -2, Getutcdate()) |
What Is the Average Duration of Each Automation?
Check your automations’ average performance for patterns and issues before they affect crucial processes. If an automation slows down, find out why and fix it. This query calculates each automation’s average duration for the past 1–31 days.
12345 | SELECT automationcustomerkey, Avg(Datediff(minute, automationinstancestarttime_utc, automationinstanceendtime_utc)) AS AvgDuration FROM [_automationinstance] automation GROUP BY automationcustomerkey |
What Is the Latest End Time and Status of Each Automation?
View all automations with at least one run in the previous 6 months, including the latest end time and status. Identify critical failures and inactive automations using this data.
1234567891011121314 | SELECT automationcustomerkey, automationinstanceid, automationinstancestatus, automationinstanceendtime_utc FROM (SELECT automationcustomerkey, automationinstanceid, automationinstancestatus, automationinstanceendtime_utc, Row_number() OVER ( partition BY automationcustomerkey ORDER BY automationinstanceendtime_utc DESC) AS run_count FROM [_automationinstance]) AS instances WHERE run_count = 1 |