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

# Pipeline notifications

export const designer = "Designer";

export const maia = "Maia";

This guide explains how registered {maia} users can configure pipeline notifications to receive alerts for specific [pipeline](/docs/guides/pipelines) run outcomes. You can subscribe to two types of notification: completion alerts for **Success**, **Failure**, **Cancelled**, and **Skipped** runs, and anomaly alerts for pipeline runs whose duration deviates significantly from historical baselines. Both notification types are available within the [projects](/docs/guides/projects) and [environments](/docs/guides/environments) you have access to. Notifications are sent only for scheduled or API-driven pipeline runs—pipelines run manually through {designer} don't generate notifications. These alerts help you respond quickly to issues, minimize downtime, and improve overall reliability.

Notifications can be delivered via:

* Email
* Slack
* Webhook

***

## Use cases

* **Environment-specific routing:** Send development failures to a sandbox channel and production alerts to your high-priority alerts channel.
* **Noise reduction:** Rather than building alerts into every pipeline, simply subscribe to a project or environment once.
* **Anomaly detection:** Receive alerts when a pipeline run takes significantly longer or shorter than expected, so you can investigate performance issues before they escalate.

***

## Prerequisites

Before setting up pipeline notifications, ensure the following:

* You have a [registered {maia} account](/docs/administration/registration).
* You have access to the relevant projects and environments where the data pipelines are running.
* If you plan to use Slack notifications, you have access to a Slack workspace and a configured Slack webhook URL.

***

## Pipeline completion alerts

Select a delivery method to set up completion alerts:

<Tabs>
  <Tab title="Email">
    When you select **Email** as the delivery method for a pipeline notification, alerts are sent to the email address associated with your {maia} account.

    No additional setup is required. Once you select **Email**, alerts are delivered automatically when your chosen trigger conditions are met.

    1. In the left navigation, click your Profile & Account icon. Then, select **Notifications** from the menu.
    2. Click **Add notification** at the top.
    3. In the **Add notification** dialog, select the **Project** and **Environment** you'd like to be notified about.
    4. Under **Pipeline completion alerts**, click **Add**, then select the trigger types you want to subscribe to: **Success**, **Failure**, **Cancelled**, and/or **Skipped**.
    5. Under **How do you want to receive this notification?**, select **Email**.
    6. Click **Add notification**.
  </Tab>

  <Tab title="Slack">
    When you select **Slack** as the delivery method for a pipeline notification, alerts are sent to a Slack channel of your choice via an incoming webhook URL.

    ### Prerequisites

    Before setting up Slack notifications, you must create a Slack app and generate an incoming webhook URL in your Slack workspace. For step-by-step instructions, see [Sending messages using incoming webhooks](https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/).

    ### Setup

    When configuring a pipeline notification with Slack as the delivery method, provide the following:

    <ResponseField name="Slack Webhook URL" type="string" required>
      The incoming webhook URL generated in your Slack workspace.
    </ResponseField>

    <ResponseField name="Slack Webhook Name" type="string" required>
      A descriptive name for this webhook, used to identify it on the **Notifications** page.
    </ResponseField>

    1. In the left navigation, click your Profile & Account icon. Then, select **Notifications** from the menu.
    2. Click **Add notification** at the top.
    3. In the **Add notification** dialog, select the **Project** and **Environment** you'd like to be notified about.
    4. Under **Pipeline completion alerts**, click **Add**, then select the trigger types you want to subscribe to: **Success**, **Failure**, **Cancelled**, and/or **Skipped**.
    5. Under **How do you want to receive this notification?**, select **Slack**.
    6. Enter a **Slack Webhook URL** and a **Slack Webhook Name**.
    7. Click **Add notification**.
  </Tab>

  <Tab title="Webhook">
    When you select **Webhook** as the delivery method for a pipeline notification, alerts are sent as HTTP POST requests to an endpoint of your choice. You can also supply a custom JSON payload template to control exactly what data is sent.

    <Note>
      Webhook notifications are outbound only. {maia} can't receive incoming webhook data or use webhooks to trigger pipeline runs. Outbound payloads aren't signed with HMAC, so receiving endpoints can't use HMAC to verify the request.
    </Note>

    ### Setup

    When configuring a pipeline notification with Webhook as the delivery method, provide the following:

    <ResponseField name="Webhook URL" type="string" required>
      The endpoint that receives the notification.
    </ResponseField>

    <ResponseField name="Webhook Name" type="string" required>
      A descriptive name for this webhook, used to identify it on the **Notifications** page.
    </ResponseField>

    <ResponseField name="Payload Template" type="string" required>
      A custom JSON template using `${variableName}` syntax to control the notification body. For example: `{"text": "Pipeline ${pipelineName} status ${status}"}`. Click **View available variables** to see the full list of supported variables.
    </ResponseField>

    1. In the left navigation, click your Profile & Account icon. Then, select **Notifications** from the menu.
    2. Click **Add notification** at the top.
    3. In the **Add notification** dialog, select the **Project** and **Environment** you'd like to be notified about.
    4. Under **Pipeline completion alerts**, click **Add**, then select the trigger types you want to subscribe to: **Success**, **Failure**, **Cancelled**, and/or **Skipped**.
    5. Under **How do you want to receive this notification?**, select **Webhook**.
    6. Enter a **Webhook URL**, a **Webhook Name**, and a **Payload Template**.
    7. Click **Add notification**.

    ***

    ### Available variables

    The following variables are available for use in the payload template. Select the ones that best fit your needs.

    | Variable                 | Description          |
    | ------------------------ | -------------------- |
    | `${pipelineName}`        | Pipeline name        |
    | `${status}`              | Execution status     |
    | `${finishedAt}`          | Completion timestamp |
    | `${pipelineExecutionId}` | Execution ID         |
    | `${projectId}`           | Project ID           |
    | `${accountId}`           | Account ID           |

    ***

    ### Example payload

    The following example uses all available variables in a realistic payload structure:

    ```json theme={null}
    {
        "text": "Pipeline ${pipelineName} finished with status ${status}",
        "pipeline": {
            "name": "${pipelineName}",
            "status": "${status}",
            "executionId": "${pipelineExecutionId}",
            "finishedAt": "${finishedAt}"
        },
        "context": {
            "projectId": "${projectId}",
            "accountId": "${accountId}"
        }
    }
    ```
  </Tab>
