# Salesforce Orgs

## Overview

SRE.ai is built to manage and automate **Salesforce deployments**. **Salesforce Orgs** is where you establish that foundation.

Without connected orgs, SRE.ai has no environments to deploy to, monitor, or manage.

Everything from **pipeline stages** to **chat-driven deployments** depends on at least one connected org.

**Salesforce Orgs** lets you connect the Salesforce organizations SRE.ai will work with.

**SSO** is required when connecting for the first time, whether to a **Production Org** or a **Sandbox**.

{% hint style="success" %}
With SSO through Salesforce Orgs, SRE.ai does not require keys or tokens to connect to Salesforce.
{% endhint %}

## Core capabilities

Once connected, SRE.ai can:

* Automate deployments
* Automate sandbox testing
* Manage Salesforce organizations through a chat interface

## How it works

The Salesforce Orgs page lists your connected Salesforce orgs.

Each org displays a **type indicator** showing what kind of org it is:

* **Production:** a production org (`login.salesforce.com`)
* **Sandbox:** a sandbox org (`test.salesforce.com`)
* **Developer Edition:** a developer edition org

{% hint style="danger" %}
**Inactive connections are hidden in Chat.**

When a Salesforce connection is marked as Inactive, it will not appear as an option in any Chat entry point, including commit, deploy, design, and build workflows.

Set a connection back to Active to make it available again.

**An org cannot be set to Inactive while it is mapped to active pipeline environments.**

Remove it from all active pipeline stages first, then deactivate it.
{% endhint %}

The following table elements can be customized:

* Status
  * Active
  * Inactive
* Filter by creator
  * Filter the list to show only orgs created by a specific team member
* Visible columns
  * Status
  * Created By
  * Last Updated
* Number of rows per page
  * 10
  * 20
  * 30
  * 50
  * 100

### Connection health

Each connected org displays a health status that reflects whether SRE.ai can currently authenticate with it:

* **Connected:** the session is valid, and the org is reachable
* **Disconnected:** the session has expired or been revoked. This status is displayed as a red severity badge to signal that the org requires attention

The connection status is shown as an icon in the **Connection** column of the Salesforce Orgs table.

When an org is shown as Disconnected, a **Reconnect** button appears inline in that org's row. Click the reconnect button to re-authenticate using the same SSO flow used when you first connected the org.

{% hint style="info" %}
Reauthenticating through the Reconnect button follows the same SSO flow used when you first connected the org. No new credentials or tokens are required.
{% endhint %}

## **Setup**

#### 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 (note: the URL will show `login.salesforce.com`)
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 %}


---

# 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/salesforce-orgs.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.
