
Automation Sandbox Post Copy Configure
Apply a Salesforce sandbox post-copy automation JSON config against a target org.
Install
npx skills add forcedotcom/sf-skills --skill automation-sandbox-post-copy-configure -g -a claude-code -y- Repository
- forcedotcom/sf-skills1.1k
- Category
- Engineering
- Updated
- 5d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- Yes, review before use
What it does
Apply a Salesforce sandbox post-copy automation JSON config against a target org. Use when the user asks to apply, run, execute, dry-run, or preview a post-copy or post-refresh config file (e.g. `post-copy-config.json`) against a sandbox, including activating/deactivating a Flow (PATCH `FlowDefinition.Metadata.activeVersionNumber` to the version, or `null`), re-pointing an OBM endpoint, updating a RemoteSiteSetting URL, or re-scheduling a ScheduledApex job after refresh. Also trigger for phrasings like \"apply post-copy config\", \"run post-copy automation\", \"activate Flow <name> post-refresh\", \"deactivate Flow <name>\", \"re-point outbound messages after refresh\", or \"configure sandbox after refresh\". Per entry, derive the Tooling API sobject, verify via describe, resolve the Id via SOQL, then PATCH the compound `Metadata` field (`ScheduledApex` uses anonymous Apex). DO NOT TRIGGER for generating config JSON from an SOP (use `automation-sandbox-post-copy-config-generate`) or for deploying metadata XML.
Automation: Sandbox Post-Copy Configure
Apply a Salesforce sandbox post-copy automation JSON config to a target
org. Four canonical ConfigurationName values are pinned:
OutboundMessages + RemoteSiteSettings → compound-Metadata PATCH
(Steps A, E); ScheduledApex → anonymous-Apex (Step F) since
CronTrigger is read-only; Flows → flow-activation (Step G), same
compound-Metadata transport as A, E with fixed mutation key
activeVersionNumber + state-aware pre-flight (ALREADY_ACTIVE /
ALREADY_INACTIVE). Non-canonical names are derived + describe-verified.
Every A, E entry must pass Step B (describe 200 + Metadata compound
field) before any PATCH is planned; Step B skipped for ScheduledApex.
Unverified entries are surfaced in the summary and skipped, never
guessed at.
Tool Restrictions
Use ONLY the Bash tool to execute sf CLI commands (sf data query --use-tooling-api, sf api request rest, sf org display). Do NOT
use MCP tools like execute_soql, the compound Metadata PATCH
pattern this skill requires is not available through MCP wrappers.
Invoke sf without --target-org when the user didn't name an
alias (the harness sets the CLI default); never pass --target-org default (NamedOrgNotFoundError). SOQL-over-REST is same-OAuth, no direct DB / non-Salesforce SQL access.
STOP, do this before making any API call
Never call the org from memory. Before the first request:
