automation-sandbox-post-copy-config-generate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAutomation: Sandbox Post-Copy Config Generate
自动化:沙箱复制后配置生成
Convert a customer's sandbox-refresh / post-copy SOP into a structured JSON
array that the post-copy automation tool consumes. Each entry is a
declarative instruction: which Salesforce configuration to update, which
fields are involved, whether it is active, and what order it runs in.
将客户的沙箱刷新/复制后SOP转换为复制后自动化工具可读取的结构化JSON数组。每个条目都是一条声明式指令:指定要更新的Salesforce配置、涉及的字段、是否启用以及执行顺序。
STOP — do this before writing any JSON
注意——在编写任何JSON之前请执行此操作
Do not compose the output from memory. Before you write the file, you
MUST open and read and copy an entry from it
for each action. Every output entry is exactly one of these two shapes —
five top-level keys, no others, no wrapper object:
assets/config_template.jsonjson
[
{
"ConfigurationName": "OutboundMessages",
"Label": "IR_Account_OBM_PROD",
"Fields": { "EndpointUrl": "https://uat.example.com/services/account", "Object": "Account" },
"IsActive": true,
"ExecutionOrder": 1
},
{
"ConfigurationName": "RemoteSiteSettings",
"Label": "R12_Remote_Site",
"Fields": { "RemoteSiteUrl": "https://uat.example.com" },
"IsActive": true,
"ExecutionOrder": 2
}
]- : exactly
ConfigurationNameorOutboundMessages— neverRemoteSiteSettings,Type, orName.Operation - OBM :
Fields+EndpointUrl(both required). RemoteSiteObject:Fieldsonly — neverRemoteSiteUrl/Url.RemoteSiteURL - Top level is a JSON array. No /
steps/actionswrapper. Norecordsor<…>placeholder ever survives into the output.REPLACE_WITH_…
If you announce "I will now write …" without having read the template and
catalog, stop and read them first — a from-memory guess produces the wrong
keys and fails at runtime.
请勿凭记忆编写输出内容。在编写文件之前,您必须打开并读取,并为每个操作复制其中的一个条目。每个输出条目必须完全符合以下两种格式之一——包含五个顶级键,不得有其他键,也不得有包装对象:
assets/config_template.jsonjson
[
{
"ConfigurationName": "OutboundMessages",
"Label": "IR_Account_OBM_PROD",
"Fields": { "EndpointUrl": "https://uat.example.com/services/account", "Object": "Account" },
"IsActive": true,
"ExecutionOrder": 1
},
{
"ConfigurationName": "RemoteSiteSettings",
"Label": "R12_Remote_Site",
"Fields": { "RemoteSiteUrl": "https://uat.example.com" },
"IsActive": true,
"ExecutionOrder": 2
}
]- :必须为
ConfigurationName或OutboundMessages——绝对不能是RemoteSiteSettings、Type或Name。Operation - OBM的:必须包含
Fields和EndpointUrl(两者均为必填项)。RemoteSite的Object:只能包含Fields——绝对不能是RemoteSiteUrl/Url。RemoteSiteURL - 顶级结构为JSON数组。不得使用/
steps/actions作为包装键。输出内容中不得保留任何records或<…>占位符。REPLACE_WITH_…
如果您在未读取模板和目录的情况下就宣称“我现在将编写……”,请立即停止并先读取这些文件——凭记忆猜测会导致键名错误,进而在运行时失败。
Scope
适用范围
- In scope: Reading a customer SOP in any of the supported formats
(PDF, xlsx, csv, JSON, docx, Markdown, plain text, pasted excerpt, or
images containing data tables — e.g., a screenshot of an
Outbound Messages list with endpoint URLs), identifying post-copy /
post-refresh actions, mapping each action to a supported
, emitting the canonical JSON array.
ConfigurationName - Out of scope: Generating Salesforce metadata XML (delegate to
skills), deploying anything to an org, running the post-copy tool, inferring or fabricating values not present in the SOP — if the SOP does not give a concrete URL/value for an action, skip the action.
generating-*
Every emitted entry must have every Field populated with a real value
from the customer source. No empty strings, no , no
/ / placeholders. Customers should never
see an unpopulated field in the output — if a value cannot be located,
skip the entry and surface it. See the corresponding rule below.
null<from-backup>TBDTODO- 适用场景:读取任意支持格式的客户SOP(PDF、xlsx、csv、JSON、docx、Markdown、纯文本、粘贴的摘录或包含数据表的图片——例如,带有端点URL的出站消息列表截图),识别复制后/刷新后操作,将每个操作映射到受支持的,生成标准JSON数组。
ConfigurationName - 不适用场景:生成Salesforce元数据XML(请委托给类技能)、将任何内容部署到组织、运行复制后工具、推断或编造SOP中未包含的值——如果SOP未提供操作的具体URL/值,请跳过该操作。
generating-*
每个生成的条目必须包含从客户源获取的真实值。不得有空字符串、或//等占位符。客户在输出内容中绝不能看到未填充的字段——如果无法找到某个值,请跳过该条目并告知用户。请参阅下方对应的规则。
null<from-backup>TBDTODORequired Inputs
必填输入项
Gather or infer before generating:
- SOP source(s): One or more paths (or pasted content) in any of: PDF, xlsx, csv, JSON, docx, Markdown, plain text, or images (.png/.jpg/.jpeg/.tiff/.bmp). Multiple files are common — the action list and the endpoint table sometimes live in different files. Read every file the user supplies.
- Target output path: Where the JSON config should be written. Default
to in the current directory unless specified.
post-copy-config.json - Scope filter (optional): If the SOP covers many environments (e.g., fcQA, fcUAT, multiple sandboxes), confirm which subset the user wants in the output.
If the user provides a clear SOP and target, generate immediately without
asking unnecessary questions.
生成前需收集或推断以下信息:
- SOP源文件:一个或多个路径(或粘贴的内容),格式包括:PDF、xlsx、csv、JSON、docx、Markdown、纯文本或图片(.png/.jpg/.jpeg/.tiff/.bmp)。多文件情况很常见——操作列表和端点表格有时会存放在不同文件中。请读取用户提供的所有文件。
- 目标输出路径:JSON配置文件的写入位置。除非另有指定,默认写入当前目录下的。
post-copy-config.json - 范围筛选器(可选):如果SOP涵盖多个环境(如fcQA、fcUAT、多个沙箱),请确认用户希望输出的子集范围。
如果用户提供了清晰的SOP和目标路径,请立即生成,无需询问不必要的问题。
Workflow
工作流程
All steps are sequential. Steps 1–5 (reading the SOP, the catalog, the
template, and the schema) are prerequisites to writing — you may not
skip to the write step. If you catch yourself about to emit JSON without
having read and
, go back and read them first.
assets/config_template.jsonreferences/configuration_catalog.md-
Locate and read every supplied SOP source — readfor the exact extraction recipe per format (PDF, xlsx, csv, JSON, docx, image). At a glance:
references/source_format_handling.md- PDF: extract text with (text layer) and OCR image-based pages with
pypdfif the text layer is empty.pytesseract - xlsx: read every sheet with (
openpyxl), scan all columns including ones outside the visible default range, check cell comments and embedded media.data_only=True - csv / JSON / Markdown / text: read directly.
- docx: extract paragraphs and tables with .
python-docx - Images (.png/.jpg/...): use the tool to view, then decide if the image carries data (a table of endpoint URLs, a setup screenshot showing values to capture) or is purely illustrative (architecture diagram, flow chart). Extract values only from data-bearing images. See the image-handling rules in
Read.references/source_format_handling.md - For very large SOPs (>50 pages / >20 sheets), focus on sections or sheets titled "Post Refresh", "Post-Copy", "Post-Refresh Steps", "Update …", or equivalent.
- PDF: extract text with
-
Identify post-copy actions — readfor the heuristics that turn prose instructions ("Update Outbound Message endpoint X to URL Y") into structured action records.
references/sop_parsing_patterns.md -
Map each action to a— load
ConfigurationName. The catalog currently supports onlyreferences/configuration_catalog.mdandOutboundMessages. Any action that targets a different configuration type is out of scope: skip it and list it in the response so the user can extend the catalog later.RemoteSiteSettings -
Read the JSON template — load. It shows the exact required shape of one
assets/config_template.jsonentry and oneOutboundMessagesentry, withRemoteSiteSettingsplaceholder slots. Copy an entry, replace every<…>slot with the concrete SOP value, and keep the exact top-level keys (<…>,ConfigurationName,Label,Fields,IsActive) — never rename them toExecutionOrder,Type,Name, etc. Never emit an entry that still contains aOperationplaceholder; if you cannot fill a slot, skip the entry (see Rules).<…> -
Validate against the schema — load. Every entry must conform:
assets/json_schema.jsonis one of the catalog values,ConfigurationNameis an object,Fieldsis boolean,IsActiveis a positive integer.ExecutionOrder -
Group entries by phase, then assign—
ExecutionOrderis a phase number, not a per-row counter. Entries that can run in parallel (no dependency between them) share the same value. DifferentExecutionOrdertypes typically get different phases; all entries within one phase share its number. See the ordering heuristic inConfigurationName.references/sop_parsing_patterns.md -
Compare against the example — verify the output shape againstbefore writing.
examples/sample_sop_to_config.json -
Write the JSON file — emit pretty-printed JSON (2-space indent).
所有步骤按顺序执行。步骤1-5(读取SOP、目录、模板和 schema)是编写前的先决条件——不得直接跳至编写步骤。如果发现自己在未读取和的情况下就要生成JSON,请返回并先读取这些文件。
assets/config_template.jsonreferences/configuration_catalog.md-
定位并读取所有提供的SOP源文件——请阅读,了解针对每种格式(PDF、xlsx、csv、JSON、docx、图片)的具体提取方法。简要说明:
references/source_format_handling.md- PDF:使用提取文本层内容;如果文本层为空,使用
pypdf对基于图片的页面进行OCR识别。pytesseract - xlsx:使用读取所有工作表(
openpyxl),扫描包括默认可见范围之外的所有列,检查单元格注释和嵌入媒体。data_only=True - csv / JSON / Markdown / 纯文本:直接读取。
- docx:使用提取段落和表格。
python-docx - 图片(.png/.jpg/...):使用工具查看,判断图片是否包含数据(如端点URL表格、显示需捕获值的设置截图)或仅为说明性内容(架构图、流程图)。仅从承载数据的图片中提取值。请参阅
Read中的图片处理规则。references/source_format_handling.md - 对于非常大的SOP(超过50页/20个工作表),重点关注标题为“Post Refresh”、“Post-Copy”、“Post-Refresh Steps”、“Update …”或类似名称的章节或工作表。
- PDF:使用
-
识别复制后操作——请阅读,了解将文字说明(如“将出站消息端点X更新为URL Y”)转换为结构化操作记录的启发式方法。
references/sop_parsing_patterns.md -
将每个操作映射到——加载
ConfigurationName。目前目录仅支持references/configuration_catalog.md和OutboundMessages。任何针对其他配置类型的操作均不适用:请跳过该操作并在响应中列出,以便用户日后扩展目录。RemoteSiteSettings -
读取JSON模板——加载。该模板展示了
assets/config_template.json条目和OutboundMessages条目的精确必填格式,包含RemoteSiteSettings占位符槽位。复制一个条目,将每个<…>槽位替换为SOP中的具体值,并保留精确的顶级键(<…>、ConfigurationName、Label、Fields、IsActive)——绝不能将其重命名为ExecutionOrder、Type、Name等。输出内容中绝不能保留包含Operation占位符的条目;如果无法填充某个槽位,请跳过该条目(请参阅规则)。<…> -
根据schema验证——加载。每个条目必须符合要求:
assets/json_schema.json为目录中的值之一,ConfigurationName为对象,Fields为布尔值,IsActive为正整数。ExecutionOrder -
按阶段分组条目,然后分配——
ExecutionOrder是阶段编号,而非每行计数器。可并行运行的条目(彼此无依赖)共享相同的值。不同的ExecutionOrder类型通常分配不同的阶段;同一阶段内的所有条目共享该阶段编号。请参阅ConfigurationName中的排序启发式方法。references/sop_parsing_patterns.md -
与示例对比——在写入前,验证输出格式是否与一致。
examples/sample_sop_to_config.json -
写入JSON文件——生成格式化的JSON(2空格缩进)。
Rules / Constraints
规则/约束
| Constraint | Rationale |
|---|---|
| Output is a JSON array at the top level (not an object with a wrapper key) | The post-copy tool consumes an array directly |
Every entry has all five required keys: | The tool fails fast on missing keys; partial entries are not silently accepted |
| Unknown values cause the runtime mapper to error out — never invent a new type without updating the catalog |
| Wrong key names mean the tool can't locate the field at runtime |
| The post-copy tool applies the value as-is; placeholders are not resolved at runtime |
| If the SOP names an action but no concrete value (URL, etc.) is provided, skip the entry entirely and list it in the response | Generating an entry without a real value would produce a silent no-op or a deployment error at runtime |
Every Field in every emitted entry must be a real value sourced from the customer's SOP or a supplemental sheet they provided. Never emit | Customers consume the JSON directly — empty / placeholder fields surface to them as broken output and would also fail at runtime |
| Before skipping an OBM / RemoteSite for missing values, search every tab / sheet of the supplied workbook (and every supplied file) for an endpoint table keyed by that name | Customer SOPs frequently split the action list and the URL table across different sheets (e.g., the Michelin UAT Refresh Planner lists OBMs in the Integration tab but the URL table lives in the Evolution SFA tab) |
Information already captured by another field is not repeated in | Duplicate keys make the entry ambiguous and waste bytes the tool then has to reconcile |
For | Same Label can apply to multiple OBMs differing only by entity; |
For | The post-copy tool matches the field by exact API name; any other spelling means it can't locate the field and the entry silently no-ops at runtime |
| The post-copy tool runs all entries with the same |
| The customer toggles them on per-environment; deleting loses traceability |
Default | Most SOP steps are required; explicit opt-out is the exception |
| 约束条件 | 原因 |
|---|---|
| 输出顶级结构为JSON数组(而非带有包装键的对象) | 复制后工具直接读取数组 |
每个条目包含所有五个必填键: | 工具会因缺少键而快速失败;不接受部分条目 |
| 未知值会导致运行时映射器出错——在未更新目录的情况下绝不能创建新类型 |
| 错误的键名会导致工具在运行时无法定位字段 |
| 复制后工具会按原样应用该值;占位符不会在运行时解析 |
| 如果SOP指定了操作但未提供具体值(如URL等),请完全跳过该条目并在响应中列出 | 生成无真实值的条目会导致运行时无操作或部署错误 |
每个生成条目中的每个字段必须是从客户SOP或其提供的补充表格中获取的真实值。绝不能输出 | 客户会直接使用该JSON;空/占位符字段会被视为损坏的输出,且在运行时也会失败 |
| 在因缺少值而跳过OBM/RemoteSite之前,请搜索提供的工作簿的所有标签/工作表(以及所有提供的文件),查找以该名称为键的端点表格 | 客户SOP经常将操作列表和URL表格拆分到不同工作表中(例如,Michelin UAT刷新规划器在Integration标签中列出OBM,但URL表格位于Evolution SFA标签中) |
已由其他字段捕获的信息不得在 | 重复键会导致条目歧义,且会增加工具需要协调的字节数 |
对于 | 相同Label可应用于多个仅实体不同的OBM; |
对于 | 复制后工具通过精确API名称匹配字段;任何其他拼写都会导致工具无法定位字段,进而在运行时无操作 |
| 复制后工具会并行运行所有具有相同 |
| 客户会根据环境切换启用状态;删除会丢失可追溯性 |
当SOP标记某个操作为必填项时,默认 | 大多数SOP步骤为必填项;明确选择退出是例外情况 |
Canonical entry shape
标准条目格式
See the entry shapes shown in the STOP section above, or copy directly from
. Do not rename the five top-level keys
(, , , , ) to
, , , , etc., and do not wrap the array
in an object with a / / key.
assets/config_template.jsonConfigurationNameLabelFieldsIsActiveExecutionOrderTypeNameOperationapiNamestepsactionsrecords请参阅上方“注意”部分所示的条目格式,或直接从中复制。请勿将五个顶级键(、、、、)重命名为、、、等,请勿将数组包装在带有//键的对象中。
assets/config_template.jsonConfigurationNameLabelFieldsIsActiveExecutionOrderTypeNameOperationapiNamestepsactionsrecordsGotchas
常见问题
| Issue | Resolution |
|---|---|
| SOP step says "delete all endpoints" rather than "update X to Y" | Emit an entry with |
| Same Label appears for multiple environments (fcQA + fcUAT) | Emit one entry per environment; suffix the Label or use the environment-specific Label as it appears in the SOP |
For OutboundMessages, the same Label can legitimately apply to multiple entries when each targets a different | Do not collapse them — emit one entry per Object. The |
| SOP groups many Custom Labels together in a single table | One entry per row of the table — do not collapse into a single bulk entry |
| Action targets a setting outside the catalog (CustomLabels, ConnectedApps, NamedCredentials, SSO, CustomSettings, etc.) | Skip the action, do NOT invent a new |
| SOP includes pre-refresh steps interleaved with post-refresh | Filter out pre-refresh — only post-refresh / post-copy actions belong in the output |
| SOP names an outbound message / remote site to update but does not include the new URL | Skip the entry. List the skipped item in the response so the user can supply the URL or amend the SOP |
SOP includes secrets in URLs (e.g., | Embed them verbatim — the tool consumes the value as-is — but flag in the response so the user is aware the JSON now contains a secret and should be stored / shared accordingly |
| User's SOP is in a non-English language or has heavy formatting (tables, callouts) | Extract the prose first, normalize whitespace, then parse — formatting artifacts do not need to survive into the JSON |
| The SOP includes screenshots / images. Some are illustrative (architecture diagrams, flow charts, "this is what the setup screen looks like" examples); others are data-bearing (a screenshot of a real Outbound Messages list, a captured Remote Site table). | Treat illustrative images as out-of-scope — do NOT extract values from them. For data-bearing images (the surrounding text refers to "the values shown below" / "as captured in the screenshot above" / a real Endpoint URL is visible), OCR them and use the values. See |
| The SOP is supplied as multiple files (e.g., a PDF + a companion xlsx + a screenshot folder), or values are split across tabs / pages | Read every supplied file end-to-end before skipping any entry. The action list and the URL table are frequently in different files — see the rule above about multi-sheet sources. |
| 问题 | 解决方案 |
|---|---|
| SOP步骤要求“删除所有端点”而非“将X更新为Y” | 生成一个 |
| 同一Label出现在多个环境中(fcQA + fcUAT) | 为每个环境生成一个条目;在Label后添加后缀,或使用SOP中显示的特定环境Label |
对于OutboundMessages,当每个条目针对不同的 | 请勿合并——为每个Object生成一个条目。 |
| SOP在单个表格中分组了多个Custom Label | 为表格中的每一行生成一个条目——请勿合并为单个批量条目 |
| 操作针对目录外的设置(CustomLabels、ConnectedApps、NamedCredentials、SSO、CustomSettings等) | 跳过该操作,请勿创建新的 |
| SOP中包含刷新前步骤和刷新后步骤混合的情况 | 过滤掉刷新前步骤——仅保留刷新后/复制后操作在输出中 |
| SOP指定了要更新的出站消息/远程站点,但未包含新URL | 跳过该条目。在响应中列出跳过的项,以便用户提供URL或修改SOP |
SOP的URL中包含密钥(如 | 按原样嵌入——工具会按原样使用该值——但需在响应中标记,以便用户知晓该JSON现在包含密钥,应妥善存储/共享 |
| 用户的SOP为非英语语言或包含复杂格式(表格、标注) | 先提取文字内容,标准化空格,再进行解析——格式伪影无需保留在JSON中 |
| SOP包含截图/图片。部分为说明性内容(架构图、流程图、“设置界面如下所示”示例);部分为承载数据的内容(真实出站消息列表截图、捕获的远程站点表格) | 将说明性图片视为不适用场景——请勿从中提取值。对于承载数据的图片(周围文字提及“如下所示的值”/“如上方截图所示”/可见真实端点URL),对其进行OCR识别并使用提取的值。请参阅 |
| SOP以多个文件形式提供(如PDF + 配套xlsx + 截图文件夹),或值拆分到不同标签/页面中 | 在跳过任何条目之前,请完整读取所有提供的文件。操作列表和URL表格经常存放在不同文件中——请参阅上方关于多工作表源的规则。 |
Output Expectations
输出预期
Deliverables:
- A single JSON file (default ) containing a top-level array of post-copy action entries.
post-copy-config.json - A short summary in your response listing: total entries, count per
, actions skipped because they did not map to the catalog, and actions skipped because the SOP did not include a concrete value.
ConfigurationName
The output file structure conforms to .
assets/json_schema.json交付成果:
- 单个JSON文件(默认),包含顶级数组形式的复制后操作条目。
post-copy-config.json - 响应中的简短摘要,列出:条目总数、每种的数量、因无法映射到目录而跳过的操作、因SOP未包含具体值而跳过的操作。
ConfigurationName
输出文件结构符合的要求。
assets/json_schema.jsonCross-Skill Integration
跨技能集成
| Need | Delegate to |
|---|---|
| Generate the actual Salesforce metadata XML for a Custom Label / Named Credential / Remote Site / etc. | The matching |
| Deploy generated metadata or run the post-copy tool against an org | |
| Compare an SOP against entities defined in UDD | |
| 需求 | 委托给 |
|---|---|
| 为Custom Label / Named Credential / Remote Site等生成实际的Salesforce元数据XML | 对应的 |
| 将生成的元数据部署到组织或针对组织运行复制后工具 | |
| 将SOP与UDD中定义的实体进行对比 | |
Reference File Index
参考文件索引
| File | When to read |
|---|---|
| Step 4 — starting structure for the JSON output |
| Step 5 — validate every emitted entry |
| Step 3 — to map an SOP action to a |
| Step 2 and step 6 — heuristics for extracting actions from prose and ordering them |
| Step 1 — exact extraction recipe per input format (PDF / xlsx / csv / JSON / docx / image) and the data-bearing-vs-illustrative image heuristic |
| Step 7 — verify output shape matches expected format |
| Step 7 — see a representative SOP excerpt that produced the sample JSON |
| 文件 | 读取时机 |
|---|---|
| 步骤4——JSON输出的起始结构 |
| 步骤5——验证每个生成的条目 |
| 步骤3——将SOP操作映射到 |
| 步骤2和步骤6——从文字内容提取操作和排序的启发式方法 |
| 步骤1——针对每种输入格式(PDF / xlsx / csv / JSON / docx / 图片)的具体提取方法,以及承载数据vs说明性图片的启发式方法 |
| 步骤7——验证输出格式是否符合预期 |
| 步骤7——查看生成示例JSON的代表性SOP摘录 |