# Retry run

`runs_retry`

Lets a run that failed go on from the step it failed at, on the version it entered with. An email it failed to send is really sent this time. It is refused for a run that did not fail.

Needs the scope: `automations:write`

## Arguments

- `id` (string, required): The id of the item. Up to 64 characters.
- `automationId` (string, required): The id of the automation. Up to 64 characters.

## Returns

The answer comes back under `structuredContent`, with the same JSON as text in `content`. A call the API refuses comes back with `isError` set, and the code and the message under `structuredContent.error`. [MCP](https://opensend.sh/docs/mcp) shows how to connect a client.

- `object` ("automation_run"): Always `automation_run`.
- `id` (string): The id of the run.
- `automationId` (string): The id of the automation.
- `version` (integer): The version of the automation the run follows.
- `email` (string): The address of the person.
- `contactId` (string | null): The id of their contact, or `null` for a bare address.
- `status` (string): Where the run stands: `running`, `waiting`, `completed`, `exited`, `failed` or `canceled`. One of: `running`, `waiting`, `completed`, `exited`, `failed`, `canceled`.
- `stepId` (string | null): The id of the step it is at, or `null` once it has ended.
- `source` (string): What started it: the name of the event, or `schedule`, `date`, `manual` or `test`.
- `test` (boolean): `true` for a test run.
- `reason` (string | null): Why it ended before the end of its path, or `null`. One of: `exit_step`, `goal`, `unsubscribed`, `contact_deleted`, `automation_deleted`, `automation_stopped`, `missing_variable`, `send_refused`, `step_failed`, `canceled`.
- `detail` (string): More about how it ended. Empty while it is going on.
- `wakeAt` (string | null): When a waiting run goes on, or `null`.
- `startedAt` (string): When the run started.
- `finishedAt` (string | null): When it ended, or `null`.
- `data` (Record<string, unknown>): The data of what started it.
- `steps` (object[]): What each step did, oldest first.
- `steps[].id` (string): The id of the step.
- `steps[].kind` (string): What the step does. One of: `send_email`, `delay`, `wait_until`, `wait_for_event`, `condition`, `branch`, `split`, `update_contact`, `delete_contact`, `add_to_audience`, `remove_from_audience`, `webhook`, `send_event`, `exit`.
- `steps[].name` (string): The name of the step.
- `steps[].outcome` (string): What happened: `sent`, `done`, `waiting`, `waited`, `yes`, `no`, `skipped` or `failed`. One of: `sent`, `done`, `waiting`, `waited`, `yes`, `no`, `skipped`, `failed`.
- `steps[].detail` (string): More about it, such as why it failed. Often empty.
- `steps[].emailId` (string | null): The id of the email it sent, or `null`.
- `steps[].at` (string): When it happened.

## Example

MCP:

```json
{
  "name": "runs_retry",
  "arguments": {
    "automationId": "auto_receipt",
    "id": "run_03"
  }
}
```

Answer, under structuredContent:

```json
{
  "object": "automation_run",
  "id": "run_03",
  "automationId": "auto_receipt",
  "version": 1,
  "email": "katherine@example.com",
  "contactId": null,
  "status": "waiting",
  "stepId": "wait_review",
  "source": "order.paid",
  "test": false,
  "reason": null,
  "detail": "",
  "wakeAt": "2026-11-30T09:30:00.000Z",
  "startedAt": "2026-11-27T04:30:00.000Z",
  "finishedAt": null,
  "data": {
    "order_id": "1038"
  },
  "steps": [
    {
      "id": "receipt",
      "kind": "send_email",
      "name": "Receipt",
      "outcome": "failed",
      "detail": "No value for total. Send it in the data of the event, or set it on the step.",
      "emailId": null,
      "at": "2026-11-27T04:30:00.000Z"
    },
    {
      "id": "receipt",
      "kind": "send_email",
      "name": "Receipt",
      "outcome": "sent",
      "detail": "",
      "emailId": "em_10",
      "at": "2026-11-27T09:30:00.000Z"
    },
    {
      "id": "wait_review",
      "kind": "delay",
      "name": "Delay",
      "outcome": "waiting",
      "detail": "Until 2026-11-30T09:30:00.000Z.",
      "emailId": null,
      "at": "2026-11-27T09:30:00.000Z"
    }
  ]
}
```
