# Steps customization

## Overview

SRE.ai offers nine Step types:

* **Create Salesforce Change:** Open a new Change to track metadata updates
* **Commit Change:** Retrieve metadata from a Salesforce org and commit it to Git
* **Deploy Package:** Deploy committed metadata to a target Salesforce org
* **Send Teams Message:** Post a notification to a Microsoft Teams channel
* **Create Scratch Org:** Spin up a temporary Salesforce org from a source org
* **Generate Seed Data:** Export data from a Salesforce org as a reusable seed file
* **Load Seed Data:** Import a seed data file into a target Salesforce org
* **Insert into Supabase:** Insert a record into a Supabase table
* **Update Jira Ticket:** Update a Jira issue with a new status, a comment, or both

{% hint style="success" %}
Steps can be renamed once they are placed in an Automation.\
\
For example, "Send Teams Message" can be renamed to "Notify PMs".
{% endhint %}

### Template variables

Steps produce **output variables** that subsequent steps can reference using `{{StepName.field}}` syntax.\
\
Each step's expandable section below lists the outputs it produces.

The **Available Template Variables** helper in the step editor lists every variable currently available from earlier steps in the Automation.

Click any variable to insert it into a field.

## Create Salesforce Change

Creates a new Change record to track a set of metadata updates through your pipeline.

<details>

<summary><mark style="background-color:yellow;"><strong>Click to learn how to set up and customize the Create Salesforce Change step</strong></mark></summary>

**Parameters**

| Field                  | Required | Description                                          |
| ---------------------- | -------- | ---------------------------------------------------- |
| **Name**               | Yes      | Display name for this step in the Automation Builder |
| **Change Name**        | Yes      | Name of the Change record that will be created       |
| **Description**        | No       | Optional summary of what this Change contains        |
| **Salesforce Org**     | No       | Pre-select the org this Change is associated with    |
| **Metadata Selection** | No       | Metadata components to include in the Change         |

**Outputs**

This step produces the following template variables for use in subsequent steps:

* `{{StepName.change_id}}` - ID of the created Change record
* `{{StepName.change_name}}` - Name of the created Change record

**Usage notes**

* The Change ID output is the key input for the Commit Change and Deploy Package steps. Run Create Salesforce Change first when building a deployment flow.
* Salesforce Org and Metadata Selection can be left blank and configured in later steps.

</details>

## Commit Change

Retrieves metadata from a connected Salesforce org and commits it to a Git branch, packaging the change for deployment.

<details>

<summary><mark style="background-color:yellow;"><strong>Click to learn how to set up and customize the Commit Change step</strong></mark></summary>

**Parameters**

| Field                 | Required    | Description                                                                                     |
| --------------------- | ----------- | ----------------------------------------------------------------------------------------------- |
| **Name**              | Yes         | Display name for this step in the Automation Builder                                            |
| **Change ID**         | Yes         | The Change to commit. Use `{{StepName.change_id}}` to reference a Create Salesforce Change step |
| **Salesforce Org**    | Yes         | The org to retrieve metadata from                                                               |
| **Repository**        | Yes         | The Git repository to commit to                                                                 |
| **Branch**            | Conditional | The target branch. Required unless **Create new branch** is enabled                             |
| **Create new branch** | No          | When enabled, creates a new branch automatically instead of targeting an existing one           |

**Outputs**

* `{{StepName.job_id}}` - ID of the commit job
* `{{StepName.commit_hash}}` - Git commit hash of the committed metadata
* `{{StepName.branch}}` - Branch name where the commit was made

**Usage notes**

* Either the **Branch** or **Create new branch** must be set. The step will not save without one of them configured.
* The step polls for job completion and will fail if the job doesn't complete within 15 seconds. For large metadata payloads, ensure org connectivity is stable.

</details>

## Deploy Package

Deploys committed metadata to a target Salesforce org, running tests and validating quality gates before applying changes.

<details>

<summary><mark style="background-color:yellow;"><strong>Click to learn how to set up and customize the Deploy Package step</strong></mark></summary>

**Parameters**

| Field                     | Required | Description                                                                                   |
| ------------------------- | -------- | --------------------------------------------------------------------------------------------- |
| **Name**                  | Yes      | Display name for this step in the Automation Builder                                          |
| **Select Connection**     | Yes      | The pipeline connection that governs this deployment                                          |
| **Change ID**             | Yes      | The Change to deploy. Use `{{StepName.change_id}}` to reference an earlier step               |
| **Target Salesforce Org** | Yes      | The org to deploy the metadata to                                                             |
| **Test Level**            | No       | Which tests to run during deployment (see test levels below). Defaults to **Run Local Tests** |
| **Validation Only**       | No       | When enabled, validates the deployment without applying it. Useful for pre-checks             |

**Test levels**

| Option                  | Behavior                                                                          |
| ----------------------- | --------------------------------------------------------------------------------- |
| **No Test Run**         | Runs no tests. Use only for non-Apex metadata                                     |
| **Run Local Tests**     | Runs all tests defined locally in the target org (default)                        |
| **Run Specified Tests** | Runs only the tests specified in the deployment package                           |
| **Run All Tests**       | Runs every test in the target org. Slowest — blocks the pipeline during execution |

**Outputs**

* `{{StepName.deployment_id}}` - ID of the deployment record
* `{{StepName.job_id}}` - ID of the deployment job
* `{{StepName.status}}` - Deployment result: `completed` or `success`

**Usage notes**

* Deployments can take several minutes. The step polls for up to 10 minutes before timing out.
* If the deployment fails, the step surfaces up to five component and test failures with details.
* **Validation Only** is useful before a production deployment. Pair it with a manual approval step or Teams notification to review results before committing.

</details>

## Send Teams Message

Posts a message to a Microsoft Teams channel. Supports template variables so messages can include context from earlier steps.

<details>

<summary><mark style="background-color:yellow;"><strong>Click to learn how to set up and customize the Send Teams Message step</strong></mark></summary>

**Parameters**

| Field             | Required | Description                                                         |
| ----------------- | -------- | ------------------------------------------------------------------- |
| **Name**          | Yes      | Display name for this step in the Automation Builder                |
| **Teams Channel** | No       | The channel to post to. Defaults to **general** if left blank       |
| **Message**       | Yes      | The message content. Supports template variables from earlier steps |

**Outputs**

* `{{StepName.messageId}}` - ID of the sent message
* `{{StepName.timestamp}}` - When the message was sent (ISO 8601)
* `{{StepName.channel}}` - The channel the message was sent to

**Usage notes**

* Template variables make notifications context-aware. For example: `Deployment {{Deploy.status}} — commit {{CommitChange.commit_hash}} is live.`
* The Teams integration must be configured in **Integrations** before this step can be used.
* This step is non-blocking; it does not delay subsequent steps.

</details>

## Create Scratch Org

Creates a temporary Salesforce scratch org pre-loaded with metadata from a source org. Scratch orgs expire automatically after a configured number of days.

<details>

<summary><mark style="background-color:yellow;"><strong>Click to learn how to set up and customize the Create Scratch Org step</strong></mark></summary>

**Parameters**

| Field           | Required | Description                                                                                      |
| --------------- | -------- | ------------------------------------------------------------------------------------------------ |
| **Name**        | Yes      | Display name for this step in the Automation Builder                                             |
| **Dev Hub Org** | Yes      | The Dev Hub org used to create the scratch org                                                   |
| **Source Org**  | Yes      | The org whose metadata is pushed into the new scratch org                                        |
| **Duration**    | No       | How many days the scratch org should live (1–30). Defaults to **7**                              |
| **Alias**       | No       | A custom alias for the scratch org used in Salesforce CLI commands. Auto-generated if left blank |

**Outputs**

* `{{StepName.scratch_org_id}}` - ID of the created scratch org
* `{{StepName.username}}` - Login username for the scratch org
* `{{StepName.password}}` - Login password for the scratch org
* `{{StepName.instance_url}}` - API endpoint URL
* `{{StepName.login_url}}` - Browser login URL
* `{{StepName.access_token}}` - Bearer token for API access
* `{{StepName.alias}}` - Alias assigned to the org (use this in a Load Seed Data step)
* `{{StepName.expires_at}}` - Expiry timestamp (ISO 8601)

**Usage notes**

* Duration cannot be changed after the scratch org is created. Set the duration before running the Automation.
* The step typically takes 2–5 minutes, depending on the size of the source org's metadata.
* Use `{{StepName.alias}}` as the **Target Org Alias** input in a Load Seed Data step to immediately seed the new org.

</details>

## Generate Seed Data

Exports data from a Salesforce org as a structured seed file, ready to be loaded into another org via the Load Seed Data step.

<details>

<summary><mark style="background-color:yellow;"><strong>Click to learn how to set up and customize the Generate Seed Data step</strong></mark></summary>

**Parameters**

| Field                    | Required | Description                                                                           |
| ------------------------ | -------- | ------------------------------------------------------------------------------------- |
| **Name**                 | Yes      | Display name for this step in the Automation Builder                                  |
| **Source Org**           | Yes      | The org to export data from                                                           |
| **Export Configuration** | Yes      | A JSON object defining which objects and records to export (SFDMU format — see below) |

**Export configuration format**

The Export Configuration field accepts a JSON object that specifies which Salesforce objects to export and any filter conditions:

```json
{
  "objects": [
    {
      "name": "Account",
      "operation": "Retrieve"
    },
    {
      "name": "Contact",
      "operation": "Retrieve"
    },
    {
      "name": "Opportunity",
      "operation": "Retrieve",
      "where": "StageName = 'Won'"
    }
  ]
}
```

Use the `where` field to limit which records are exported — this is useful for excluding sensitive data or keeping seed files small.

**Outputs**

* `{{StepName.exportId}}` - ID of the export operation
* `{{StepName.exportPath}}` - Path to the exported data files (pass this to a Load Seed Data step)
* `{{StepName.exportedObjects}}` - An array of object types exported
* `{{StepName.recordCounts}}` - Record counts per object (e.g., `{Account: 500, Contact: 1200}`)

**Usage notes**

* This step is read-only. It does not modify the source org.
* Pass `{{StepName.exportPath}}` as the **Seed Data Path** in a Load Seed Data step.
* Large data exports can take several minutes and consume API quota. Use `where` filters to limit export size.
* The step has a 10-minute timeout.

</details>

## Load Seed Data

Imports seed data from a file into a target Salesforce org. Designed to follow a Generate Seed Data step or use a manually prepared seed file.

<details>

<summary><mark style="background-color:yellow;"><strong>Click to learn how to set up and customize the Load Seed Data step</strong></mark></summary>

**Parameters**

| Field                | Required | Description                                                                                                                        |
| -------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **Name**             | Yes      | Display name for this step in the Automation Builder                                                                               |
| **Target Org Alias** | Yes      | The alias or ID of the org to load data into. Use `{{CreateScratchOrg.alias}}` to target a scratch org created earlier in the flow |
| **Seed Data Path**   | Yes      | Path to the seed data directory. Use `{{GenerateSeedData.exportPath}}` to reference data generated earlier in the flow             |

**Outputs**

* `{{StepName.importId}}` - ID of the import operation
* `{{StepName.importedObjects}}` - An array of object types imported
* `{{StepName.recordCounts}}` - Record counts per object
* `{{StepName.importStatus}}` - Result: `completed`, `success`, or `partial`

**Usage notes**

* The most common pattern is to chain Generate Seed Data → Load Seed Data using template variables:
  * **Target Org Alias**: `{{CreateScratchOrg.alias}}`
  * **Seed Data Path**: `{{GenerateSeedData.exportPath}}`
* The target org must have the same object schema as the source org for the import to succeed.
* The step has a 10-minute timeout.

</details>

## Insert into Supabase

Inserts a record into a Supabase table. Useful for logging automation results, recording deployment history, or updating an external tracking system.

<details>

<summary><mark style="background-color:yellow;"><strong>Click to learn how to set up and customize the Insert into Supabase step</strong></mark></summary>

**Parameters**

| Field                   | Required | Description                                                                |
| ----------------------- | -------- | -------------------------------------------------------------------------- |
| **Name**                | Yes      | Display name for this step in the Automation Builder                       |
| **Supabase Connection** | Yes      | The Supabase integration to use. Configure connections in **Integrations** |
| **Table Name**          | Yes      | The name of the Supabase table to insert into                              |
| **Data**                | Yes      | A JSON object representing the row to insert. Supports template variables  |

**Data field format**

The **Data** field accepts a JSON object where keys map to column names in the target table:

```json
{
  "change_id": "{{CreateChange.change_id}}",
  "deployment_status": "{{Deploy.status}}",
  "commit_hash": "{{CommitChange.commit_hash}}",
  "timestamp": "{{trigger_data.timestamp}}"
}
```

**Outputs**

* `{{StepName.row_id}}` - ID of the inserted row
* `{{StepName.inserted_data}}` - Echo of the data that was inserted
* `{{StepName.insert_status}}` - Result: `completed`

**Usage notes**

* Column names in the Data object must match your Supabase table schema exactly.
* Template variables from earlier steps make this step useful as an audit log. Record the following in a single row:
  * Change ID
  * Deployment status
  * Commit hash
  * Timestamp
* The Supabase connection must be configured in **Integrations** before this step can be used.

</details>

## Update Jira Ticket

Updates a Jira issue with a new status, a comment, or both. Use this step to keep your Jira board in sync with what's happening in SRE.ai.

<details>

<summary><mark style="background-color:yellow;"><strong>Click to learn how to set up and customize the Update Jira Ticket step</strong></mark></summary>

**Parameters**

| Field               | Required | Description                                                                   |
| ------------------- | -------- | ----------------------------------------------------------------------------- |
| **Name**            | Yes      | Display name for this step in the Automation Builder                          |
| **Jira Connection** | Yes      | The Jira integration to use. Configure connections in **Integrations**        |
| **Issue Key**       | Yes      | The Jira issue to update (e.g., PROJ-123). Supports template variables        |
| **Status**          | No       | The status to transition the issue to (e.g., "In Review", "Done")             |
| **Comment**         | No       | A comment to add to the issue. Supports template variables from earlier steps |
| **Fields**          | No       | Additional Jira fields to update, as a JSON object                            |

**Outputs**

* `{{StepName.issueKey}}` - Key of the updated Jira issue
* `{{StepName.updatedFields}}` - List of fields that were updated

**Usage notes**

* At least one of **Status**, **Comment**, or **Fields** should be configured.&#x20;

{% hint style="danger" %}
The step has no effect if all three are empty.
{% endhint %}

* Template variables make comments context-aware. For example: `Deployment {{Deploy.status}} — commit {{CommitChange.commit_hash}} deployed successfully.`
* The status value must match a valid transition name in your Jira project. If the transition is not available for the issue's current state, the step will fail.
* The Jira integration must be configured in **Integrations** before this step can be used.

</details>


---

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