---
title: "Automation runs and debugging"
description: "Run states, why an automation pauses and what lifts it, and how to find, fix and retry a run that failed without sending anything twice."
url: https://www.unitpost.com/guides/automations-runs
section: Guides
updated: 2026-11-29
---
# Automation runs and debugging

## Automation runs and debugging

> Run states, why an automation pauses and what lifts it, and how to find, fix and retry a run that failed without sending anything twice.

A run is one contact's trip through one version. Its step timeline records every block it ran, what each did, and why it stopped.

### Run states

| Status | Meaning |
| --- | --- |
| `ACTIVE` | running a step now |
| `WAITING` | parked at a wait until its timer or event |
| `COMPLETED` | ran to the end of its path: an Exit block (the run's exit reason is the block's reason, else `finished`) or a block with nothing after it |
| `EXITED` | left early: an exit condition, the run's time limit, a removed block, a stale hold, or `restarted`: its own trigger event came again before it sent anything (a goal on the trigger event) |
| `GOAL_MET` | the policy's goal event happened, so the run ended |
| `FAILED` | a step failed (the exit reason names the block, and retry continues from it) or the run hit its action limit |
| `CANCELED` | someone canceled it |

### Why didn't someone get an email?

- List the automation's runs for that contact: `GET /v1/automations/{id}/runs?contact_id=con_…` (or `status=problems` for every failure).
- Open the run: `GET /v1/automations/runs/{run_id}`. The timeline names the block, its outcome (a skip reason like `not_subscribed` or `frequency_capped`, or the error), and where a live run is waiting and until when.
- Fix the cause in the draft (a template value with no source, a sender that stopped verifying, a webhook that fails), validate, and publish. If the automation paused itself (`pause_reason` `error_threshold`: one block failed 3 runs in a row), publishing the fix also resumes it and continues the held run.
- Retry the failed runs. They continue from the failed block on the live version; a message that already went out is never sent again.

**cURL**

```bash
curl -X GET 'https://www.unitpost.com/api/v1/automations/runs/run_123' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
```

**CLI**

```bash
unitpost automations get-run run_123
```

**Node.js**

```ts
import { Unitpost } from "unitpost";

const unitpost = new Unitpost(process.env.UNITPOST_API_KEY);

const { data, error } = await unitpost.automations.getRun("run_123");
```

**Python**

```python
from unitpost import Unitpost

unitpost = Unitpost()  # reads UNITPOST_API_KEY

result = unitpost.automations.get_run("run_123")
```

**Ruby**

```ruby
require "unitpost"

unitpost = Unitpost::Client.new  # reads UNITPOST_API_KEY

result = unitpost.automations.get_run("run_123")
```

**PHP**

```php
require 'vendor/autoload.php';

use Unitpost\Client;

$unitpost = new Client(); // reads UNITPOST_API_KEY

$result = $unitpost->automations->getRun("run_123");
```

**Laravel**

```php
use Unitpost\Laravel\Facades\Unitpost;

$result = Unitpost::automations()->getRun("run_123");
```

**Go**

```go
import (
    "context"
    "github.com/unitpostcom/unitpost-go"
)

client := unitpost.New() // reads UNITPOST_API_KEY
ctx := context.Background()

data, err := client.Automations.GetRun(ctx, "run_123")
```

**Java**

```java
import com.unitpost.Unitpost;

var unitpost = new Unitpost(); // reads UNITPOST_API_KEY

var result = unitpost.automations.getRun("run_123");
```

**Rust**

```rust
use unitpost::Unitpost;

let unitpost = Unitpost::new(); // reads UNITPOST_API_KEY

let result = unitpost.automations().get_run("run_123").await;
```

**.NET**

```csharp
using Unitpost;

var unitpost = new UnitpostClient(); // reads UNITPOST_API_KEY

var result = await unitpost.Automations.GetRun("run_123");
```

**cURL**

```bash
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/runs/retry' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "since": "2026-11-01T00:00:00Z",
    "limit": 50
  }'
```

**CLI**

```bash
unitpost automations retry-failed-runs \
  atm_123 \
  --since 2026-11-01T00:00:00Z \
  --limit 50
```

**Node.js**

