$npx -y skills add forcedotcom/sf-skills --skill omnistudio-datapacks-deploySalesforce Industries DataPack deployment automation using Vlocity Build. TRIGGER when: user deploys or validates OmniStudio/Vlocity DataPacks with vlocity commands (packDeploy/packRetry/packExport/packGetDiffs), sets up DataPack CI/CD pipelines, or troubleshoots DataPack migrati
| 1 | # omnistudio-datapacks-deploy: Vlocity Build DataPack Deployment |
| 2 | |
| 3 | Use this skill when the user needs **Vlocity DataPack deployment orchestration**: export/deploy workflow, manifest-driven deploys, failure triage, and CI/CD sequencing for OmniStudio/Industries DataPacks. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## Scope |
| 8 | |
| 9 | Use `omnistudio-datapacks-deploy` when work involves: |
| 10 | - `vlocity packDeploy`, `packRetry`, `packContinue`, `packExport`, `packGetDiffs`, `validateLocalData` |
| 11 | - DataPack job-file design (`projectPath`, `expansionPath`, `manifest`, `queries`) |
| 12 | - org-to-org DataPack migration and retry loops |
| 13 | - troubleshooting DataPack dependency, matching-key, and GlobalKey issues |
| 14 | |
| 15 | Delegate elsewhere when the user is: |
| 16 | - deploying standard metadata with `sf project deploy` -> [platform-metadata-deploy](../platform-metadata-deploy/SKILL.md) |
| 17 | - building OmniScripts, FlexCards, IPs, or Data Mappers -> `omnistudio-*-build` |
| 18 | - designing Product2 EPC bundles -> [omnistudio-epc-catalog-generate](../omnistudio-epc-catalog-generate/SKILL.md) |
| 19 | - writing Apex/LWC code -> [platform-apex-generate](../platform-apex-generate/SKILL.md), [experience-lwc-generate](../experience-lwc-generate/SKILL.md) |
| 20 | |
| 21 | --- |
| 22 | |
| 23 | ## Critical Operating Rules |
| 24 | |
| 25 | - Use **Vlocity Build (`vlocity`)** commands for DataPacks, not `sf project deploy`. |
| 26 | - Prefer Salesforce CLI auth integration (`-sfdx.username <alias>`) over username/password files when available. |
| 27 | - Always run a **pre-deploy quality gate** before full deploy: |
| 28 | 1) `validateLocalData` |
| 29 | 2) optional `packGetDiffs` |
| 30 | 3) then `packDeploy` |
| 31 | - Use `packRetry` repeatedly when error counts are dropping; stop when retries no longer improve results. |
| 32 | - Keep matching-key strategy and GlobalKey integrity consistent across source and target orgs. |
| 33 | |
| 34 | --- |
| 35 | |
| 36 | ## Required Context to Gather First |
| 37 | |
| 38 | Ask for or infer: |
| 39 | - source org and target org aliases |
| 40 | - job file path and DataPack project path |
| 41 | - deployment scope (full project, manifest subset, or specific `-key`) |
| 42 | - whether this is export, deploy, retry, continue, or diff-only |
| 43 | - namespace model (`%vlocity_namespace%`, `vlocity_cmt`, or core) |
| 44 | - known constraints (new sandbox bootstrap, trigger behavior, matching key customizations) |
| 45 | |
| 46 | Preflight checks: |
| 47 | |
| 48 | ```bash |
| 49 | vlocity help |
| 50 | sf org list |
| 51 | sf org display --target-org <alias> --json |
| 52 | test -f <job-file>.yaml |
| 53 | ``` |
| 54 | |
| 55 | --- |
| 56 | |
| 57 | ## Recommended Workflow |
| 58 | |
| 59 | ### 1. Ensure tool readiness |
| 60 | ```bash |
| 61 | npm install --global vlocity |
| 62 | vlocity help |
| 63 | ``` |
| 64 | |
| 65 | ### 2. Validate project data locally |
| 66 | ```bash |
| 67 | vlocity -sfdx.username <source-alias> -job <job-file>.yaml validateLocalData |
| 68 | ``` |
| 69 | |
| 70 | Use `--fixLocalGlobalKeys` only when explicitly requested and after explaining impact. |
| 71 | |
| 72 | ### 3. Export from source (when needed) |
| 73 | ```bash |
| 74 | vlocity -sfdx.username <source-alias> -job <job-file>.yaml packExport |
| 75 | vlocity -sfdx.username <source-alias> -job <job-file>.yaml packRetry |
| 76 | ``` |
| 77 | |
| 78 | ### 4. Deploy to target |
| 79 | ```bash |
| 80 | vlocity -sfdx.username <target-alias> -job <job-file>.yaml packDeploy |
| 81 | vlocity -sfdx.username <target-alias> -job <job-file>.yaml packRetry |
| 82 | ``` |
| 83 | |
| 84 | ### 5. Continue interrupted jobs |
| 85 | ```bash |
| 86 | vlocity -sfdx.username <target-alias> -job <job-file>.yaml packContinue |
| 87 | ``` |
| 88 | |
| 89 | ### 6. Verify post-deploy parity |
| 90 | ```bash |
| 91 | vlocity -sfdx.username <target-alias> -job <job-file>.yaml packGetDiffs |
| 92 | ``` |
| 93 | |
| 94 | Job-file starter: [references/job-file-template.md](references/job-file-template.md) |
| 95 | |
| 96 | --- |
| 97 | |
| 98 | ## Gotchas |
| 99 | |
| 100 | | Error / symptom | Likely cause | Default fix direction | |
| 101 | |---|---|---| |
| 102 | | `No match found for ...` | missing dependency in target org | include missing DataPack key and redeploy | |
| 103 | | `Duplicate Results found for ... GlobalKey` | duplicate records in target | clean duplicates and re-run deploy | |
| 104 | | `Multiple Imported Records ... same Salesforce Record` | source duplicate matching-key records | remove duplicates in source and re-export | |
| 105 | | `No Configuration Found` | outdated DataPack settings | run `packUpdateSettings` or enable `autoUpdateSettings` | |
| 106 | | `Some records were not processed` | settings mismatch / partial dependency state | refresh settings both orgs, then retry | |
| 107 | | SASS / template compile failures | missing referenced UI template assets | export/deploy referenced template dependencies first | |
| 108 | |
| 109 | Detailed matrix: [references/troubleshooting-matrix.md](references/troubleshooting-matrix.md) |
| 110 | |
| 111 | --- |
| 112 | |
| 113 | ## CI/CD Guidance |
| 114 | |
| 115 | Default pipeline shape: |
| 116 | 1. authenticate orgs (`sf org login ...`) |
| 117 | 2. validate local DataPack integrity (`validateLoc |