Environment 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.
This use case relies on SRE.ai's Automations feature.
Read the Automations documentation for an overview of Triggers and Steps, and the Salesforce Orgs documentation to confirm your sandbox is connected.
Who this is for
Teams that run scheduled sandbox refreshes and need consistent post-refresh configuration across environments.
Click to learn how SRE.ai addresses this scenario
What you'll need
A connected Salesforce org for the sandbox being refreshed (see Salesforce Orgs documentation)
A committed metadata package containing your post-refresh configuration
An Automation configured with a Deployment trigger (see Automations documentation)
Setup
Create an Automation that fires when the refreshed sandbox receives a successful deployment, then re-applies your standard configuration.
Navigate to the Automations page and click New to open the Automation Builder.
Name the Automation descriptively (e.g., "Post-Refresh: QA Sandbox Configuration").
In the Automation Builder, click the Trigger block to open the Trigger panel.
Select Deployment as the Trigger type.
Under Org filter, select the sandbox org that will be refreshed.
Under Status filter, select Success.
See the Triggers customization documentation for details on each parameter.
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.
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}}
Optionally, add a Send Teams Message Step to notify your team when the post-refresh setup is complete.
Click the Activation button to activate the Automation.
If you also want to seed test data as part of this workflow, read the Test data seeding use case below for a walkthrough of the Generate Seed Data and Load Seed Data steps.
Workflow
An admin initiates a sandbox refresh in Salesforce.
Once the refresh completes and SRE.ai detects a successful deployment to the refreshed org, the Automation triggers automatically.
The Deploy Package Step redeploys your configuration metadata to the sandbox.
If a Load Seed Data Step is configured, SRE.ai loads the baseline test records into the sandbox immediately after the deployment completes.
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.
Test data seeding is handled through SRE.ai's Automations feature.
Read the Automations documentation for an overview of how Triggers and Steps work together, and the Steps customization documentation for the full parameter reference for each Step.
Who this is for
Teams that need every environment to start with a known baseline of test data before validation begins.
Click to learn how SRE.ai addresses this scenario
What you'll need
A Salesforce org containing the reference data you want to export as seed data (see Salesforce Orgs documentation)
A target org (sandbox or scratch org) to load data into
An Automation configured with a Manual or Deployment Trigger (see Automations documentation)
Setup
Create an Automation that exports data from a reference org and loads it into the target environment.
Navigate to the Automations page and click New to open the Automation Builder.
Name the Automation descriptively (e.g., "Seed Test Data: QA Environment").
In the Automation Builder, click the Trigger block to open the Trigger panel.
Select Manual to trigger seeding on demand, or Deployment to trigger it automatically after a deployment completes.
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:
Use the
wherefield inside any object entry to filter which records are exported. See the Steps customization documentation for the full export configuration reference.
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}}
Optionally, add a Send Teams Message Step to notify the team when seeding completes.
Click the Activation button to activate the Automation.
Example workflow
The team can activate the Automation manually from the Automations Builder, or it can trigger automatically after a deployment.
SRE.ai runs the Generate Seed Data Step, exporting the defined objects from the source org.
SRE.ai immediately runs the Load Seed Data Step, importing those records into the target environment.
The target org contains the full baseline of test records.
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.
This use case relies on SRE.ai's Generate Seed Data and Load Seed Data Steps.
Read the Steps customization documentation for the full Export Configuration reference and parameter details.
Who this is for
Teams managing multiple active environments that need to share specific records without disrupting in-progress work.
Click to learn how SRE.ai addresses this scenario
What you'll need
A source Salesforce org containing the records to copy (see Salesforce Orgs documentation)
A target Salesforce org to receive the records
An Automation configured with a Manual Trigger (see Automations documentation)
Setup
Create an Automation that exports a specific subset of records from the source org and loads them into the target.
Navigate to the Automations page and click New to open the Automation Builder.
Name the Automation descriptively (e.g., "Selective Data Copy: Config Tables to QA").
In the Automation Builder, click the Trigger block to open the Trigger panel.
Select Manual as the Trigger type.
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
wherefield to filter by any field on the object. Only records matching the condition are exported.
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}}
Click the Activation button to activate the Automation.
Keep the Export Configuration scoped to only the objects you need.
Exporting unrelated objects increases runtime and API consumption on the source org.
Example workflow
The team manually activates the Automation in the Automations Builder.
SRE.ai runs the Generate Seed Data Step, exporting only the specified objects and records from the source org.
SRE.ai runs the Load Seed Data Step, inserting those records into the target org.
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.
Ephemeral environments can be created via Automations or configured directly on a pipeline stage.
Read the Automations documentation and the Pipelines documentation for more on how both approaches work.
Who this is for
Teams practicing parallel feature development who need isolated, short-lived environments per branch or developer.
Click to learn how SRE.ai addresses this scenario
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
A connected Dev Hub org (see Salesforce Orgs documentation)
A source org whose metadata will be loaded into the scratch org
An Automation configured with a Manual or Deployment Trigger (see Automations documentation), for the on-demand approach
At least one Pipeline configured with a developer stage, for the Sandbox Pool approach (see Pipelines documentation)
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.
Navigate to the Automations page and click New to open the Automation Builder.
Name the Automation descriptively (e.g., "Spin Up: Feature Branch Environment").
In the Automation Builder, click the Trigger block to open the Trigger panel.
Select Manual as the Trigger type.
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.
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
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.
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.
Navigate to Pipelines and select your active pipeline.
Click on the Developer / Team / Project stage to open the Stage Details panel.
Under Salesforce org connections, select Sandbox Pool Orgs as the org type.
See the Pipelines documentation for more on Sandbox Pool Orgs and how they differ from regular org connections.
Configure the pool settings: pool size, active duration, and whether orgs auto-sync with the main branch.
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:
A developer activates the Automation from the Automations Builder when starting work on a feature branch.
SRE.ai provisions a scratch org and loads metadata from the source org into it.
If a Load Seed Data Step is configured, SRE.ai populates the org with test records immediately after provisioning.
If a Send Teams Message Step is configured, the developer receives the org URL and credentials.
The developer tests in the isolated environment for the duration of their feature work.
When the configured duration expires, Salesforce automatically decommissions the org.
Via Sandbox Pool:
A developer opens a pull request targeting the developer stage.
SRE.ai assigns an available org from the Sandbox Pool to the pull request.
The developer tests their changes in the assigned org without affecting any other developer's environment.
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