```ts
import { Unitpost } from "unitpost";

const unitpost = new Unitpost(process.env.UNITPOST_API_KEY);

const { data, error } = await unitpost.automations.retryFailedRuns("atm_123", {
  since: "2026-11-01T00:00:00Z",
  limit: 50,
});
```

**Python**

```python
from unitpost import Unitpost

unitpost = Unitpost()  # reads UNITPOST_API_KEY

result = unitpost.automations.retry_failed_runs("atm_123", {
    "since": "2026-11-01T00:00:00Z",
    "limit": 50,
})
```

**Ruby**

```ruby
require "unitpost"

unitpost = Unitpost::Client.new  # reads UNITPOST_API_KEY

result = unitpost.automations.retry_failed_runs("atm_123", {
  since: "2026-11-01T00:00:00Z",
  limit: 50,
})
```

**PHP**

```php
require 'vendor/autoload.php';

use Unitpost\Client;

$unitpost = new Client(); // reads UNITPOST_API_KEY

$result = $unitpost->automations->retryFailedRuns("atm_123", [
    "since" => "2026-11-01T00:00:00Z",
    "limit" => 50,
]);
```

**Laravel**

```php
use Unitpost\Laravel\Facades\Unitpost;

$result = Unitpost::automations()->retryFailedRuns("atm_123", [
    "since" => "2026-11-01T00:00:00Z",
    "limit" => 50,
]);
```

**Go**

```go
import (
    "context"
    "github.com/unitpostcom/unitpost-go"
)

client := unitpost.New() // reads UNITPOST_API_KEY
ctx := context.Background()

data, err := client.Automations.RetryFailedRuns(ctx, "atm_123", map[string]any{
	"since": "2026-11-01T00:00:00Z",
	"limit": 50,
})
```

**Java**

```java
import com.unitpost.Unitpost;

var unitpost = new Unitpost(); // reads UNITPOST_API_KEY

var result = unitpost.automations.retryFailedRuns("atm_123", java.util.Map.of(
    "since", "2026-11-01T00:00:00Z",
    "limit", 50
));
```

**Rust**

```rust
use unitpost::Unitpost;

let unitpost = Unitpost::new(); // reads UNITPOST_API_KEY

let result = unitpost.automations().retry_failed_runs("atm_123", serde_json::json!({"since":"2026-11-01T00:00:00Z","limit":50})).await;
```

**.NET**

```csharp
using Unitpost;

var unitpost = new UnitpostClient(); // reads UNITPOST_API_KEY

var result = await unitpost.Automations.RetryFailedRuns("atm_123", new {
    since = "2026-11-01T00:00:00Z",
    limit = 50,
});
```

### Retry, skip a wait, cancel

- A paused automation holds its runs where they are, including the run whose step paused it; resume (or a publish) continues them.
- While paused, a trigger that fires starts nothing, and it isn't replayed on resume. A run on a wait keeps counting; when its next step comes due during the pause, the pause holds it there (the run reads `held: true`).
- A message held for more than 7 days by a pause is not sent on resume unless you pass `send_stale: true`.
- Retry continues a failed run from the block that failed, on the live version. A message that already went out is never sent again.
- Retrying many failed runs takes a `since` time and does up to 200 per call.
- Skip wait ends one waiting run's wait now: a Wait continues, a Wait for event takes its timeout path.
- Publishing a new version moves everyone mid-journey to it at the block they're on; a wait in progress keeps its end time.

### Why an automation is paused

A paused automation enrolls nobody and holds its runs where they are. `pause_reason` says why, and what lifts it:

| pause_reason | Meaning | What lifts it |
| --- | --- | --- |
| `user` | Someone paused it. Resume when ready. | Resume |
| `dependency_broken` | A template, segment, topic or sender it uses is gone or a template was unpublished under it, or a text step found no SMS number that can send. The run that hit it waits at that step. Publish the template again (or get a number live), then resume; for something deleted, point the block at another one and publish the automation, which also continues the held runs. | Resume |
| `dependency_unhealthy` | A template was unpublished or a sender domain is re-verifying. It resumes on its own once that recovers. | On its own |
| `error_threshold` | A block failed 3 runs in a row (`onError: pause_run`, the default); the last run is held. Fix the cause, then resume. | Resume |
| `budget_exhausted` | Kept for a spend limit; nothing sets it today. | Resume |
| `billing` | The plan's runs, email or SMS allowance is used up, or billing needs attention. It resumes on its own when the allowance returns. | On its own |
| `workspace_suspended` | The workspace is suspended. Contact support. | Unitpost support |
| `blocked` | Unitpost blocked the sending domain or SMS brand. It resumes on its own once the block is lifted. | On its own |
| `throttled` | The account review throttle holds sends. It resumes on its own once the throttle lifts. | On its own |
| `sending_paused` | The workspace's transactional email is paused (Settings → Deliverability says why). Resume the automation once it is resumed. A marketing pause never pauses an automation: only the runs at a marketing email wait, and they continue on their own. | Resume |
| `staff` | Unitpost support paused it. Only support can lift it. | Unitpost support |

