# Automations

## Overview

**Automations** let you define and orchestrate **multi-step workflows** across your DevOps pipeline.

An Automation is a sequence that runs automatically when a specific event happens.

You define a sequence once, and SRE.ai runs it for you.

Each Automation has two parts:

* A **Trigger** defines what kicks it off
* **Steps** define what happens next, in order

{% hint style="success" %}
You define the goal. Automations handle the how.
{% endhint %}

## **Core capabilities**

### **Triggers**

Triggers initiate an Automation.

Triggers allow you to initiate an Automation exactly when needed, whether it's:

* After a **manual activation**
* After a **deployment** completes

{% hint style="success" %}
Learn more about Triggers in[ SRE.ai's Triggers documentation](/using-sre.ai/automations/triggers.md).
{% endhint %}

### **Steps**

Steps define the execution of an Automation

Steps let you define the sequence of instances and dependencies that occur after a Trigger.

You can also define conditions and criteria to keep each Step's execution smooth and error-free.

{% hint style="success" %}
Learn more about Steps in [SRE.ai's Steps documentation](/using-sre.ai/automations/steps.md).
{% endhint %}

### Comprehensive workflow support

Combining Triggers and Steps allows you to customize your workflows to meet your specific needs.

Here are some functions you can execute with combinations of Triggers and Steps:

* Promote changes when a pull request is approved
* Automatically update a Jira issue when you promote a change to an environment
* Enable continuous integration and continuous deployment
* Create and install package versions based on git operations
* Maintain a pool of scratch orgs with up-to-date packages, data, and configurations
* Notify your team by posting messages to Microsoft Teams channels directly from your workflows

{% hint style="info" %}
**Salesforce connection support:** Automations work with both OAuth and JWT-authenticated Salesforce connections.
{% endhint %}

## **How it works**

### Main page

By default, the Automations page only displays active Automations.

**Click the "All" button** to view every Automation in your system.

**Click on an existing Automation** to view or edit the Automation.

### Activity tab

The Activity tab in the Automation Builder displays the history of the given Automation.

### Stopping an Automation

To stop a running Automation, open the Activity tab and click the **Stop** button next to the active run.

This is useful for canceling hung or unintended Automation executions.

## Setup

1. **Click the "New" button** on the main page to open the Automation Builder, where you can name your Automation.
2. In the Automation Builder, click **the Edit button** to add or remove Steps and edit existing Triggers and/or Steps.
3. Click **the Activation button** to activate your Automation after you have arranged your desired Triggers and Steps.
4. Automations will handle the rest, ensuring your processes run smoothly and efficiently.


---

# 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.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.
