# Automations

An automation runs a Process when something happens in Reecall. A Trigger listens for a System event, such as `exchange.completed`, and starts its Process. Each time a Process runs, Reecall records a Run that you can read through the API.

## How the resources fit together

<Mermaid chart={`flowchart LR
    X[Call ends] -->|produces| S[System event: exchange.completed]
    S -->|matches| T[Trigger]
    T -->|starts| R[Run]
    R -->|runs the steps of| P[Process]`} />

| Resource | What it is |
| --- | --- |
| [System event](/docs/system-events) | A fact Reecall announces when something happens, such as `exchange.started` or `exchange.completed`. |
| [Trigger](/docs/triggers) | A rule that starts a Process when a System event of its type occurs and its conditions pass. |
| [Process](/docs/processes) | A stored sequence of steps: call an API, generate structured data with an LLM, send an SMS or an email, branch, or loop over a list. |
| [Run](/docs/runs) | One time a Process runs, with its status, attempts, step records, and result. |

For example, a Trigger on `exchange.completed` can start a Process that asks an LLM to judge the conversation and posts the report to your CRM. Each completed Exchange produces one Run, and the Run shows whether the report reached your CRM.

## Runs are asynchronous

Starting a Process returns a Run ID at once. The steps run in the background, after the Run waits its turn in a queue. Read the Run to follow its status.

Nothing waits for a Run during a conversation. To act while the caller is on the line, give the Assistant a [tool](/docs/tools-and-mcps) instead.

## Exchange events and System events

The word event names two different things:

- **Exchange events** are the timeline of one conversation, in the Exchange's `events` list: session start, tool calls, transfers. See [Exchange events](/docs/events).
- **System events** are facts that Reecall announces to Triggers, such as `exchange.completed`. See [System events](/docs/system-events).

The `exchange.completed` System event carries the Exchange events of the conversation in its `data.events` field.

## Scope

Processes and Triggers belong either to one Project or to the whole Organization:

- A project Trigger starts on the System events of its Project. It can start a Process of its Project or an organization-level Process.
- An organization Trigger starts on the System events of every Project in the Organization. It can start an organization-level Process only.

A project-scoped API key creates resources in its Project. An organization-scoped key creates a project resource when you set `projectId`, and an organization-level resource when you leave it out. See [Authentication](/docs/authentication).

## Automations and Blueprints

A Process acts on data when something happens. A [Blueprint](/docs/blueprints-overview) creates the same set of resources for each new customer or Project, and it can create Processes and Triggers along with an Assistant.

## Next steps

- [Send a call report to a webhook](/docs/call-report-webhook) builds a Process and a Trigger end to end.
- [Email an alert when a Run fails](/docs/run-failure-email) watches your Runs with a Trigger on `run.failed`.
- [Triggers](/docs/triggers) covers conditions, scope, and retry policies.
- [Processes](/docs/processes) covers steps, input, and Variables.
- [Runs](/docs/runs) covers starting a Process through the API, statuses, retries, and limits.
