---
schema_version: "1"
id: 26115caed6a0e2249d0c001ce0cabf97bc23e262eb5356716d438ffa012203c0
title: "Data View: Automation Instance"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mc_as_data_view_automation_instance.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mc_as_data_view_automation_instance.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 68503d2ca21934df74885de756328738489414de8445d5afdd29dee21627390f
description: Get a big-picture view of all automations within a tenant, and improve the efficiency and success rate of your automations by reviewing automation health. Query the _AutomationInstance data view in Automation Studio to prevent failures by identifying long-running processes, and fix failed automations by addressing the cause of failure.
products:
  - Marketing
  - Marketing Cloud Engagement
release: "264"
---
# Data View: Automation Instance

Get a big-picture view of all automations within a tenant, and improve the efficiency and success rate of your automations by reviewing automation health. Query the \_AutomationInstance data view in Automation Studio to prevent failures by identifying long-running processes, and fix failed automations by addressing the cause of failure.

## What This Data View Shows

- Automations that ran recently
- When an automation ran
- The duration of an automation
- Whether an automation succeeded, skipped, or failed
- The reason an automation failed
- The file that was being processed when a triggered automation failed

## What You Need to Know

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:50%"> <col style="width:50%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">How to activate the data view</td><td class="slds-cell-wrap" style="vertical-align:top;">Available by default</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">When data is available</td><td class="slds-cell-wrap" style="vertical-align:top;">Data in this view is available in real-time</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">How much data is available</td><td class="slds-cell-wrap" style="vertical-align:top;">Data for automations that ran during the past 6 months</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Data view scope</td><td class="slds-cell-wrap" style="vertical-align:top;">Single business unit</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Time zone</td><td class="slds-cell-wrap" style="vertical-align:top;">UTC</td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_journeys_and_automations-264-0-0-production-enus/e08cdd71-c1c1-4ae5-a5e9-8a6dad583ad4/images/icon_note.png)

Note This data view generates a row for each email address that’s receiving notifications about the automation. To prevent duplicate records, use a shared distribution list for notifications.

## Questions That You Can Answer

Which Automations Failed Yesterday?

Identify problems with your automations and prevent future failures by reviewing automations that failed yesterday.

```
SELECT automationcustomerkey
FROM   [_automationinstance]
WHERE  automationinstancestatus = 'Error'
       AND automationinstanceendtime_utc >= Dateadd(day, -2, Getutcdate())
```

Which Automations Completed Yesterday?

Confirm that the automations that you expected to run yesterday successfully completed.

```
SELECT automationcustomerkey
FROM   [_automationinstance]
WHERE  automationinstancestatus = 'Complete'
       AND automationinstanceendtime_utc >= Dateadd(day, -2, Getutcdate())
```

Which Automations Skipped Yesterday?

Skipped instances are a warning that an automation could be unhealthy, for example, there isn’t enough time between scheduled automations. Or, there were multiple instances of the same file drop automation queued when a running instance was stopped. Use this query to identify automations that were skipped yesterday, and decide whether to take action.

```
SELECT automationcustomerkey
FROM   [_automationinstance]
WHERE  automationinstancestatus = 'Skipped'
       AND automationinstanceendtime_utc >= Dateadd(day, -2, Getutcdate())
```

What Is the Average Duration of Each Automation?

Track the average performance of your automations to find trends and investigate problems before they impact critical processes. If an automation is slowing down over time, you can investigate the root cause and take corrective action. Use this query to determine each automation’s average duration over the past 6 months.

```
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 details of all automations with at least one run in the last 6 months, including the latest end time and status. Use this information to identify critical failures and automations that haven’t run recently.

```
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 
```

## Data View Columns

    
| Name | Description | DataType | Data Extension Data Type | Nullable |
| --- | --- | --- | --- | --- |
| MemberID | The unique ID of the business unit. | BIGINT | Number |   |
| AutomationName | The automation name. | NVARCHAR(400) | Text |   |
| AutomationDescription | The automation description. | NVARCHAR(400) | Text | X |
| AutomationCustomerKey | The unique ID of the automation. | NVARCHAR(400) | Text |   |
| AutomationType | The automation’s starting source. Possible values are Schedule, File Drop, or Trigger. | VARCHAR(9) | Text | X |
| AutomationNotificationRecipient\_Complete | The email address where notifications about completed automations are sent. | NVARCHAR(500) | Text | X |
| AutomationNotificationRecipient\_Error | The email address where notifications about automation errors are sent. | NVARCHAR(500) | Text | X |
| AutomationNotificationRecipient\_Skip | The email address where notifications about skipped automations are sent. | NVARCHAR(500) | Text | X |
| AutomationStepCount | The number of steps in the automation. | INT | Number |   |
| AutomationInstanceID | The unique ID of the automation run. | UNIQUEIDENTIFIER | Text |   |
| AutomationInstanceIsRunOnce | Whether the automation was set to run once. 1 = true, 0 = false. | BIT | Boolean |   |
| FilenameFromTrigger | For file drop and trigger automations, the file that started the automation. | NVARCHAR(4000) | Text | X |
| AutomationInstanceScheduledTime\_UTC | For scheduled automations, the time that the run was scheduled to begin. | DATETIMEOFFSET | Date | X |
| AutomationInstanceStartTime\_UTC | The time that the automation run started. This value is null if the automation was skipped. | DATETIMEOFFSET | Date | X |
| AutomationInstanceEndTime\_UTC | The time that the automation run ended. This value is null if the automation was skipped or is still running. | DATETIMEOFFSET | 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. | NVARCHAR(400) | 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. | NVARCHAR(4000) | Text | X |