> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getnetra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Automations Overview

> Use Netra automations to notify your team by email, Slack, webhook, or GitHub Actions when prompts change, test runs finish, or red team runs complete.

Automations notify you when something changes in your project. When a prompt gets a new version, a test run's evaluation completes, or a red team run finishes, Netra sends a message to the destinations you choose: an email inbox, a Slack channel, your own HTTPS endpoint, or a GitHub Actions workflow.

> [card] React to prompt changes
>
> Get notified when a new version is published or a `production` label moves.

> [card] Track test runs
>
> Get an evaluation report when a run finishes, or an alert when a test run fails.

> [card] Follow red team runs
>
> Know when red team runs finish or fail.

> [card] Trigger your pipelines
>
> Start a GitHub Actions workflow or call your own service on every event.

## Automations vs. Alert Rules

Both features send notifications to the same [contact points](https://docs.getnetra.ai/Account-settings/project.md#contact-points), but they answer different questions.

| | Automations | Alert Rules |
| - | - | - |
| **Fires on** | A lifecycle event (updated, evaluation completed, failed) | A metric crossing a threshold |
| **Watches** | Prompts, test runs, red team runs | Traces and spans (cost, latency, errors) |
| **Example** | "Tell #ml-team when a new prompt version is published" | "Tell on-call when p95 latency exceeds 5s" |

Use [Alert Rules](https://docs.getnetra.ai/Alert-rules/Alert-rules.md) for metric thresholds and automations for lifecycle events.

## How Automations Work

Every automation has four parts:

| Part | Description |
| - | - |
| **Source** | What the automation watches: a prompt, an evaluation's test runs, or a red team config's runs |
| **Trigger events** | Which events fire it, such as `evaluation_completed` or `test_run_failed` |
| **Conditions** | Optional filters that must all match, such as "Label is `production`" |
| **Destinations** | One or more contact points that receive the message |

When an event happens, Netra checks every enabled automation in the project. If the source and event match and every condition holds, Netra queues one delivery per destination. Each delivery is tracked in the automation's [delivery history](https://docs.getnetra.ai/Automations/creating-automations.md#delivery-history).

## Sources and Events

| Source | Events | Fires when |
| - | - | - |
| **Prompt** | `updated` | A new version is published, or a label is attached or removed |
| | `deleted` | A prompt is deleted |
| **Test run** | `test_run_triggered` | A test run starts |
| | `test_run_failed` | The test run as a whole fails, for example when every item fails to run |
| | `evaluation_completed` | Every item in the run has finished evaluating. The message includes how many evaluators and items passed. |
| **Red team run** | `redteam_run_completed` | A red team run finishes |
| | `redteam_run_failed` | A red team run fails |

> [!TIP]
>
> A prompt's `updated` event covers several kinds of change. Add a **Change** condition to fire only on the ones you care about, such as **New version published**. See [Conditions](https://docs.getnetra.ai/Automations/creating-automations.md#add-conditions).

## Destinations

Automations deliver to the project's contact points. Four types are supported:

| Type | What you receive |
| - | - |
| **Email** | A formatted email with the event summary. Test run and red team events also include a link to Netra. |
| **Slack** | A Slack message with the event details. Test run and red team events also include a **View in Netra** link. |
| **Webhook** | A signed JSON `POST` to your HTTPS endpoint |
| **GitHub dispatch** | A `repository_dispatch` event that triggers a GitHub Actions workflow |

See [Destinations](https://docs.getnetra.ai/Automations/destinations.md) for setup steps and the payload format.

***

## See Also

> [card] [Create an Automation](https://docs.getnetra.ai/Automations/creating-automations.md)
>
> Set up triggers, conditions, and destinations

> [card] [Destinations](https://docs.getnetra.ai/Automations/destinations.md)
>
> Configure email, Slack, webhook, and GitHub dispatch


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