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

# marketingAutomations

> List marketing automations, optionally filtered by name, category, or whether they are running.

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

## Arguments

<ResponseField name="after" type="String">
  Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.
</ResponseField>

<ResponseField name="before" type="String">
  Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.
</ResponseField>

<ResponseField name="category" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-category">MarketingAutomationCategory</a>}>
  Only include marketing automations in this category.
</ResponseField>

<ResponseField name="enabled" type="Boolean">
  Only include marketing automations that are running (`true`) or paused (`false`).
</ResponseField>

<ResponseField name="first" type="Int">
  Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.
</ResponseField>

<ResponseField name="last" type="Int">
  Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.
</ResponseField>

<ResponseField name="orderBy" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-sort-key">MarketingAutomationSortKey</a>}>
  Which key to sort by (defaults to the first key, newest-first). Combine with `reverse` to flip direction.
</ResponseField>

<ResponseField name="query" type="String">
  Case-insensitive substring match on the marketing automation name. At most 200 characters.
</ResponseField>

<ResponseField name="reverse" type="Boolean">
  Reverses the sort direction selected by `orderBy` (or its default).
</ResponseField>

## Returns

<ResponseField name="marketingAutomations" type={<a href="/docs/api-reference/v3/pagination">MarketingAutomationConnection!</a>} required>
  A paginated list of MarketingAutomation items.

  <Expandable title="fields" lazyRender>
    <ResponseField name="edges" type={<a href="/docs/api-reference/v3/pagination">[MarketingAutomationEdge!]!</a>} required>
      The list of edges (each a node plus its pagination `cursor`).

      <Expandable title="fields" lazyRender>
        <ResponseField name="cursor" type="String!" required>
          Opaque cursor for this item; pass to `after`/`before` to page from here.
        </ResponseField>

        <ResponseField name="node" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation">MarketingAutomation!</a>} required>
          The item at this edge.

          <Expandable title="fields" lazyRender>
            <ResponseField name="analytics" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-analytics">MarketingAutomationAnalytics!</a>} required>
              Analytics for this marketing automation, grouped by what is being measured.
            </ResponseField>

            <ResponseField name="category" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-category">MarketingAutomationCategory!</a>} required>
              Which trigger family this marketing automation belongs to.
            </ResponseField>

            <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
              When the automation was created.
            </ResponseField>

            <ResponseField name="description" type="String">
              The merchant's description of what this automation does.
            </ResponseField>

            <ResponseField name="enabled" type="Boolean!" required>
              Whether the automation is currently running.
            </ResponseField>

            <ResponseField name="id" type="ID!" required>
              The id of this automation.
            </ResponseField>

            <ResponseField name="legacyId" type="String!" required>
              The automation's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
            </ResponseField>

            <ResponseField name="name" type="String!" required>
              The merchant-facing name of the automation.
            </ResponseField>

            <ResponseField name="publishedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
              When the current version was published. Null while it has only ever been a draft.
            </ResponseField>

            <ResponseField name="steps" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-step">[MarketingAutomationStep!]!</a>} required>
              The nodes that make up this automation, including graph edges as step ids. A type this API version does not model field-by-field is returned as MarketingAutomationUnknownStep.
            </ResponseField>

            <ResponseField name="stepsJson" type={<a href="/docs/api-reference/v3/reference/common/json">[JSON!]!</a>} required>
              `steps` with every field selected, as JSON: one element per step, with `__typename`. Null and invalid stored steps are \[]. Webhook header values and OAuth client secrets are omitted. Edits go through operations.
            </ResponseField>

            <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
              When the automation was last updated.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="nodes" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation">[MarketingAutomation!]!</a>} required>
      The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

      <Expandable title="fields" lazyRender>
        <ResponseField name="analytics" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-analytics">MarketingAutomationAnalytics!</a>} required>
          Analytics for this marketing automation, grouped by what is being measured.

          <Expandable title="fields" lazyRender>
            <ResponseField name="messaging" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-messaging-analytics">MarketingAutomationMessagingAnalytics!</a>} required>
              Email and SMS performance, read from the analytics warehouse: what was sent, how it was engaged with, and the orders and revenue attributed to it. Covers messages sent by the automation's own send steps; Recover conversations are measured separately and are not included here.

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

              <Expandable title="fields" lazyRender>
                **Arguments**

                <ResponseField name="attributionWindowDays" type="Int">
                  How many days after a message an order still counts toward it, 1-30.
                </ResponseField>

                <ResponseField name="endDate" type={<a href="/docs/api-reference/v3/reference/common/date">Date!</a>} required>
                  Last day to report on, inclusive, in the store's timezone. The range may span at most 400 days.
                </ResponseField>

                <ResponseField name="startDate" type={<a href="/docs/api-reference/v3/reference/common/date">Date!</a>} required>
                  First day to report on, inclusive, in the store's timezone. Must be on or before `endDate`, and the range may span at most 400 days.
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="category" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-category">MarketingAutomationCategory!</a>} required>
          Which trigger family this marketing automation belongs to.
        </ResponseField>

        <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
          When the automation was created.
        </ResponseField>

        <ResponseField name="description" type="String">
          The merchant's description of what this automation does.
        </ResponseField>

        <ResponseField name="enabled" type="Boolean!" required>
          Whether the automation is currently running.
        </ResponseField>

        <ResponseField name="id" type="ID!" required>
          The id of this automation.
        </ResponseField>

        <ResponseField name="legacyId" type="String!" required>
          The automation's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
        </ResponseField>

        <ResponseField name="name" type="String!" required>
          The merchant-facing name of the automation.
        </ResponseField>

        <ResponseField name="publishedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
          When the current version was published. Null while it has only ever been a draft.
        </ResponseField>

        <ResponseField name="steps" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-step">[MarketingAutomationStep!]!</a>} required>
          The nodes that make up this automation, including graph edges as step ids. A type this API version does not model field-by-field is returned as MarketingAutomationUnknownStep.
        </ResponseField>

        <ResponseField name="stepsJson" type={<a href="/docs/api-reference/v3/reference/common/json">[JSON!]!</a>} required>
          `steps` with every field selected, as JSON: one element per step, with `__typename`. Null and invalid stored steps are \[]. Webhook header values and OAuth client secrets are omitted. Edits go through operations.
        </ResponseField>

        <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
          When the automation was last updated.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="pageInfo" type={<a href="/docs/api-reference/v3/pagination">PageInfo!</a>} required>
      Pagination metadata for the current page.

      <Expandable title="fields" lazyRender>
        <ResponseField name="endCursor" type="String">
          Cursor of the last edge in this page; pass to `after` to page forward.
        </ResponseField>

        <ResponseField name="hasNextPage" type="Boolean!" required>
          Whether more items exist after this page (drives forward pagination with `first`/`after`).
        </ResponseField>

        <ResponseField name="hasPreviousPage" type="Boolean!" required>
          Whether more items exist before this page (drives backward pagination with `last`/`before`).
        </ResponseField>

        <ResponseField name="startCursor" type="String">
          Cursor of the first edge in this page; pass to `before` to page backward.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```graphql theme={null}
query {
  marketingAutomations(after: "...", before: "...", category: CUSTOM_EVENT, enabled: true, first: 10, last: 10, orderBy: CREATED_AT, query: "...", reverse: true) {
    nodes {
      category
      createdAt
      description
      enabled
      id
      legacyId
      name
      publishedAt
      # ...
    }
    pageInfo { hasNextPage endCursor }
  }
}
```


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