> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/audience-and-activation/automate/automations-reference.md).

# Automations reference

The node model behind every automation, the schema it requires, and the usage limits that constrain it.

## What an automation is

Automation is the process of removing human intervention and relying on machines to coordinate repetitive tasks. Triggered by user activity, an automation launches a predefined sequence of actions.

{% hint style="info" %}
**The canonical example.** You run an online shop, and customers add products to their carts without completing the purchase. You *could* extract a list of those customers every day and load it into your email tool - and it would get tedious immediately. An automation instead sends the email itself, every time a customer adds a product and does not buy. See [Cart abandonment automation](/audience-and-activation/automate/cart-abandonment-automation.md).
{% endhint %}

{% hint style="info" %}
Automations is an extension module. Get in touch with your Account manager for information on enabling it.
{% endhint %}

## The model

An automation is composed of **nodes**, linked by **edges** - branches. A user travels from node to node along edges until the scenario is over. Depending on its type, a node has 0 or 1 edges in, and 0 to n edges out.

```mermaid
flowchart LR
    T["Trigger<br/>(exactly one)"] --> F["Flow control<br/>wait / if / split"]
    F --> A["Action<br/>email, segment, feed, custom"]
    A --> E((End))
    X["Exit condition"] -.->|"leaves from anywhere"| E
```

Three families of node, plus one construct that is not a node in the flow:

<table data-search="false"><thead><tr><th width="180">Family</th><th>What it does</th><th width="170">How many</th></tr></thead><tbody><tr><td><a href="/audience-and-activation/automate/automations-reference/triggers.md"><strong>Triggers</strong></a> (input nodes)</td><td>Define what makes a user enter the automation. Always at the start.</td><td><strong>Exactly one</strong> per automation</td></tr><tr><td><a href="/audience-and-activation/automate/automations-reference/actions.md"><strong>Actions</strong></a></td><td>Do something to or for the user travelling through: send an email, change segment membership, push to a feed, run a custom action.</td><td>Any number</td></tr><tr><td><a href="/audience-and-activation/automate/automations-reference/flow-control.md"><strong>Flow control</strong></a></td><td>Alter the natural flow: wait, branch on a condition, split into equal proportions.</td><td>Any number</td></tr><tr><td><a href="/audience-and-activation/automate/automations-reference/flow-control.md#exit-conditions"><strong>Exit conditions</strong></a></td><td>Make a user leave the automation from wherever they are, if a condition becomes true.</td><td>Any number</td></tr></tbody></table>

{% hint style="info" %}
Action nodes fire **asynchronously**: the action is triggered and the user moves on to the next node without waiting for it to complete.
{% endhint %}

## Required changes to the schema

Using automations may require changes to your schema. Your `UserPoint` object needs a `scenarios` property referring to a `UserScenario` object:

```graphql
type UserPoint @TreeIndexRoot(index:"USER_INDEX"){
  id: ID!
  creation_ts: Timestamp! @TreeIndex(index:"USER_INDEX")
  agents: [UserAgent!]!
  accounts: [UserAccount!]!
  emails: [UserEmail!]!
  activities: [UserActivity!]!
  profiles: [UserProfile!]!
  segments: [UserSegment!]!
  choices: [UserChoice!]!
  scenarios: [UserScenario!]!
}

type UserScenario {
  id: ID! @TreeIndex(index:"USER_INDEX")
  scenario_id: String! @TreeIndex(index:"USER_INDEX")
  execution_id: String! @TreeIndex(index:"USER_INDEX")
  node_id: String! @TreeIndex(index:"USER_INDEX")
  callback_ts: Timestamp @TreeIndex(index:"USER_INDEX")
  start_ts: Timestamp! @TreeIndex(index:"USER_INDEX")
  node_start_ts: Timestamp! @TreeIndex(index:"USER_INDEX")
  active: Boolean @TreeIndex(index:"USER_INDEX")
}
```

Schema work in general is documented in the **Setup & Monitor** section, under *Design your data model & schema*.

## Usage limits

Default limits are set per organisation. They are worth reading before designing a large scenario estate, because they constrain design rather than merely runtime.

<table data-search="false"><thead><tr><th width="330">Limit</th><th width="110">Default</th><th>Scope</th></tr></thead><tbody><tr><td>Scenarios in <code>PAUSED</code> or <code>ACTIVE</code> state</td><td><strong>100</strong></td><td>Per organisation</td></tr><tr><td>Scenarios with <code>ACTIVE</code> status</td><td><strong>20</strong></td><td>Per organisation</td></tr><tr><td>Nodes per scenario</td><td><strong>20</strong></td><td>Per scenario</td></tr><tr><td>Wait nodes in active scenarios</td><td><strong>20</strong></td><td>Per organisation</td></tr><tr><td>Users awoken per wait node per hour</td><td><strong>50,000</strong></td><td>Indicative service level objective</td></tr></tbody></table>

{% hint style="warning" %}
The first four are hard limits, checked when you create or activate a scenario - reaching one makes the request fail rather than degrading quietly. The fifth is an objective, not a cap: if more than 50,000 users pass a wait node in an hour, some may not be woken in a timely fashion.

Get in touch with your mediarithmics contact if you need higher limits.
{% endhint %}

## Where to go next

<table data-view="cards" data-search="false"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Triggers</strong></td><td>The three ways a user enters, and the re-entry rule.</td><td><a href="/audience-and-activation/automate/automations-reference/triggers.md">Triggers</a></td></tr><tr><td><strong>Actions</strong></td><td>Email, segment membership, feeds, custom actions.</td><td><a href="/audience-and-activation/automate/automations-reference/actions.md">Actions</a></td></tr><tr><td><strong>Flow control</strong></td><td>Wait, If, Split, and exit conditions.</td><td><a href="/audience-and-activation/automate/automations-reference/flow-control.md">Flow control</a></td></tr><tr><td><strong>Lifecycle, testing &#x26; analytics</strong></td><td>Draft to active, forcing a test user through, and reading the counters.</td><td><a href="/audience-and-activation/automate/automations-reference/lifecycle-testing-and-analytics.md">Lifecycle, testing &amp; analytics</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/audience-and-activation/automate/automations-reference.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