### Archive, restore, delete

- Archive switches an automation off at once: nothing new starts, runs in progress are canceled (nothing more is sent to them), a running backfill stops, and it becomes read-only. It is deleted for good 30 days later unless it is unarchived; `delete_after` says when.
- Unarchive brings it back switched off: paused if it was ever published (resume it to send again), a draft if not (publish it). Unarchiving never sends by itself, and Resume first re-checks every template, segment, topic, sender and endpoint it uses, and any billing, block or review pause it had when it was archived.
- Delete is permanent and can't be undone: the automation is gone from every list and read, its runs in progress are canceled, and its run history ages out as usual. An archived one is deleted the same way when its `delete_after` passes.
- Archived automations are hidden from lists by default; `archived=true` lists only them.

**cURL**

```bash
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/archive' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
```

**CLI**

```bash
unitpost automations archive atm_123
```

**Node.js**

```ts
import { Unitpost } from "unitpost";

const unitpost = new Unitpost(process.env.UNITPOST_API_KEY);

const { data, error } = await unitpost.automations.archive("atm_123");
```

**Python**

```python
from unitpost import Unitpost

unitpost = Unitpost()  # reads UNITPOST_API_KEY

result = unitpost.automations.archive("atm_123")
```

**Ruby**

```ruby
require "unitpost"

unitpost = Unitpost::Client.new  # reads UNITPOST_API_KEY

result = unitpost.automations.archive("atm_123")
```

**PHP**

```php
require 'vendor/autoload.php';

use Unitpost\Client;

$unitpost = new Client(); // reads UNITPOST_API_KEY

$result = $unitpost->automations->archive("atm_123");
```

**Laravel**

```php
use Unitpost\Laravel\Facades\Unitpost;

$result = Unitpost::automations()->archive("atm_123");
```

**Go**

```go
import (
    "context"
    "github.com/unitpostcom/unitpost-go"
)

client := unitpost.New() // reads UNITPOST_API_KEY
ctx := context.Background()

data, err := client.Automations.Archive(ctx, "atm_123")
```

**Java**

```java
import com.unitpost.Unitpost;

var unitpost = new Unitpost(); // reads UNITPOST_API_KEY

var result = unitpost.automations.archive("atm_123");
```

**Rust**

```rust
use unitpost::Unitpost;

let unitpost = Unitpost::new(); // reads UNITPOST_API_KEY

let result = unitpost.automations().archive("atm_123").await;
```

**.NET**

```csharp
using Unitpost;

var unitpost = new UnitpostClient(); // reads UNITPOST_API_KEY

var result = await unitpost.Automations.Archive("atm_123");
```

### How it's doing

How a live automation is doing: `GET /automations/{id}/stats` gives its runs by status (the last `days`, default 7, and since it started), the goal rate, and per block of the live version the runs that entered, succeeded, failed, were skipped (by reason) or wait there now, marking the blocks runs fail at as `failing`, and while the workspace's marketing email is paused how many runs wait at a marketing email (`runs.held_marketing`; they send once it is resumed). `GET /automations/{id}/runs?block=` lists the runs at a block or that failed at it, and each run that ends failed sends the `automation.run.failed` webhook.

## Related

- [Automation events and webhooks](https://www.unitpost.com/guides/automations-events): Send custom events from your backend, list the ones you've sent with their payload keys, and get signed webhooks when an automation changes.
- [Automation billing](https://www.unitpost.com/guides/automations-billing): What an automation run costs, how many runs each plan includes, the usage notices, and what happens when the included runs are used up.
- [How it all fits together](https://www.unitpost.com/guides/overview): The contacts → segments → campaigns flow and the rules that keep it safe.
