> ## 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.

# updateAutomation

> Change an automation's settings. Its name and content are edited in a workspace. Null if the automation doesn't exist.

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

## Arguments

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

The automation's id.

**input** *required*

The settings to change.

**fields**

**enabled** `Boolean`

Turn the automation on or off. Turning it on needs a published version.

**versionStrategy**

Which version runs already in flight continue on.

## Returns

**updateAutomation**

An automation built in Developer › Automations: a trigger and the steps it runs. For email and SMS flows, use MarketingAutomation. To create or edit one, use a workspace (`createWorkspace`); read `guide/` in `automationCatalog` first.

**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`).

**fields**

**cursor** `String!` *required*

Opaque cursor for this item; pass to `after`/`before` to page from here.

**node** *required*

The item at this edge.

**nodes** *required*

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

**fields**

**automation** *required*

The automation this run belongs to.

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

**failure**

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

**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.

**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.

**pageInfo** *required*

Pagination metadata for the current page.

**fields**

**endCursor** `String`

Cursor of the last edge in this page; pass to `after` to page forward.

**hasNextPage** `Boolean!` *required*

Whether more items exist after this page (drives forward pagination with `first`/`after`).

**hasPreviousPage** `Boolean!` *required*

Whether more items exist before this page (drives backward pagination with `last`/`before`).

**startCursor** `String`

Cursor of the first edge in this page; pass to `before` to page backward.

**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`).

**fields**

**cursor** `String!` *required*

Opaque cursor for this item; pass to `after`/`before` to page from here.

**node** *required*

The item at this edge.

**nodes** *required*

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

**fields**

**createdAt** *required*

When the version was published.

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

This version as AutomationScript, Function code inline. Read `guide/script` in `automationCatalog` for the syntax.

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

The trigger this version runs on.

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

The version number, from 1.

**pageInfo** *required*

Pagination metadata for the current page.

**fields**

**endCursor** `String`

Cursor of the last edge in this page; pass to `after` to page forward.

**hasNextPage** `Boolean!` *required*

Whether more items exist after this page (drives forward pagination with `first`/`after`).

**hasPreviousPage** `Boolean!` *required*

Whether more items exist before this page (drives backward pagination with `last`/`before`).

**startCursor** `String`

Cursor of the first edge in this page; pass to `before` to page backward.

## Example

```graphql theme={null}
mutation {
  updateAutomation(id: "...", input: { ... }) {
    createdAt
    enabled
    id
    name
    publishedVersion
    revision
    runs {
      nodes {
        finishedAt
        id
        startedAt
        status
        version
      }
      pageInfo { hasNextPage endCursor }
    }
    script
    # ...
  }
}
```


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