# Triggers customization

## Overview

SRE.ai offers two Triggers:

* [Manual](#manual-trigger-customization)
* [Deployment](#deployment-trigger-customization)

Read below to learn about the parameters that can be customized within each Trigger.

## Manual trigger customization

A click activates a manual trigger.

The manual trigger features one customizable parameter, a **Description.**

## Deployment trigger customization

The deployment trigger fires automatically when a deployment in your pipeline reaches a terminal state (success or failed).

**Parameters**

| Field             | Description                                                                          |
| ----------------- | ------------------------------------------------------------------------------------ |
| **Description**   | Optional label describing when this trigger fires                                    |
| **Org filter**    | Limit to specific Salesforce orgs. If empty, the trigger fires for all orgs          |
| **Status filter** | Limit to `success`, `failed`, or both. If empty, the trigger fires on either outcome |

**Available trigger data**

When a deployment trigger fires, the following variables are available to all steps in the Automation via `{{trigger_data.*}}` syntax:

| Variable                                | Description                                  |
| --------------------------------------- | -------------------------------------------- |
| `{{trigger_data.deployment_id}}`        | ID of the deployment that fired the trigger  |
| `{{trigger_data.deployment_status}}`    | Outcome: `success` or `failed`               |
| `{{trigger_data.org_id}}`               | ID of the target Salesforce org              |
| `{{trigger_data.org_name}}`             | Display name of the target org               |
| `{{trigger_data.components_total}}`     | Total number of components in the deployment |
| `{{trigger_data.components_succeeded}}` | Number of components deployed successfully   |
| `{{trigger_data.components_failed}}`    | Number of components that failed             |
| `{{trigger_data.tests_total}}`          | Total test count (Apex deployments only)     |
| `{{trigger_data.tests_succeeded}}`      | Tests that passed (Apex deployments only)    |
| `{{trigger_data.tests_failed}}`         | Tests that failed (Apex deployments only)    |
| `{{trigger_data.failure_count}}`        | Number of failures (if any)                  |
| `{{trigger_data.failure_summary}}`      | Summary of up to 3 failure messages (if any) |

**Example: notify on failure**

Use trigger data in a Send Teams Message step to build a context-aware alert:

```
Deployment to {{trigger_data.org_name}} {{trigger_data.deployment_status}}.
Components: {{trigger_data.components_succeeded}}/{{trigger_data.components_total}} succeeded.
{{trigger_data.failure_summary}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sre.ai/using-sre.ai/automations/triggers/triggers-customization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
