grid-4Environment management

Learn how SRE.ai can be used to facilitate environment management

Overview

Managing Salesforce environments is repetitive work.

Sandbox refreshes need manual reconfiguration.

Test data must be re-entered before every validation cycle. Moving records between environments requires careful coordination to avoid overwriting in-progress work.

Environment management is about keeping your environments in a consistent, usable state without relying on manual processes.

SRE.ai addresses this through Automations, which let you define and replay environment setup workflows (post-refresh configuration, test data seeding, selective record copying) triggered automatically by deployment events or on demand.

For developer environments specifically, Scratch Orgs and Sandbox Pools let teams provision isolated, short-lived orgs per branch without contention.

Sandbox refresh support

Scenario

Problem:

A team periodically refreshes sandboxes from production to reset test environments.

After a refresh, specific configurations and data need to be reapplied.

Without automation, this process relies on a manual checklist that's easy to miss and slow to complete.

SRE.ai's fit:

SRE.ai's Automations let you define post-refresh steps (such as deploying configuration metadata or seeding test records) that execute automatically when a deployment to the refreshed org succeeds.

circle-check

Who this is for

Teams that run scheduled sandbox refreshes and need consistent post-refresh configuration across environments.

chevron-rightClick to learn how SRE.ai addresses this scenariohashtag

What you'll need

Setup

Create an Automation that fires when the refreshed sandbox receives a successful deployment, then re-applies your standard configuration.

  1. Navigate to the Automations page and click New to open the Automation Builder.

  2. Name the Automation descriptively (e.g., "Post-Refresh: QA Sandbox Configuration").

  3. In the Automation Builder, click the Trigger block to open the Trigger panel.

  4. Select Deployment as the Trigger type.

  5. Add a Deploy Package Step to redeploy your configuration metadata to the refreshed sandbox.

    • Select Connection: choose the pipeline connection for this sandbox

    • Target Salesforce Org: select the refreshed sandbox

    • Test Level: set according to your team's standards

    • See the Steps customization documentation for details on each parameter.

  6. Optionally, add a Load Seed Data Step to populate the sandbox with baseline test records after the metadata deployment completes.

    • Target Org Alias: the alias of the refreshed sandbox

    • Seed Data Path: path to a pre-generated seed file, or reference the output of a prior Generate Seed Data Step using {{GenerateSeedData.exportPath}}

  7. Optionally, add a Send Teams Message Step to notify your team when the post-refresh setup is complete.

  8. Click the Activation button to activate the Automation.

circle-check

Workflow

  1. An admin initiates a sandbox refresh in Salesforce.

  2. Once the refresh completes and SRE.ai detects a successful deployment to the refreshed org, the Automation triggers automatically.

  3. The Deploy Package Step redeploys your configuration metadata to the sandbox.

  4. If a Load Seed Data Step is configured, SRE.ai loads the baseline test records into the sandbox immediately after the deployment completes.

  5. If a Send Teams Message Step is configured, SRE.ai posts a notification confirming that the sandbox is ready.

Result

The sandbox is restored to a working state with all required configurations and test data applied automatically after the refresh. The team can begin testing immediately without working through a manual setup checklist.

Test data seeding

Scenario

Problem:

After a sandbox refresh or when spinning up a new environment, the team needs consistent test data to validate functionality.

Manually entering or scripting test records before each test run is time-consuming and error-prone.

SRE.ai's fit:

SRE.ai's Generate Seed Data and Load Seed Data Steps let you export a dataset from a reference org once and automatically replay it into any target environment.

circle-check

Who this is for

Teams that need every environment to start with a known baseline of test data before validation begins.

chevron-rightClick to learn how SRE.ai addresses this scenariohashtag

What you'll need

Setup

Create an Automation that exports data from a reference org and loads it into the target environment.

  1. Navigate to the Automations page and click New to open the Automation Builder.

  2. Name the Automation descriptively (e.g., "Seed Test Data: QA Environment").

  3. In the Automation Builder, click the Trigger block to open the Trigger panel.

  4. Select Manual to trigger seeding on demand, or Deployment to trigger it automatically after a deployment completes.

  5. Add a Generate Seed Data Step to export data from your reference org.

    • Source Org: the org containing your reference data

    • Export Configuration: a JSON object specifying which objects to export. For example:

  1. Add a Load Seed Data Step to import the exported records into the target environment.

    • Target Org Alias: the alias of the target sandbox

    • Seed Data Path: {{GenerateSeedData.exportPath}}

  2. Optionally, add a Send Teams Message Step to notify the team when seeding completes.

  3. Click the Activation button to activate the Automation.

Example workflow

  1. The team can activate the Automation manually from the Automations Builder, or it can trigger automatically after a deployment.

  2. SRE.ai runs the Generate Seed Data Step, exporting the defined objects from the source org.

  3. SRE.ai immediately runs the Load Seed Data Step, importing those records into the target environment.

  4. The target org contains the full baseline of test records.

  5. If a Send Teams Message Step is configured, SRE.ai posts a notification confirming that seeding is complete.

Result

The target environment contains a consistent baseline of test records. The team can begin validation immediately without manual data entry or custom scripts.

Selective data copy between environments

Scenario

Problem:

A team needs to move specific records (such as configuration data or reference tables) from one environment to another without running a full refresh.

A full refresh would overwrite other in-progress work in the target environment.

SRE.ai's fit:

The Generate Seed Data Step's Export Configuration lets you filter exactly which objects and records to export using SOQL queries. The Load Seed Data Step then imports only those records into the target org.

circle-check

Who this is for

Teams managing multiple active environments that need to share specific records without disrupting in-progress work.

chevron-rightClick to learn how SRE.ai addresses this scenariohashtag

What you'll need

Setup

Create an Automation that exports a specific subset of records from the source org and loads them into the target.

  1. Navigate to the Automations page and click New to open the Automation Builder.

  2. Name the Automation descriptively (e.g., "Selective Data Copy: Config Tables to QA").

  3. In the Automation Builder, click the Trigger block to open the Trigger panel.

  4. Select Manual as the Trigger type.

  5. Add a Generate Seed Data Step to export only the records you need.

    • Source Org: the org containing the records to copy

    • Export Configuration: a JSON object specifying the objects and SOQL filters. For example, to copy only active price books and products:

  • Use the where field to filter by any field on the object. Only records matching the condition are exported.

  1. Add a Load Seed Data Step to insert the exported records into the target environment.

    • Target Org Alias: the alias of the target sandbox

    • Seed Data Path: {{GenerateSeedData.exportPath}}

  2. Click the Activation button to activate the Automation.

circle-check

Example workflow

  1. The team manually activates the Automation in the Automations Builder.

  2. SRE.ai runs the Generate Seed Data Step, exporting only the specified objects and records from the source org.

  3. SRE.ai runs the Load Seed Data Step, inserting those records into the target org.

  4. The target org receives the selected records without disrupting other in-progress work.

Result

The specified records are available in the target environment. No other in-progress work in the target org is affected, and no full sandbox refresh is required.

Ephemeral environments

Scenario

Problem:

A developer wants to spin up a temporary environment to test a feature branch in isolation, then tear it down when done.

Sharing a single sandbox across developers creates bottlenecks and contention.

SRE.ai's fit:

SRE.ai's Create Scratch Org Step provisions a temporary org pre-loaded with metadata from a source org, with an automatic expiration after a configured number of days. Teams can also configure a Sandbox Pool on the developer stage in Pipelines to maintain a pre-provisioned pool of orgs assigned per pull request.

circle-check

Who this is for

Teams practicing parallel feature development who need isolated, short-lived environments per branch or developer.

chevron-rightClick to learn how SRE.ai addresses this scenariohashtag

SRE.ai supports two approaches to ephemeral environments: creating scratch orgs on demand via an Automation, or configuring a Sandbox Pool on the developer pipeline stage so that each pull request is automatically assigned an available org.

What you'll need

Setup

Option A: Create scratch orgs on demand via Automation

Use this approach when developers need a new isolated org at the start of a feature branch.

  1. Navigate to the Automations page and click New to open the Automation Builder.

  2. Name the Automation descriptively (e.g., "Spin Up: Feature Branch Environment").

  3. In the Automation Builder, click the Trigger block to open the Trigger panel.

  4. Select Manual as the Trigger type.

  5. Add a Create Scratch Org Step.

    • Dev Hub Org: your connected Dev Hub

    • Source Org: the org containing the metadata baseline for the scratch org

    • Duration: the number of days the org should remain active before expiring automatically (1–30)

    • See the Steps customization documentation for details on each parameter.

  6. Optionally, add a Load Seed Data Step immediately after to seed test records into the new scratch org.

    • Target Org Alias: {{CreateScratchOrg.alias}}

    • Seed Data Path: path to a pre-generated seed file or a reference to a prior Generate Seed Data Step

  7. Optionally, add a Send Teams Message Step to share the org URL and credentials with the developer.

    • Use {{CreateScratchOrg.login_url}} and {{CreateScratchOrg.username}} in the message body.

  8. Click the Activation button to activate the Automation.

Option B: Sandbox Pool on the developer pipeline stage

Use this approach when every pull request should automatically receive a pre-provisioned org.

  1. Navigate to Pipelines and select your active pipeline.

  2. Click on the Developer / Team / Project stage to open the Stage Details panel.

  3. Under Salesforce org connections, select Sandbox Pool Orgs as the org type.

  4. Configure the pool settings: pool size, active duration, and whether orgs auto-sync with the main branch.

  5. Save the stage configuration. SRE.ai assigns an available org from the pool to each new pull request targeting this stage.

Example workflow

On-demand via Automation:

  1. A developer activates the Automation from the Automations Builder when starting work on a feature branch.

  2. SRE.ai provisions a scratch org and loads metadata from the source org into it.

  3. If a Load Seed Data Step is configured, SRE.ai populates the org with test records immediately after provisioning.

  4. If a Send Teams Message Step is configured, the developer receives the org URL and credentials.

  5. The developer tests in the isolated environment for the duration of their feature work.

  6. When the configured duration expires, Salesforce automatically decommissions the org.

Via Sandbox Pool:

  1. A developer opens a pull request targeting the developer stage.

  2. SRE.ai assigns an available org from the Sandbox Pool to the pull request.

  3. The developer tests their changes in the assigned org without affecting any other developer's environment.

  4. When the pull request is closed or merged, the org is returned to the pool or decommissioned based on the pool configuration.

Result

Each developer or feature branch has an isolated, temporary org for testing. Orgs expire or are decommissioned automatically, requiring no manual teardown. No developer's in-progress work is affected by another developer's changes.

Last updated