> 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/triggers.md).

# Triggers

The three ways a user enters an automation, and the re-entry rule that governs all of them.

## What a trigger is

The **trigger** is what makes a user enter an automation. Each automation has **one and only one** trigger, and it is always the first node - which is why entering the automation builder starts by asking which type of trigger you want.

## The three types

<table data-search="false"><thead><tr><th width="220">Trigger</th><th>The user enters when</th><th width="230">Configured with</th></tr></thead><tbody><tr><td><strong>On segment entry</strong></td><td>They enter a specific segment. The automation is linked to segment computation.</td><td>A <a href="/audience-and-activation/build-your-audiences/segment-reference/segment-types/query-segment.md">Query</a> or <a href="/audience-and-activation/build-your-audiences/segment-reference/segment-types/list-import-segment.md">List</a> segment</td></tr><tr><td><strong>On segment exit</strong></td><td>They leave a specific segment. Also linked to segment computation.</td><td>A <a href="/audience-and-activation/build-your-audiences/segment-reference/segment-types/query-segment.md">Query</a> segment</td></tr><tr><td><strong>React to an event</strong></td><td>They cause a specified event.</td><td>A query on incoming activities</td></tr></tbody></table>

{% hint style="info" %}
The first two run at the pace of segment computation - by default daily. **React to an event** runs at the pace of ingestion. If the scenario has to act within minutes of a behaviour, it needs an event trigger, not a segment trigger.
{% endhint %}

## React to an event, in detail

The configuration specifies which events trigger the automation. In the **Advanced** view you can add field conditions - for example to trigger only on events taking place after a certain date.

Two constraints on the query:

* **Only fields carrying the `@TreeIndex` directive** in the runtime schema can be used.
* The query is evaluated **in the ingestion pipeline**, on incoming activities - after session aggregation and processing by activity analysers, and before storage in the datamart.

{% hint style="info" %}
That evaluation point is why an event trigger is fast, and also why it sees the activity as the pipeline produced it rather than as the datamart later stores it.
{% endhint %}

## Re-entry

{% hint style="danger" %}
**If a user enters a scenario, any attempt to make that user enter the same scenario again fails until the user exits it.**
{% endhint %}

This single rule explains most surprising automation behaviour, and it is the reason [exit conditions](/audience-and-activation/automate/automations-reference/flow-control.md#exit-conditions) matter as much as triggers:

* A user sitting in a 2-hour wait node cannot be re-triggered by a second qualifying event during those 2 hours.
* A scenario with a long wait and no exit condition can hold a user for a long time, silently excluding them from re-entry.
* A user who leaves through an exit condition becomes eligible again immediately.

Design the exit before you design the wait.

## Related pages

<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>Flow control</strong></td><td>Wait, If, Split, and the exit conditions that free a user.</td><td><a href="/audience-and-activation/automate/automations-reference/flow-control.md">Flow control</a></td></tr><tr><td><strong>Build your audience from live user activity</strong></td><td>Choosing an automation over Edge or a campaign segment.</td><td><a href="/audience-and-activation/build-your-audiences/target-your-audience-based-on-criteria/build-your-audience-from-live-user-activity.md">Build your audience from live user activity</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/triggers.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.