</Tabs>

### What the completion alert includes

Each completion alert includes the following details about the pipeline run:

* Project name
* Environment name
* Pipeline name
* End time of the pipeline run

It also includes a **View Pipeline Run Details** link to the [Pipeline run history](/docs/guides/pipeline-run-history) and an **Update Notification Settings** link to the **Notifications** page.

***

## Anomaly alerts

Anomaly alerts notify you when a pipeline run's duration deviates significantly from its historical baseline.

To receive anomaly alerts, keep the following requirements in mind:

* **Minimum run requirement:** A pipeline must have at least 10 successful runs before the system can generate anomaly alerts.
* **Impact of new versions:** Baselines are tied to specific publication versions. When you publish a new pipeline version, the baseline resets. The new version must complete 10 successful runs before alerts resume.

### Duration anomalies

{maia} compares every pipeline run's duration against that pipeline's own recent history. If the run falls well outside the range of normal durations, it's flagged as a duration anomaly.

There are two types of duration anomaly:

* Slow anomaly—the run took longer than expected. This can be detected while the pipeline is still running, as well as at completion.
* Fast anomaly—the run finished unusually quickly. This is only detected at completion.

#### How the expected range is calculated

{maia} uses up to the most recent 300 successful runs of a pipeline to establish its baseline. A minimum of 10 successful runs is required—pipelines with fewer runs in their history don't generate anomaly alerts.

From those durations, {maia} builds an expected range around the pipeline's typical duration:

* It takes the median (middle) run duration as the center of "normal."
* It measures how far normal runs spread above the median—out to the slowest runs that are still routine (the 99th percentile). It does the same on the fast side, down to the quickest routine runs (the 1st percentile).
* The upper bound (slow threshold) is the median plus twice that upward spread. A run has to land well beyond even the normally-slow end of the range before it's flagged as slow.
* The lower bound (fast threshold) is the median minus twice the downward spread, and never drops below zero. For most pipelines it works out to zero—so they're never flagged as "too fast." It only becomes meaningful for pipelines that normally run *long and consistently*, where finishing in a fraction of the usual time is a genuine signal that the run did little or no work.

{maia} always applies a small minimum spread, so a pipeline that finishes in almost exactly the same time every run still gets a sensible margin instead of a hair-trigger threshold.

In plain terms: the range scales to how variable each pipeline normally is. Steady pipelines get a tight range, so even a modest slowdown is flagged; naturally variable pipelines—or ones with a mix of quick and long runs—get a wider range, so ordinary fluctuation doesn't trigger false alerts.

### Subscribe to anomaly alerts

Select a delivery method to set up anomaly alerts:

<Tabs>
  <Tab title="Email">
    When you select **Email** as the delivery method for an anomaly alert, notifications are sent to the email address associated with your {maia} account.

    No additional setup is required. Once you select **Email**, alerts are delivered automatically when an anomaly is detected.

    1. In the left navigation, click your Profile & Account icon. Then, select **Notifications** from the menu.
    2. Under **Anomaly alerts**, click **Add**.
    3. Select **Enable anomaly alerts**.
    4. Under **How do you want to receive this notification?**, select **Email**.
    5. Click **Add notification**.
  </Tab>

  <Tab title="Slack">
    When you select **Slack** as the delivery method for an anomaly alert, notifications are sent to a Slack channel of your choice via an incoming webhook URL.

    ### Prerequisites

    Before setting up Slack notifications, you must create a Slack app and generate an incoming webhook URL in your Slack workspace. For step-by-step instructions, see [Sending messages using incoming webhooks](https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/).

    ### Setup

    When configuring an anomaly alert with Slack as the delivery method, provide the following:

    <ResponseField name="Slack Webhook URL" type="string" required>
      The incoming webhook URL generated in your Slack workspace.
    </ResponseField>

    <ResponseField name="Slack Webhook Name" type="string" required>
      A descriptive name for this webhook, used to identify it on the **Notifications** page.
    </ResponseField>

    1. In the left navigation, click your Profile & Account icon. Then, select **Notifications** from the menu.
    2. Under **Anomaly alerts**, click **Add**.
    3. Select **Enable anomaly alerts**.
    4. Under **How do you want to receive this notification?**, select **Slack**.
    5. Enter a **Slack Webhook URL** and a **Slack Webhook Name**.
    6. Click **Add notification**.
  </Tab>

  <Tab title="Webhook">
    When you select **Webhook** as the delivery method for an anomaly alert, notifications are sent as HTTP POST requests to an endpoint of your choice. You can also supply a custom JSON payload template to control exactly what data is sent.

    <Note>
      Webhook notifications are outbound only. {maia} can't receive incoming webhook data or use webhooks to trigger pipeline runs. Outbound payloads aren't signed with HMAC, so receiving endpoints can't use HMAC to verify the request.
    </Note>

    ### Setup

    When configuring an anomaly alert with Webhook as the delivery method, provide the following:

    <ResponseField name="Webhook URL" type="string" required>
      The endpoint that receives the notification.
    </ResponseField>

    <ResponseField name="Webhook Name" type="string" required>
      A descriptive name for this webhook, used to identify it on the **Notifications** page.
    </ResponseField>

    <ResponseField name="Payload Template" type="string" required>
      A custom JSON template using `${variableName}` syntax to control the notification body. For example: `{"text": "Pipeline ${pipelineName} status ${status}"}`. Click **View available variables** to see the full list of supported variables.
    </ResponseField>

    1. In the left navigation, click your Profile & Account icon. Then, select **Notifications** from the menu.
    2. Under **Anomaly alerts**, click **Add**.
    3. Select **Enable anomaly alerts**.
    4. Under **How do you want to receive this notification?**, select **Webhook**.
    5. Enter a **Webhook URL**, a **Webhook Name**, and a **Payload Template**.
    6. Click **Add notification**.

    ***

    ### Available variables

    The following variables are available for use in the payload template. Select the ones that best fit your needs.

    | Variable                       | Description                     |
    | ------------------------------ | ------------------------------- |
    | `${pipelineName}`              | Pipeline name                   |
    | `${environmentDisplayName}`    | Environment display name        |
    | `${status}`                    | Pipeline status                 |
    | `${startedAt}`                 | Execution start timestamp       |
    | `${elapsedDurationSeconds}`    | Elapsed duration in seconds     |
    | `${expectedUpperBoundSeconds}` | Expected upper bound in seconds |
    | `${expectedLowerBoundSeconds}` | Expected lower bound in seconds |
    | `${pipelineExecutionId}`       | Execution ID                    |
    | `${triggerType}`               | Pipeline trigger type           |
    | `${projectId}`                 | Project ID                      |
    | `${accountId}`                 | Account ID                      |

    ***

    ### Example payload

    The following example uses all available variables in a realistic payload structure:

    ```json theme={null}
    {
        "text": "Pipeline ${pipelineName} has a duration anomaly elapsed ${elapsedDurationSeconds}s exceeds expected upper bound of ${expectedUpperBoundSeconds}s",
        "pipeline": {
            "name": "${pipelineName}",
            "environment": "${environmentDisplayName}",
            "executionId": "${pipelineExecutionId}",
            "triggerType": "${triggerType}",
            "startedAt": "${startedAt}"
        },
        "anomaly": {
            "elapsedDurationSeconds": "${elapsedDurationSeconds}",
            "expectedUpperBoundSeconds": "${expectedUpperBoundSeconds}",
            "expectedLowerBoundSeconds": "${expectedLowerBoundSeconds}"
        },
        "context": {
            "projectId": "${projectId}",
            "accountId": "${accountId}"
        }
    }
    ```
  </Tab>
</Tabs>

### What the anomaly alert includes

Anomaly alerts include the following details:

* Pipeline name
* Anomaly type
* Environment name
* Start timestamp
* Elapsed duration
* Expected upper and lower bounds

It also includes a **View Pipeline Run Details** link to the [Pipeline run history](/docs/guides/pipeline-run-history) and an **Update Notification Settings** link to the **Notifications** page.

***

## Managing pipeline notifications

After creating a notification, you'll return to the **Notifications** page, where your pipeline notification has been added, displaying the following:

* **Project name**
* **Environment name**
* **Type** — the notification type: Completion or Anomaly
* **Trigger** — the trigger types you selected
* **Delivery** — the delivery method or methods you selected, with the webhook or Slack name shown in parentheses where applicable

<Note>
  You can select more than one delivery method for a single notification.
</Note>

To edit a pipeline notification, click the **...** icon next to it and select **Edit**. Modify your previous selections as needed, then click **Save** to apply the changes.

To permanently delete a pipeline notification, click the **...** icon next to it and select **Delete**. Then click **Delete** to confirm the deletion.

<Note>
  If you change your mind, you can cancel the deletion action by clicking **Cancel** in the confirmation dialog.
</Note>
