# Run a run again

**POST** `/api/runs/{id}/rerun`

Starts a new run of the same workflow with this run’s trigger data, marked as its retry.

Needs [an API token](https://docs.gorunner.io/api/authentication#scopes) with the **Run** permission for workflows (`workflow:run`).

## Parameters

### Path

- `id` · Required · UUID: The finished run to run again.

### Headers

- `Idempotency-Key` · Optional · string: Up to 255 characters. The same request with the same key within 24 hours answers the first result again, instead of acting twice.

## Which version runs

A production run runs again in production, on the version published now. A test run runs again as a test, on the version that ran (`executedVersionId`), or on the current draft when the draft ran. The run page and Runs do the same. Before v2026.10.31, this endpoint and Runs ran a test again on the current draft.

The limits of [Run a workflow](https://docs.gorunner.io/api/runs/run-workflow) apply: runs at once and the line’s caps. It takes no body.

## Responses

- 202 Accepted

  Started. `id` is the new run, and `versionNumber` the version it runs (left out when it runs the draft).

- 400 `VALIDATION_ERROR`

  `id` isn’t a UUID.

- 403 `FORBIDDEN`

  The token lacks the **Run** permission for workflows.

- 403 `FEATURE_OFF`

  A token made inside a partner’s product, where Run again is switched off.

- 403 `ACCOUNT_SUSPENDED`

  The workspace’s account is suspended. Nothing starts until it is resumed.

- 404 `NOT_FOUND`

  No run with this ID in the workspace, or its workflow was deleted.

- 409 `RUN_NOT_FINISHED`

  The run is queued, running or held. Cancel it first, or wait.

- 409 `WORKFLOW_NOT_LIVE`

  A production run whose workflow is paused or a draft. Publish it first.

- 409 `ACCOUNT_DELETED`

  The workspace’s account was deleted.

- 409 `CONFLICT`

  A request with this `Idempotency-Key` is still in progress. Try again shortly.

- 422 `PIECE_NOT_ALLOWED`

  A step uses an app this workspace may not use.

- 422 `VALIDATION_ERROR`

  This `Idempotency-Key` was already used with a different request.

- 429 `CONCURRENCY_LIMIT`

  The workflow is at its runs-at-once limit and is set to **Refuse**.

- 429 `RUNS_WAITING_LIMIT`

  Too many runs are already waiting, for the organization or this workflow.

- 500 `INTERNAL_ERROR`

  Nothing started. Try again.

- 503 `PIECES_UNAVAILABLE`

  GoRunner couldn’t check which apps this workspace may use. Nothing changed. Try again.

- 503 `STATE_UNAVAILABLE`

  The account’s state couldn’t be read. Nothing started. Try again.

Any call can also answer: [`401 UNAUTHORIZED`](https://docs.gorunner.io/errors#UNAUTHORIZED) · [`401 TOKEN_ENDED`](https://docs.gorunner.io/errors#TOKEN_ENDED) · [`403 TOKEN_SURFACE_OFF`](https://docs.gorunner.io/errors#TOKEN_SURFACE_OFF) · [`403 EMBED_NOT_ALLOWED`](https://docs.gorunner.io/errors#EMBED_NOT_ALLOWED) · [`403 EMBED_NOT_AVAILABLE`](https://docs.gorunner.io/errors#EMBED_NOT_AVAILABLE) · [`413 PAYLOAD_TOO_LARGE`](https://docs.gorunner.io/errors#PAYLOAD_TOO_LARGE) · [`415 INVALID_CONTENT_TYPE`](https://docs.gorunner.io/errors#INVALID_CONTENT_TYPE) · [`429 RATE_LIMITED`](https://docs.gorunner.io/errors#RATE_LIMITED) · [`503 PAUSED`](https://docs.gorunner.io/errors#PAUSED) · [`503 BUSY`](https://docs.gorunner.io/errors#BUSY) · [`503 SERVICE_UNAVAILABLE`](https://docs.gorunner.io/errors#SERVICE_UNAVAILABLE). See [Errors](https://docs.gorunner.io/api/errors#by-status).

Request

**curl**

```bash
GORUNNER="https://api.gorunner.io"
GORUNNER_TOKEN="grt_…"  # needs Run for workflows
RUN_ID="your-run-id"

curl -X POST "$GORUNNER/api/runs/$RUN_ID/rerun" \
  -H "Authorization: Bearer $GORUNNER_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"
```

**JavaScript**

```js
const GORUNNER = "https://api.gorunner.io";
const TOKEN = process.env.GORUNNER_TOKEN;
const RUN_ID = process.env.RUN_ID;

const res = await fetch(
  `${GORUNNER}/api/runs/${RUN_ID}/rerun`,
  {
    method: "POST",
    headers: {
        Authorization: `Bearer ${TOKEN}`,
        "Idempotency-Key": crypto.randomUUID(),
      },
  },
);
const { data } = await res.json();
```

**Python**

```python
import os, uuid, requests

GORUNNER = "https://api.gorunner.io"
TOKEN = os.environ["GORUNNER_TOKEN"]
RUN_ID = os.environ["RUN_ID"]

res = requests.post(
    f"{GORUNNER}/api/runs/{RUN_ID}/rerun",
    headers={
        "Authorization": f"Bearer {TOKEN}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
data = res.json()["data"]
```

Response · 202 Accepted

```json
{
  "data": {
    "id": "1d7f3b9e-2c4a-4e6b-8d0f-5a3c9e1b7d26",
    "retryOf": "8f0c41d2-6b7e-4c1a-9d3f-2a5b7c9e1f04",
    "status": "pending",
    "environment": "production",
    "versionNumber": 3
  }
}
```

**Every field**

It takes no body.

### Response · 202 Accepted

- `data` · object
  - `id` · UUID
  - `retryOf` · UUID
  - `status` · string
  - `environment` · string: One of `production`, `test`.
  - `versionNumber` · integer: The version the new run executes; absent when it runs the draft.

Related: [Run many runs again](https://docs.gorunner.io/api/runs/rerun-runs-bulk) · [Run a workflow](https://docs.gorunner.io/api/runs/run-workflow) · [Run again, cancel or delete runs](https://docs.gorunner.io/build/rerun-and-cancel)

Source: https://docs.gorunner.io/api/runs/rerun-run
