> For the complete documentation index, see [llms.txt](https://developers.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.docstudio.com/automation-executions-and-logs.md).

# Automation Executions and Logs

This document explains how to inspect automation executions, diagnose failed operations, and reprocess them.

Use this guide after an automation trigger runs. It helps you inspect the execution, diagnose a failed operation, and retry it when appropriate.

### Before you begin

You need an account ID and a bearer token for API authorization. You also need the automation to have run at least once.

Retrieve `traceId` from the execution list. Retrieve `spanId` from the log of the selected execution.

### View automation executions

Use the following endpoint to retrieve past automation executions:

```
GET /api/v1/automation/account/{accountId}/executions
```

Find the execution for the trigger that you want to inspect. Check its `state` before requesting the detailed log.

```
SUCCEED
```

An execution with state `SUCCEED` completed successfully. If its state is `FAILED`, use its `traceId` to retrieve the execution log.

### View an execution log

Use the following endpoint to retrieve the detailed log for an execution:

```
GET /api/v1/automation/account/{accountId}/execution/{traceId}/log
```

The log describes the individual workflow operations. It identifies the failed operation and its error.

Use the failed operation's `spanId` in subsequent requests. It identifies the operation without retrying the full workflow.

### Download a file from an execution

Some workflow operations can produce file artifacts during execution. Use the following endpoint to download a file associated with a specific operation:

```
GET /api/v1/automation/account/{accountId}/execution/{traceId}/log/{spanId}/file
```

Use the execution `traceId` and the required operation's `spanId`. Download the artifact when it helps diagnose the operation result.

### Reprocess a failed operation

Use the following endpoint to retry a failed workflow operation:

```
POST /api/v1/automation/account/{accountId}/execution/{traceId}/log/{spanId}/reprocess
```

Use the execution `traceId` and the failed operation's `spanId`. This request reprocesses the selected operation, rather than the entire workflow.

### Related topics

* [Create an Automation](/create-an-automation.md)
* [Credentials](/credentials.md)
* [Automation types](/automation-types.md)
