# Retrieve Automation Run

> GET /automations/:id/runs/:runId — retrieve one run including its step-by-step trace.

`GET /automations/:id/runs/:runId`

Retrieves the full details of a single [run](https://www.mailblastr.com/docs/automations/runs), including the `steps` array — the execution trace of every step in the run. The first entry is the trigger step.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The ID of the automation. |
| `runId` | string | Yes | The ID of the run to retrieve. |

**Node.js**

```js
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.automations.getRun('c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890');
console.log({ data, error });
```

**Ruby**

```ruby
require "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

Mailblastr::Automations.get_run("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", "a1b2c3d4-e5f6-7890-abcd-ef1234567890")
```

**PHP**

```php
$mailblastr = Mailblastr::client('mb_xxxxxxxxx');

$mailblastr->automations->getRun('c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890');
```

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

mailblastr.Automations.get_run("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", "a1b2c3d4-e5f6-7890-abcd-ef1234567890")
```

**Go**

```go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.mailblastr.com/automations/c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890", nil)
    req.Header.Set("Authorization", "Bearer mb_xxxxxxxxx")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    out, _ := io.ReadAll(res.Body)
    fmt.Println(string(out))
}
```

**Rust**

```rust
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = Client::new()
        .get("https://api.mailblastr.com/automations/c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890")
        .header("Authorization", "Bearer mb_xxxxxxxxx")
        .send()
        .await?;
    println!("{}", res.text().await?);
    Ok(())
}
```

**Java**

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.mailblastr.com/automations/c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890"))
    .header("Authorization", "Bearer mb_xxxxxxxxx")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

**.NET**

```csharp
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.mailblastr.com/automations/c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890");
request.Headers.Add("Authorization", "Bearer mb_xxxxxxxxx");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

**cURL**

```bash
curl -X GET 'https://api.mailblastr.com/automations/c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
mailblastr automations run c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd a1b2c3d4-e5f6-7890-abcd-ef1234567890
```

### Response

```json
{
  "object": "automation_run",
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "automation_id": "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd",
  "contact_id": "26e2b838-bf6d-4515-b6a7-17525b12b05a",
  "contact_email": "jordan@acme.com",
  "status": "completed",
  "error": null,
  "started_at": "2026-10-01T12:00:00.000Z",
  "completed_at": "2026-10-01T12:05:00.000Z",
  "created_at": "2026-10-01T12:00:00.000Z",
  "steps": [
    {
      "key": "start",
      "type": "trigger",
      "status": "completed",
      "started_at": "2026-10-01T12:00:00.000Z",
      "completed_at": "2026-10-01T12:00:01.000Z",
      "output": null,
      "error": null
    },
    {
      "key": "welcome",
      "type": "send_email",
      "status": "completed",
      "started_at": "2026-10-01T12:00:01.000Z",
      "completed_at": "2026-10-01T12:00:02.000Z",
      "output": {
        "to": "user@example.com",
        "email_id": "6278820d-2421-42d0-85f0-80e9e28c1c69",
        "template": {
          "id": "caa9851e-e7bf-4a50-a408-56024edc19c0",
          "variables": null
        }
      },
      "error": null
    }
  ]
}
```

Each step in the response includes:

| Field | Description |
| --- | --- |
| `key` | The unique key of the step in the automation graph. |
| `type` | The step type (e.g. `trigger`, `send_email`, `delay`). |
| `status` | The step's execution status: `completed`, `failed`, or `skipped`. |
| `started_at` | When the step started executing. |
| `completed_at` | When the step finished. |
| `output` | Output data from the step (if any). |
| `error` | Error details if the step failed. |
