> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# automationRun

> Fetch a run by id, with its steps. Runs are deleted 30 days after they finish.

**Required scopes:** [`automations_read`](/docs/api-reference/v3/reference/scopes#scope-automations_read)

## Arguments

**id** `ID!` *required*

The run's id.

## Returns

**automationRun**

One execution of an automation. Runs are deleted 30 days after they finish.

**fields**

**automation** *required*

The automation this run belongs to.

**Requires:** [`automations_read`](/docs/api-reference/v3/reference/scopes#scope-automations_read)

**fields**

**createdAt** *required*

When the automation was created.

**enabled** `Boolean!` *required*

Whether the automation runs when its trigger fires. Change it with `updateAutomation`.

**id** `ID!` *required*

The id of this automation.

**name** `String!` *required*

The automation's name.

**publishedVersion** `Int`

The latest published version; null until first published.

**revision** `String!` *required*

The draft's revision. Opaque; pass it to `publishAutomation` as `expectedRevision`.

**runs** *required*

Runs, newest first. Runs are deleted 30 days after they finish.

**Requires:** [`automations_read`](/docs/api-reference/v3/reference/scopes#scope-automations_read)

**fields**

**Arguments**

**after** `String`

Returns runs after this cursor.

**first** `Int`

Returns the first N runs (max 100, default 25).

**status**

Only runs with one of these statuses.

**Fields**

**edges** *required*

The list of edges (each a node plus its pagination `cursor`).

**nodes** *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**pageInfo** *required*

Pagination metadata for the current page.

**script** `String!` *required*

The draft as AutomationScript, Function code inline. To change it, open a workspace with `createWorkspace`.

**triggerKind** `String!` *required*

The draft's trigger kind.

**updatedAt** *required*

When the automation was last changed.

**versionStrategy** *required*

Which version runs already in flight continue on.

**versions** *required*

Published versions, newest first.

**Requires:** [`automations_read`](/docs/api-reference/v3/reference/scopes#scope-automations_read)

**fields**

**Arguments**

**after** `String`

Returns versions after this cursor.

**first** `Int`

Returns the first N versions (max 100, default 25).

**Fields**

**edges** *required*

The list of edges (each a node plus its pagination `cursor`).

**nodes** *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**pageInfo** *required*

Pagination metadata for the current page.

**failure**

Why the run failed; null unless `status` is FAILED.

**fields**

**message** `String!` *required*

The error the run stopped on.

**stepId** `String`

The step that failed, or null for the run as a whole.

**finishedAt**

When the run finished; null while running or waiting.

**id** `ID!` *required*

The id of this run.

**startedAt** *required*

When the run started.

**status** *required*

Where the run is in its lifecycle.

**steps** *required*

The steps the run executed, in order, with their inputs, outputs and effects.

**fields**

**effects** *required*

Side effects the step performed, each with its result.

**finishedAt**

When the step finished; null while it runs or waits.

**inputs**

The step's evaluated config.

**kind** `String!` *required*

The step's kind.

**note** `String`

A note the step left, such as why it was skipped.

**outcome** `String`

completed, disabled, failed or cancelled; null while running.

**output**

What the step produced, as later steps read it.

**port** `String`

The output port the run left the step by.

**startedAt** *required*

When the step started.

**stepId** `String!` *required*

The step's id in the automation's script.

**version** `Int!` *required*

The automation version the run is on. A waiting run that a publish moves to a newer version keeps reporting the old one until it resumes.

## Example

```graphql theme={null}
query {
  automationRun(id: "...") {
    finishedAt
    id
    startedAt
    status
    version
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.