# Quickstart guide

## Overview

SRE.ai works by connecting your **Salesforce environments** and your **GitHub repositories**, then orchestrating how changes move between them.

The three steps below establish that foundation.

**Adding your Salesforce orgs** gives SRE.ai access to the environments it will deploy to and monitor. Without them, there's nothing to release to.

**Connecting GitHub** gives SRE.ai visibility into your code, **branches**, **commits**, and **pull requests**. This is what SRE.ai watches to detect changes and trigger **automations**.

**Configuring your pipeline** ties the two together. It maps your GitHub **branches** to your Salesforce **environments** and defines the **stages** a change must pass through before reaching production.

Once all three are in place, SRE.ai has everything it needs to orchestrate your **deployments**, run **automations**, and provide **AI assistance** across your workflow.

### Step 1: Add Salesforce Orgs

Connect your Salesforce organizations to SRE.ai.

{% hint style="success" %}
You can connect both production orgs and sandboxes.
{% endhint %}

#### Prerequisites

* Salesforce credentials with one of these permissions:
  * Modify All Data
  * Modify Metadata Through Metadata API Functions
* Access to a developer account for sandboxes

{% columns %}
{% column %}
**Connect a Production Org**

1. In the Salesforce Orgs page, **click Connect Salesforce Org**
2. Select **Production** from the dropdown menu
3. You'll be redirected to the Salesforce login page
4. Enter your Salesforce credentials and click **Log In**
5. Authorize SRE.ai to access your org
6. Once complete, you'll be returned to SRE.ai with your production org connected
   {% endcolumn %}

{% column %}
**Connect a Sandbox**

1. In the Salesforce Orgs page, **click Connect Salesforce Org**
2. Select **Sandbox** from the dropdown menu
3. You'll be redirected to the Salesforce sandbox login page (note: the URL will show `test.salesforce.com`)
4. Enter your sandbox credentials and click **Log In to Sandbox**
5. Authorize SRE.ai to access your sandbox
6. Once complete, you'll be returned to SRE.ai with your sandbox connected
   {% endcolumn %}
   {% endcolumns %}

#### Notes

* You can connect multiple production orgs and sandboxes
* SRE.ai uses SSO for Salesforce connections, no tokens or keys required
* Connected Salesforce orgs will appear in your Salesforce Orgs list and be available for deployments and automations
* If an org's session expires, SRE.ai will prompt you to reauthenticate using the same SSO flow
* [Read SRE.ai's Salesforce Orgs documentation](/setting-up-sre.ai/salesforce-orgs.md) to learn more

### Step 2: Connect GitHub account

Link your GitHub account to enable SRE.ai to manage repositories, track branches, create pull requests, and trigger automations based on Git events.

{% hint style="danger" %}
**Connecting to GitHub requires admin approval in your GitHub org.**\
If you are not a GitHub admin, adding the integration will create a request that your org admin can approve.\
\
Read [GitHub's documentation on installing apps](https://docs.github.com/en/apps/using-github-apps/installing-a-github-app-from-a-third-party) to learn more about approvals.\
\
**Select your organization, not your personal account.**\
Clicking your personal account instead of your organization will connect to the wrong context.
{% endhint %}

**Prerequisites**

* A GitHub account with access to the repositories you want to connect
* Permission to install GitHub Apps on your organization (if connecting an organization's repositories)

**Connect GitHub**

1. In the Integrations page, click **+ Add Integration** in the top right of the screen and select **GitHub**
2. You'll be redirected to GitHub to install the SRE.ai GitHub App
3. GitHub will ask: "Where do you want to install the SRE.ai GitHub App?"
4. Select your organization (not your personal account)
5. On the repository access screen, choose your access scope:
   * **Only select repositories:** Choose specific repositories to connect (recommended)
   * Select at least one repository from the dropdown
6. Review the permissions SRE.ai is requesting:
   * Read access to metadata
   * Read and write access to code, pull requests, and repository hooks
7. Click **Install** (or **Update access** if modifying an existing installation)
8. You'll be returned to SRE.ai with your GitHub account connected

#### Notes

* You can modify repository access later through GitHub's application settings
* SRE.ai only requests the permissions necessary to manage code, PRs, and hooks. No organization administration permissions are required
* Read [SRE.ai's Integrations documentation](/setting-up-sre.ai/integrations.md#sso) to learn more

### Step 3: Configure pipeline

Set up your CI/CD pipeline to define how changes flow from development through production.

#### Prerequisites

* At least one Salesforce instance connected (Step 1)
* GitHub account connected (Step 2)

#### Configure your pipeline

1. From the Command Center welcome screen, click **Configure Pipeline**
2. SRE.ai will present preset pipeline templates
3. Select a template that matches your workflow, or start with a default and customize

{% hint style="info" %}
The standard pipeline progression flows left to right:

**Developer/Team** → **Integration** → **Staging** → **Production**

A hotfix stage can branch off from staging and connect directly to production for emergency fixes.

Read [SRE.ai's Pipeline documentation](/setting-up-sre.ai/pipelines.md) to learn more.
{% endhint %}

#### Map stages to branches and environments

Your pipeline consists of stages that represent phases in your deployment lifecycle. Each stage must be mapped to a branch and to one or more Salesforce environments.

1. Click on a stage to open the Stage Details panel
2. Configure the branch that this stage tracks
3. Click **Add Environment** to map the stage to a Salesforce org
4. Select from your connected Salesforce Orgs
5. A green checkmark indicates a validated connection
6. Repeat for each stage in your pipeline

{% hint style="warning" %}
Salesforce orgs mapped to active pipeline stages cannot be set to Inactive.<br>

To deactivate an org, remove it from all active pipeline stages first.
{% endhint %}

#### Configure quality gates

Quality gates define the criteria that must be met before changes can advance to the next stage.

1. Within the Stage Details panel, locate the Quality Gates section
2. Configure the gates for this stage:
   * **Code review:** enable and set the severity level that blocks promotion (Critical, High, or Medium)
   * **Code coverage:** require a minimum percentage (75%, 80%, 85%, or 90%)
   * **Test level:** set which tests run during deployment (unspecified, none, specified, local, or all org tests)
   * **Pull requests:** require a pull request before changes advance to the next stage

{% hint style="danger" %}
To complete pipeline setup, you need:

* At least two stages (e.g., Development → Production)
* At least one environment mapped to a stage
  {% endhint %}

### Next steps

Once you've completed these three steps, your SRE.ai environment is ready to use. You can now:

* **Use the Command Center chat** to interact with your environments and get AI assistance
* **Create Automations** to orchestrate workflows based on triggers
* **Track Changes** as you develop and deploy features
* **Use Agents** to design, build, and deploy with AI assistance

For more detailed information on each feature, see the relevant documentation sections.


---

# 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/setting-up-sre.ai/quickstart.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.
