@salesforce/afv-skills 1.63.0 → 1.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-gpt-email-generation-configure/SKILL.md +312 -0
  3. package/skills/agentforce-offline-experimentation-run/SKILL.md +253 -0
  4. package/skills/agentforce-offline-experimentation-run/scripts/build_report.py +796 -0
  5. package/skills/agentforce-offline-experimentation-run/scripts/resolve-token.sh +111 -0
  6. package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +1053 -0
  7. package/skills/agentforce-wizard-ui-forecasting-analytics-components-configure/SKILL.md +64 -0
  8. package/skills/agentforce-wizard-ui-sales-einstein-components-configure/SKILL.md +46 -0
  9. package/skills/automation-company-profile-info-query/SKILL.md +51 -0
  10. package/skills/automation-digital-wallet-configure/SKILL.md +689 -0
  11. package/skills/automation-flow-coordinate/SKILL.md +95 -0
  12. package/skills/automation-flow-coordinate/references/elements/action-call/action-call.md +1569 -0
  13. package/skills/automation-flow-coordinate/references/elements/action-call/conversation-messaging.md +96 -0
  14. package/skills/automation-flow-coordinate/references/elements/action-call/examples/send-sms-message.json +23 -0
  15. package/skills/automation-flow-coordinate/references/elements/action-call/examples/send-to-journey-no-fields.json +31 -0
  16. package/skills/automation-flow-coordinate/references/elements/action-call/send-to-journey.md +179 -0
  17. package/skills/automation-flow-coordinate/references/elements/exit-rule/examples/event-email-link-click.json +13 -0
  18. package/skills/automation-flow-coordinate/references/elements/exit-rule/exit-rule.md +83 -0
  19. package/skills/automation-flow-coordinate/references/elements/forward-to-bot-or-agent/examples/forward-to-bot-or-agent.json +69 -0
  20. package/skills/automation-flow-coordinate/references/elements/forward-to-bot-or-agent/forward-to-bot-or-agent.md +274 -0
  21. package/skills/automation-flow-coordinate/references/elements/start/audience-common.md +192 -0
  22. package/skills/automation-flow-coordinate/references/elements/start/automation-event-triggered.md +130 -0
  23. package/skills/automation-flow-coordinate/references/elements/start/data-cloud-data-change-triggered.md +92 -0
  24. package/skills/automation-flow-coordinate/references/elements/start/form-submission-triggered.md +88 -0
  25. package/skills/automation-flow-coordinate/references/elements/start/segment-triggered.md +152 -0
  26. package/skills/automation-flow-coordinate/references/elements/start/start.md +539 -0
  27. package/skills/automation-flow-coordinate/references/elements/subflow/subflow.md +152 -0
  28. package/skills/automation-flow-coordinate/references/elements/wait/wait.md +497 -0
  29. package/skills/automation-flow-coordinate/references/recipes/author/author.md +868 -0
  30. package/skills/automation-flow-coordinate/references/recipes/summarize/element-generic.md +300 -0
  31. package/skills/automation-flow-coordinate/references/recipes/summarize/reference-resolution.md +292 -0
  32. package/skills/automation-flow-coordinate/references/recipes/summarize/summarize.md +323 -0
  33. package/skills/automation-flow-coordinate/references/recipes/testing/examples/debug-output-template.md +109 -0
  34. package/skills/automation-flow-coordinate/references/recipes/testing/shape.md +219 -0
  35. package/skills/automation-flow-coordinate/references/recipes/testing/shared-stages/intent-analyzer.md +180 -0
  36. package/skills/automation-flow-coordinate/references/recipes/testing/workflows/debug.md +175 -0
  37. package/skills/automation-flow-coordinate/references/recipes/testing/workflows/promote.md +255 -0
  38. package/skills/automation-flow-coordinate/references/recipes/testing/workflows/save-debug.md +212 -0
  39. package/skills/automation-flow-coordinate/references/resources/variable/variable.md +171 -0
  40. package/skills/automation-flow-coordinate/references/shared/anti-patterns.md +786 -0
  41. package/skills/automation-flow-coordinate/references/shared/end/end.md +267 -0
  42. package/skills/automation-flow-coordinate/references/shared/flow-type-resolver/eval/README.md +69 -0
  43. package/skills/automation-flow-coordinate/references/shared/flow-type-resolver/eval/predictions.jsonl +80 -0
  44. package/skills/automation-flow-coordinate/references/shared/flow-type-resolver/eval/prompts.jsonl +116 -0
  45. package/skills/automation-flow-coordinate/references/shared/flow-type-resolver/flow-type-resolver.md +321 -0
  46. package/skills/automation-flow-coordinate/references/shared/flow-type-resolver/taxonomy.json +320 -0
  47. package/skills/automation-flow-coordinate/references/shared/server-functions.md +597 -0
  48. package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +21 -11
  49. package/skills/automation-sandbox-post-copy-config-generate/assets/config_template.json +10 -0
  50. package/skills/automation-sandbox-post-copy-config-generate/assets/json_schema.json +33 -1
  51. package/skills/automation-sandbox-post-copy-config-generate/references/configuration_catalog.md +44 -1
  52. package/skills/automation-sandbox-post-copy-configure/SKILL.md +132 -124
  53. package/skills/automation-sandbox-post-copy-configure/references/flow_activation_path.md +151 -0
  54. package/skills/automation-sandbox-post-copy-configure/references/scheduled_apex_path.md +55 -9
  55. package/skills/automotive-cloud-appraisal-management-settings-configure/SKILL.md +69 -0
  56. package/skills/automotive-cloud-dealer-essentials-configure/SKILL.md +78 -0
  57. package/skills/automotive-cloud-ground-agent-data-pipelines-configure/SKILL.md +373 -0
  58. package/skills/automotive-cloud-ground-mfg-agent-data-pipelines-configure/SKILL.md +273 -0
  59. package/skills/automotive-cloud-mfg-agent-data-pipelines-configure/SKILL.md +259 -0
  60. package/skills/automotive-cloud-mfg-sales-concierge-agent-create/SKILL.md +369 -0
  61. package/skills/automotive-cloud-mfg-sales-concierge-foundation-configure/SKILL.md +542 -0
  62. package/skills/automotive-cloud-mfg-sales-concierge-foundation-coordinate/SKILL.md +159 -0
  63. package/skills/automotive-cloud-mfg-sales-concierge-orchestrator-agent-create/SKILL.md +349 -0
  64. package/skills/automotive-cloud-mfg-sales-concierge-orchestrator-configure/SKILL.md +505 -0
  65. package/skills/automotive-cloud-sales-concierge-agent-create/SKILL.md +380 -0
  66. package/skills/automotive-cloud-sales-concierge-foundation-configure/SKILL.md +567 -0
  67. package/skills/automotive-cloud-sales-concierge-foundation-coordinate/SKILL.md +159 -0
  68. package/skills/automotive-cloud-sales-concierge-orchestrator-agent-create/SKILL.md +360 -0
  69. package/skills/automotive-cloud-sales-concierge-orchestrator-configure/SKILL.md +539 -0
  70. package/skills/automotive-cloud-sales-concierge-search-grounding-configure/SKILL.md +358 -0
  71. package/skills/commerce-b2b-merchant-quote-configure/SKILL.md +602 -0
  72. package/skills/commerce-b2b-store-configure/SKILL.md +251 -0
  73. package/skills/commerce-credit-memo-create/SKILL.md +139 -0
  74. package/skills/commerce-delivery-business-hours-configure/SKILL.md +277 -0
  75. package/skills/commerce-delivery-estimation-apply/SKILL.md +155 -0
  76. package/skills/commerce-delivery-estimation-configure/SKILL.md +377 -0
  77. package/skills/commerce-delivery-routing-specs-integrate/SKILL.md +174 -0
  78. package/skills/commerce-estimate-bopis-query/SKILL.md +279 -0
  79. package/skills/commerce-estimate-delivery-date-query/SKILL.md +349 -0
  80. package/skills/commerce-fees-apply/SKILL.md +227 -0
  81. package/skills/commerce-fulfillment-routing-analyze/SKILL.md +200 -0
  82. package/skills/commerce-guest-buyer-create/SKILL.md +173 -0
  83. package/skills/commerce-location-bopis-configure/SKILL.md +378 -0
  84. package/skills/commerce-location-business-hours-configure/SKILL.md +235 -0
  85. package/skills/commerce-location-delivery-processing-time-configure/SKILL.md +309 -0
  86. package/skills/commerce-location-graph-integrate/SKILL.md +131 -0
  87. package/skills/commerce-location-shipping-carrier-method-configure/SKILL.md +755 -0
  88. package/skills/commerce-location-temporary-operating-hours-configure/SKILL.md +331 -0
  89. package/skills/commerce-merchant-buyer-groups-configure/SKILL.md +579 -0
  90. package/skills/commerce-merchant-buyer-user-onboarding-create/SKILL.md +626 -0
  91. package/skills/commerce-merchant-catalog-configure/SKILL.md +614 -0
  92. package/skills/commerce-merchant-extension-provider-configure/SKILL.md +368 -0
  93. package/skills/commerce-merchant-insights-account-health-churn-analyze/SKILL.md +118 -0
  94. package/skills/commerce-merchant-insights-inventory-returns-analyze/SKILL.md +65 -0
  95. package/skills/commerce-merchant-insights-order-shopper-get/SKILL.md +90 -0
  96. package/skills/commerce-merchant-insights-product-performance-analyze/SKILL.md +72 -0
  97. package/skills/commerce-merchant-insights-query/SKILL.md +279 -0
  98. package/skills/commerce-merchant-storefront-guest-access-configure/SKILL.md +656 -0
  99. package/skills/commerce-order-summary-change-apply/SKILL.md +375 -0
  100. package/skills/commerce-product-details-get/SKILL.md +363 -0
  101. package/skills/commerce-product-search/SKILL.md +563 -0
  102. package/skills/commerce-react-storefront-create/SKILL.md +350 -0
  103. package/skills/commerce-return-order-summary-create/SKILL.md +513 -0
  104. package/skills/commerce-search-relevance-analyze/SKILL.md +757 -0
  105. package/skills/commerce-temporary-processing-time-override-create/SKILL.md +274 -0
  106. package/skills/communications-initial-setup-configure/SKILL.md +630 -0
  107. package/skills/communications-multisite-configure/SKILL.md +571 -0
  108. package/skills/communications-revenue-cloud-settings-configure/SKILL.md +74 -0
  109. package/skills/communications-smb-fiber-catalog-create/SKILL.md +413 -0
  110. package/skills/communications-tmf-integrate/SKILL.md +1368 -0
  111. package/skills/consumer-goods-promotion-bo-api-deploy/SKILL.md +54 -107
  112. package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/payloads/copy.json +1 -1
  113. package/skills/consumer-goods-promotion-bo-api-deploy/references/conventions-and-payload-rules.md +82 -5
  114. package/skills/consumer-goods-promotion-bo-api-deploy/references/generate-and-wire.md +35 -2
  115. package/skills/consumer-goods-promotion-bo-api-deploy/references/preflight-and-seed-queries.md +149 -0
  116. package/skills/consumer-goods-promotion-bo-api-deploy/references/smoke-and-verify.md +17 -1
  117. package/skills/consumer-goods-visit-activity-act4-questions-assign/SKILL.md +448 -0
  118. package/skills/consumer-goods-visit-activity-act5-standard-create/SKILL.md +269 -0
  119. package/skills/consumer-goods-visit-activity-act6-assortment-configure/SKILL.md +271 -0
  120. package/skills/consumer-goods-visit-activity-act7-account-scoping-create/SKILL.md +382 -0
  121. package/skills/consumer-goods-visit-activity-act8-plan-attach-create/SKILL.md +373 -0
  122. package/skills/consumer-goods-visit-activity-act9-proof-validate/SKILL.md +389 -0
  123. package/skills/consumer-goods-visit-and-activity-act1-specification-create/SKILL.md +338 -0
  124. package/skills/consumer-goods-visit-and-activity-act2-template-create/SKILL.md +547 -0
  125. package/skills/consumer-goods-visit-and-activity-act3-definition-create/SKILL.md +346 -0
  126. package/skills/consumer-goods-visit-and-activity-configure/SKILL.md +1110 -0
  127. package/skills/crm-analytics-adoption-insights-configure/SKILL.md +224 -0
  128. package/skills/crm-analytics-custom-report-type-lightning-configure/SKILL.md +418 -0
  129. package/skills/crm-analytics-dashboards-configure/SKILL.md +731 -0
  130. package/skills/crm-analytics-operational-analytics-metadata-bridge-migrate/SKILL.md +233 -0
  131. package/skills/crm-analytics-report-notifications-ui-configure/SKILL.md +184 -0
  132. package/skills/crm-analytics-sharing-inheritance-coverage-analyze/SKILL.md +167 -0
  133. package/skills/crm-analytics-sonic-getting-started-configure/SKILL.md +55 -0
  134. package/skills/crm-analytics-tableau-next-app-deploy/SKILL.md +1350 -0
  135. package/skills/crm-analytics-tableau-next-c360-basemodel-validate/SKILL.md +1862 -0
  136. package/skills/crm-analytics-tableau-next-datacloud-validate/SKILL.md +83 -0
  137. package/skills/crm-analytics-tableau-next-provisioning-validate/SKILL.md +81 -0
  138. package/skills/data360-activation-create/SKILL.md +104 -0
  139. package/skills/data360-activation-external-platform-get/SKILL.md +49 -0
  140. package/skills/data360-activation-target-create/SKILL.md +93 -0
  141. package/skills/data360-activation-v2-create/SKILL.md +456 -0
  142. package/skills/data360-audience-dmo-get/SKILL.md +38 -0
  143. package/skills/data360-calculated-affinity-create/SKILL.md +82 -0
  144. package/skills/data360-calculated-insight-create/SKILL.md +148 -0
  145. package/skills/data360-catalog-metadata-create/SKILL.md +183 -0
  146. package/skills/data360-code-extension-create/SKILL.md +115 -0
  147. package/skills/data360-communication-capping-create/SKILL.md +227 -0
  148. package/skills/data360-connection-create/SKILL.md +491 -0
  149. package/skills/data360-content-lens-create/SKILL.md +181 -0
  150. package/skills/data360-data-action-create/SKILL.md +126 -0
  151. package/skills/data360-data-action-target-create/SKILL.md +181 -0
  152. package/skills/data360-data-clean-room-create/SKILL.md +238 -0
  153. package/skills/data360-data-governance-create/SKILL.md +746 -0
  154. package/skills/data360-data-graph-create/SKILL.md +82 -0
  155. package/skills/data360-data-harmonized-model-object-reference-create/SKILL.md +38 -0
  156. package/skills/data360-data-lake-object-create/SKILL.md +207 -0
  157. package/skills/data360-data-model-object-catalog-get/SKILL.md +49 -0
  158. package/skills/data360-data-model-object-create/SKILL.md +128 -0
  159. package/skills/data360-data-model-object-mapping-create/SKILL.md +106 -0
  160. package/skills/data360-data-space-create/SKILL.md +161 -0
  161. package/skills/data360-data-streams-create/SKILL.md +324 -0
  162. package/skills/data360-engagement-signal-get/SKILL.md +38 -0
  163. package/skills/data360-experiment-create/SKILL.md +82 -0
  164. package/skills/data360-goal-based-campaign-create/SKILL.md +192 -0
  165. package/skills/data360-harmonization-process-history-get/SKILL.md +38 -0
  166. package/skills/data360-harmonized-unstructured-dmo-create/SKILL.md +84 -0
  167. package/skills/data360-identity-resolution-create/SKILL.md +115 -0
  168. package/skills/data360-intelligent-document-processing-create/SKILL.md +148 -0
  169. package/skills/data360-knowledge-graph-construction-create/SKILL.md +93 -0
  170. package/skills/data360-knowledge-graph-create/SKILL.md +216 -0
  171. package/skills/data360-knowledge-space-mcp-configure/SKILL.md +475 -0
  172. package/skills/data360-machine-learning-mcp-configure/SKILL.md +697 -0
  173. package/skills/data360-multi-org-mcp-configure/SKILL.md +117 -0
  174. package/skills/data360-secondary-index-mcp-configure/SKILL.md +126 -0
  175. package/skills/data360-segment-mcp-configure/SKILL.md +159 -0
  176. package/skills/data360-semantic-calculated-dimension-mcp-configure/SKILL.md +93 -0
  177. package/skills/data360-semantic-calculated-measurement-mcp-configure/SKILL.md +93 -0
  178. package/skills/data360-semantic-data-object-mcp-configure/SKILL.md +93 -0
  179. package/skills/data360-semantic-dimension-mcp-configure/SKILL.md +38 -0
  180. package/skills/data360-semantic-engine-mcp-configure/SKILL.md +62 -0
  181. package/skills/data360-semantic-measurement-mcp-configure/SKILL.md +38 -0
  182. package/skills/data360-semantic-metric-mcp-configure/SKILL.md +93 -0
  183. package/skills/data360-semantic-model-mcp-configure/SKILL.md +115 -0
  184. package/skills/data360-standard-mapping-mcp-configure/SKILL.md +38 -0
  185. package/skills/data360-tenant-lifecycle-mcp-configure/SKILL.md +73 -0
  186. package/skills/dx-devops-conflict-resolve/SKILL.md +1 -5
  187. package/skills/dx-devops-pipeline-manage/SKILL.md +1 -5
  188. package/skills/dx-devops-project-manage/SKILL.md +1 -5
  189. package/skills/dx-devops-promote/SKILL.md +1 -5
  190. package/skills/dx-devops-request-status/SKILL.md +1 -5
  191. package/skills/dx-lifecycle-center/SKILL.md +120 -0
  192. package/skills/dx-lifecycle-center/examples/workflows.md +175 -0
  193. package/skills/dx-lifecycle-center/references/connect-api.md +123 -0
  194. package/skills/dx-lifecycle-center/references/connect-org.md +184 -0
  195. package/skills/dx-lifecycle-center/references/deploy.md +153 -0
  196. package/skills/dx-lifecycle-center/references/error-handling.md +21 -0
  197. package/skills/dx-lifecycle-center/references/hub-org.md +37 -0
  198. package/skills/dx-lifecycle-center/references/list-orgs.md +99 -0
  199. package/skills/dx-lifecycle-center/references/request-body.md +75 -0
  200. package/skills/dx-lifecycle-center/references/troubleshooting.md +31 -0
  201. package/skills/dx-lifecycle-center/scripts/poll-deploy-status.sh +200 -0
  202. package/skills/dx-lifecycle-center/scripts/resolve-environment.sh +120 -0
  203. package/skills/dx-org-devhub-configure/SKILL.md +1 -3
  204. package/skills/dx-org-shape-manage/SKILL.md +1 -5
  205. package/skills/dx-org-snapshot-manage/SKILL.md +1 -3
  206. package/skills/education-cloud-academic-calendar-generate/SKILL.md +1 -3
  207. package/skills/education-cloud-course-catalog-migrate/SKILL.md +1 -3
  208. package/skills/education-cloud-domain-configure/SKILL.md +1 -3
  209. package/skills/education-cloud-multi-campus-configure/SKILL.md +1 -3
  210. package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +1 -5
  211. package/skills/experience-afv-query/SKILL.md +234 -0
  212. package/skills/experience-agentforce-vibes-in-react-configure/SKILL.md +63 -0
  213. package/skills/experience-apex-components-configure/SKILL.md +69 -0
  214. package/skills/experience-apex-pages-configure/SKILL.md +107 -0
  215. package/skills/experience-app-home-configure/SKILL.md +76 -0
  216. package/skills/experience-aura-lightning-out-access-configure/SKILL.md +58 -0
  217. package/skills/experience-briefcase-configure/SKILL.md +287 -0
  218. package/skills/experience-community-flexi-page-list-create/SKILL.md +74 -0
  219. package/skills/experience-community-template-definition-list-query/SKILL.md +48 -0
  220. package/skills/experience-community-theme-definition-list-query/SKILL.md +38 -0
  221. package/skills/experience-content-assets-configure/SKILL.md +86 -0
  222. package/skills/experience-custom-domain-create/SKILL.md +727 -0
  223. package/skills/experience-defer-rendering-workspace-page-setup-configure/SKILL.md +41 -0
  224. package/skills/experience-field-service-app-builder-configure/SKILL.md +187 -0
  225. package/skills/experience-flow-category-configure/SKILL.md +117 -0
  226. package/skills/experience-formula-configure/SKILL.md +358 -0
  227. package/skills/experience-global-actions-configure/SKILL.md +69 -0
  228. package/skills/experience-global-publisher-layouts-configure/SKILL.md +79 -0
  229. package/skills/experience-instrumentation-configure/SKILL.md +64 -0
  230. package/skills/experience-lex-engagement-configure/SKILL.md +50 -0
  231. package/skills/experience-lightning-bolt-open/SKILL.md +12 -0
  232. package/skills/experience-lightning-out-configure/SKILL.md +129 -0
  233. package/skills/experience-lightning-preview-configure/SKILL.md +67 -0
  234. package/skills/experience-lightning-types-query/SKILL.md +98 -0
  235. package/skills/experience-malware-scan-configure/SKILL.md +71 -0
  236. package/skills/experience-my-salesforce-configure/SKILL.md +126 -0
  237. package/skills/experience-navigation-menus-configure/SKILL.md +235 -0
  238. package/skills/experience-notification-types-configure/SKILL.md +206 -0
  239. package/skills/experience-notifications-configure/SKILL.md +75 -0
  240. package/skills/experience-record-discovery-query/SKILL.md +227 -0
  241. package/skills/experience-regenerate-previews-open/SKILL.md +94 -0
  242. package/skills/experience-sales-cloud-mab-configure/SKILL.md +254 -0
  243. package/skills/experience-schema-builder-open/SKILL.md +38 -0
  244. package/skills/experience-simple-record-home-configure/SKILL.md +110 -0
  245. package/skills/experience-static-resources-configure/SKILL.md +74 -0
  246. package/skills/experience-ui-bundle-2gp-deploy/SKILL.md +1 -3
  247. package/skills/experience-ui-bundle-features-generate/SKILL.md +1 -5
  248. package/skills/experience-ui-bundle-mfa-configure/SKILL.md +1 -3
  249. package/skills/field-service-data-capture-form-deployer-configure/SKILL.md +23 -2
  250. package/skills/field-service-data-capture-form-designer-configure/SKILL.md +13 -3
  251. package/skills/field-service-data-capture-migrate/SKILL.md +1 -3
  252. package/skills/field-service-mobile-branding-configure/SKILL.md +17 -3
  253. package/skills/field-service-objective-designer-configure/SKILL.md +72 -379
  254. package/skills/field-service-prework-brief-deployer-configure/SKILL.md +10 -537
  255. package/skills/field-service-scheduling-policy-designer-query/SKILL.md +65 -1093
  256. package/skills/{field-service-setup-orchestrator-get → field-service-setup-coordinate}/SKILL.md +18 -3
  257. package/skills/field-service-sobject-create-configure/SKILL.md +13 -213
  258. package/skills/field-service-voice-to-form-configure/SKILL.md +40 -11
  259. package/skills/field-service-work-plan-configure/SKILL.md +253 -0
  260. package/skills/field-service-work-rule-designer-configure/SKILL.md +121 -95
  261. package/skills/fsc-actionable-segmentation-settings-configure/SKILL.md +180 -0
  262. package/skills/fsc-digital-origination-bre-decision-matrix-foundation-create/SKILL.md +196 -0
  263. package/skills/fsc-digital-origination-bre-disclosures-consent-configure/SKILL.md +106 -0
  264. package/skills/fsc-digital-origination-bre-document-upload-configure/SKILL.md +96 -0
  265. package/skills/fsc-digital-origination-bre-permissions-assign/SKILL.md +111 -0
  266. package/skills/fsc-digital-origination-bre-setup-coordinate/SKILL.md +250 -0
  267. package/skills/fsc-digital-origination-bre-stp-eligibility-configure/SKILL.md +122 -0
  268. package/skills/fsc-digital-origination-coordinate/SKILL.md +653 -0
  269. package/skills/fsc-digital-origination-demo-run/SKILL.md +225 -0
  270. package/skills/fsc-digital-origination-execution-guardrails-validate/SKILL.md +112 -0
  271. package/skills/fsc-digital-origination-initial-setup-configure/SKILL.md +396 -0
  272. package/skills/fsc-digital-origination-pricing-setup-coordinate/SKILL.md +336 -0
  273. package/skills/fsc-digital-origination-pricing-setup-data-foundation-create/SKILL.md +208 -0
  274. package/skills/fsc-digital-origination-pricing-setup-procedure-create/SKILL.md +375 -0
  275. package/skills/fsc-digital-origination-product-setup-act1-permissions-assign/SKILL.md +83 -0
  276. package/skills/fsc-digital-origination-product-setup-coordinate/SKILL.md +248 -0
  277. package/skills/fsc-digital-origination-sample-data-create/SKILL.md +206 -0
  278. package/skills/fsc-document-checklist-settings-configure/SKILL.md +57 -0
  279. package/skills/fsc-flexible-hierarchy-configure/SKILL.md +148 -0
  280. package/skills/fsc-flexible-hierarchy-foundation-configure/SKILL.md +1430 -0
  281. package/skills/fsc-flexible-hierarchy-graph-config-create/SKILL.md +471 -0
  282. package/skills/fsc-flexible-hierarchy-rule-based-graph-deploy/SKILL.md +429 -0
  283. package/skills/fsc-pricing-product-configurator-configure/SKILL.md +150 -0
  284. package/skills/fsc-pricing-salesforce-omnistudio-switch/SKILL.md +123 -0
  285. package/skills/fsc-product-act2-catalog-categories-create/SKILL.md +82 -0
  286. package/skills/fsc-product-act3-attributes-create/SKILL.md +249 -0
  287. package/skills/fsc-product-act4-classification-assignment-create/SKILL.md +196 -0
  288. package/skills/fsc-product-act5-considerations-get/SKILL.md +44 -0
  289. package/skills/fsc-stage-management-apex-flow-deploy/SKILL.md +384 -0
  290. package/skills/fsc-stage-management-compliant-data-sharing-configure/SKILL.md +144 -0
  291. package/skills/fsc-stage-management-decision-matrices-create/SKILL.md +107 -0
  292. package/skills/fsc-stage-management-definition-assignments-create/SKILL.md +189 -0
  293. package/skills/fsc-stage-management-definition-create/SKILL.md +108 -0
  294. package/skills/fsc-stage-management-permissions-assign/SKILL.md +143 -0
  295. package/skills/fsc-stage-management-transitions-configure/SKILL.md +139 -0
  296. package/skills/health-cloud-appt-booking-config-configure/SKILL.md +135 -0
  297. package/skills/health-cloud-appt-booking-url-config-configure/SKILL.md +134 -0
  298. package/skills/health-cloud-care-provider-affl-role-config-configure/SKILL.md +136 -0
  299. package/skills/health-cloud-care-provider-search-config-configure/SKILL.md +134 -0
  300. package/skills/health-cloud-care-requests-create/SKILL.md +178 -0
  301. package/skills/health-cloud-initial-configure/SKILL.md +511 -0
  302. package/skills/health-cloud-patient-appointment-scheduling-configure/SKILL.md +1374 -0
  303. package/skills/health-cloud-provider-search-settings-configure/SKILL.md +924 -0
  304. package/skills/health-cloud-referral-management-coordinate/SKILL.md +513 -0
  305. package/skills/health-cloud-timeline-configure/SKILL.md +622 -0
  306. package/skills/health-cloud-virtual-visit-config-configure/SKILL.md +135 -0
  307. package/skills/industries-account-score-settings-query/SKILL.md +78 -0
  308. package/skills/industries-actionable-list-data-sources-dmo-configure/SKILL.md +177 -0
  309. package/skills/industries-ad-product-availability-search/SKILL.md +399 -0
  310. package/skills/industries-advanced-account-forecast-settings-configure/SKILL.md +628 -0
  311. package/skills/industries-advanced-therapy-management-settings-configure/SKILL.md +73 -0
  312. package/skills/industries-atm-settings-starter-configure/SKILL.md +76 -0
  313. package/skills/industries-batch-document-ai-configure/SKILL.md +196 -0
  314. package/skills/industries-behavioral-health-app-settings-configure/SKILL.md +71 -0
  315. package/skills/industries-branch-management-settings-configure/SKILL.md +89 -0
  316. package/skills/industries-bre-decision-table-access-configure/SKILL.md +367 -0
  317. package/skills/industries-brokerage-settings-configure/SKILL.md +41 -0
  318. package/skills/industries-calendar-sync-settings-configure/SKILL.md +89 -0
  319. package/skills/industries-care-request-settings-configure/SKILL.md +218 -0
  320. package/skills/industries-case-management-intelligence-settings-configure/SKILL.md +54 -0
  321. package/skills/industries-catalog-process-attributes-products-configure/SKILL.md +380 -0
  322. package/skills/industries-catalog-process-fulfillment-configure/SKILL.md +216 -0
  323. package/skills/industries-catalog-process-intake-configure/SKILL.md +219 -0
  324. package/skills/industries-catalog-process-knowledge-configure/SKILL.md +153 -0
  325. package/skills/industries-catalog-process-preprocessor-configure/SKILL.md +168 -0
  326. package/skills/industries-cds-general-settings-configure/SKILL.md +69 -0
  327. package/skills/industries-claim-financial-settings-configure/SKILL.md +169 -0
  328. package/skills/industries-clinical-data-model-settings-configure/SKILL.md +136 -0
  329. package/skills/industries-clinical-data-model-settings-starter-configure/SKILL.md +105 -0
  330. package/skills/industries-collection-plan-settings-configure/SKILL.md +132 -0
  331. package/skills/industries-comms-service-console-settings-configure/SKILL.md +159 -0
  332. package/skills/industries-compliance-configure/SKILL.md +102 -0
  333. package/skills/industries-compliance-document-extraction-setup-configure/SKILL.md +76 -0
  334. package/skills/industries-contact-center-app-layout-configure/SKILL.md +88 -0
  335. package/skills/industries-contact-center-components-configure/SKILL.md +96 -0
  336. package/skills/industries-contact-center-path-knowledge-configure/SKILL.md +95 -0
  337. package/skills/industries-contact-center-user-access-assign/SKILL.md +96 -0
  338. package/skills/industries-course-waitlist-config-configure/SKILL.md +162 -0
  339. package/skills/industries-crisis-center-settings-configure/SKILL.md +84 -0
  340. package/skills/industries-custom-object-settings-configure/SKILL.md +94 -0
  341. package/skills/industries-data-cloud-integration-configure/SKILL.md +88 -0
  342. package/skills/industries-data-space-feature-mappings-configure/SKILL.md +245 -0
  343. package/skills/industries-decision-matrix-builder-configure/SKILL.md +78 -0
  344. package/skills/industries-decision-table-hbase-configure/SKILL.md +87 -0
  345. package/skills/industries-decision-table-version-configure/SKILL.md +74 -0
  346. package/skills/industries-decision-tables-builder-configure/SKILL.md +253 -0
  347. package/skills/industries-decision-tables-configure/SKILL.md +439 -0
  348. package/skills/industries-energy-utilities-configure/SKILL.md +251 -0
  349. package/skills/industries-eu-cloud-multisite-configure/SKILL.md +1008 -0
  350. package/skills/industries-eu-new-connections-configure/SKILL.md +30 -0
  351. package/skills/industries-explainability-msg-template-configure/SKILL.md +135 -0
  352. package/skills/industries-expression-set-message-token-configure/SKILL.md +135 -0
  353. package/skills/industries-field-service-settings-configure/SKILL.md +82 -0
  354. package/skills/industries-form-framework-settings-configure/SKILL.md +30 -0
  355. package/skills/industries-fsc-ai-settings-configure/SKILL.md +57 -0
  356. package/skills/industries-fsc-association-engine-settings-configure/SKILL.md +172 -0
  357. package/skills/industries-fsc-b2b-settings-configure/SKILL.md +61 -0
  358. package/skills/industries-fsc-insurance-settings-configure/SKILL.md +58 -0
  359. package/skills/industries-fsc-visa-fulfillment-setup-configure/SKILL.md +103 -0
  360. package/skills/industries-fsc-wealth-agent-settings-configure/SKILL.md +117 -0
  361. package/skills/industries-fsc-wealth-settings-configure/SKILL.md +99 -0
  362. package/skills/industries-fundraising-gift-entry-settings-configure/SKILL.md +120 -0
  363. package/skills/industries-fundraising-rfm-configure/SKILL.md +128 -0
  364. package/skills/industries-fundraising-settings-configure/SKILL.md +145 -0
  365. package/skills/industries-fundraising-source-code-gen-configure/SKILL.md +299 -0
  366. package/skills/industries-google-maps-api-key-settings-configure/SKILL.md +87 -0
  367. package/skills/industries-grantmaking-intelligence-settings-open/SKILL.md +58 -0
  368. package/skills/industries-hc-score-category-settings-configure/SKILL.md +167 -0
  369. package/skills/industries-health-engagement-settings-configure/SKILL.md +218 -0
  370. package/skills/industries-home-health-agentforce-setup-configure/SKILL.md +131 -0
  371. package/skills/industries-home-health-bundling-policy-create/SKILL.md +50 -0
  372. package/skills/industries-home-health-entity-labels-configure/SKILL.md +29 -0
  373. package/skills/industries-home-health-fsl-package-deploy/SKILL.md +71 -0
  374. package/skills/industries-home-health-fsl-settings-validate/SKILL.md +27 -0
  375. package/skills/industries-home-health-guided-setup-care-and-skill-get/SKILL.md +80 -0
  376. package/skills/industries-home-health-guided-setup-configure/SKILL.md +836 -0
  377. package/skills/industries-home-health-guided-setup-enable-org-fsl-get/SKILL.md +55 -0
  378. package/skills/industries-home-health-guided-setup-get-org-ready-get/SKILL.md +61 -0
  379. package/skills/industries-home-health-licenses-assign/SKILL.md +27 -0
  380. package/skills/industries-home-health-operating-hours-create/SKILL.md +40 -0
  381. package/skills/industries-home-health-scheduling-policy-create/SKILL.md +41 -0
  382. package/skills/industries-home-health-service-objective-create/SKILL.md +22 -0
  383. package/skills/industries-home-health-skills-create/SKILL.md +31 -0
  384. package/skills/industries-home-health-users-create/SKILL.md +29 -0
  385. package/skills/industries-icm-act3-toggles-configure/SKILL.md +198 -0
  386. package/skills/industries-icm-act5-genai-suggested-assessments-configure/SKILL.md +361 -0
  387. package/skills/industries-icm-act6-mcg-integration-configure/SKILL.md +550 -0
  388. package/skills/industries-integrated-care-management-configure/SKILL.md +168 -0
  389. package/skills/industries-object-enablement-configure/SKILL.md +86 -0
  390. package/skills/industries-tpm-system-processing-service-configure/SKILL.md +64 -0
  391. package/skills/insurance-brokerage-agency-billing-configure/SKILL.md +1 -3
  392. package/skills/integration-apex-settings-configure/SKILL.md +61 -0
  393. package/skills/marketing-e360-email-archiving-configure/SKILL.md +73 -0
  394. package/skills/marketing-message-test/SKILL.md +1 -3
  395. package/skills/nonprofit-fundraising-configure/SKILL.md +240 -0
  396. package/skills/nonprofit-fundraising-configure/references/gotchas.md +26 -0
  397. package/skills/nonprofit-fundraising-configure/references/mcp-invocation.md +678 -0
  398. package/skills/nonprofit-fundraising-configure/references/permission-targeting.md +35 -0
  399. package/skills/nonprofit-volunteer-management-model-get/SKILL.md +166 -0
  400. package/skills/nonprofit-volunteer-management-model-get/references/entities.md +315 -0
  401. package/skills/nonprofit-volunteer-management-model-get/references/relationships.md +175 -0
  402. package/skills/nonprofit-volunteer-management-model-get/references/themes.md +143 -0
  403. package/skills/nonprofit-volunteer-management-records-create/SKILL.md +121 -0
  404. package/skills/nonprofit-volunteer-management-records-create/references/field-guide.md +284 -0
  405. package/skills/nonprofit-volunteer-management-records-create/references/mcp-invocation.md +248 -0
  406. package/skills/nonprofit-volunteer-management-records-create/references/review-format.md +140 -0
  407. package/skills/nonprofit-volunteer-management-records-create/scripts/expand-series.py +632 -0
  408. package/skills/nonprofit-volunteer-management-records-create/scripts/render-review-table.py +419 -0
  409. package/skills/nonprofit-volunteer-management-records-create/scripts/tests/test_expand_series.py +690 -0
  410. package/skills/nonprofit-volunteer-management-records-create/scripts/tests/test_render_review_table.py +421 -0
  411. package/skills/nonprofit-volunteer-management-structure-generate/SKILL.md +119 -0
  412. package/skills/nonprofit-volunteer-management-structure-generate/references/configuration-decisions.md +159 -0
  413. package/skills/nonprofit-volunteer-management-structure-generate/references/discovery-interview.md +137 -0
  414. package/skills/nonprofit-volunteer-management-structure-generate/references/edge-cases.md +48 -0
  415. package/skills/nonprofit-volunteer-management-structure-generate/references/mcp-invocation.md +75 -0
  416. package/skills/nonprofit-volunteer-management-structure-generate/references/plan-output.md +141 -0
  417. package/skills/platform-custom-field-generate/SKILL.md +1 -0
  418. package/skills/platform-custom-field-generate/references/advanced-picklists.md +5 -5
  419. package/skills/platform-custom-metadata-type-generate/SKILL.md +3 -0
  420. package/skills/platform-custom-object-generate/SKILL.md +4 -0
  421. package/skills/platform-custom-permissions-configure/SKILL.md +687 -0
  422. package/skills/platform-custom-setting-generate/SKILL.md +3 -0
  423. package/skills/platform-datamask-run/SKILL.md +1 -5
  424. package/skills/platform-label-workbench-import-create/SKILL.md +67 -0
  425. package/skills/platform-permission-set-generate/SKILL.md +3 -0
  426. package/skills/platform-privacy-agent-settings-configure/SKILL.md +752 -0
  427. package/skills/platform-salesforce-connect-adapter-generate/SKILL.md +1 -3
  428. package/skills/platform-sandbox-configure/SKILL.md +1 -3
  429. package/skills/platform-value-set-generate/SKILL.md +3 -0
  430. package/skills/sales-call-scoring-configure/SKILL.md +1 -5
  431. package/skills/service-agentforce-channel-configure/SKILL.md +1 -3
  432. package/skills/service-agentforce-human-escalation-configure/SKILL.md +1 -3
  433. package/skills/service-catalog-template-coordinate/SKILL.md +1 -3
  434. package/skills/service-concierge-portal-generate/SKILL.md +1 -3
  435. package/skills/service-email-to-case-configure/SKILL.md +1 -5
  436. package/skills/service-itsm-agentic-setup-agent-runtime-access-assign/SKILL.md +1 -3
  437. package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +1 -3
  438. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/SKILL.md +1 -3
  439. package/skills/service-itsm-agentic-setup-agentforce-studio-validate/SKILL.md +1 -3
  440. package/skills/service-itsm-agentic-setup-cmdb-access-assign/SKILL.md +1 -3
  441. package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/SKILL.md +1 -5
  442. package/skills/service-itsm-agentic-setup-cmdb-configure/SKILL.md +1 -3
  443. package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +1 -3
  444. package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/SKILL.md +1 -3
  445. package/skills/service-itsm-agentic-setup-employee-agent-configure/SKILL.md +1 -3
  446. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/SKILL.md +1 -3
  447. package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +1 -0
  448. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/SKILL.md +1 -3
  449. package/skills/service-itsm-agentic-setup-uel-user-create/SKILL.md +1 -9
  450. package/skills/service-itsm-incident-mgmt-configure/SKILL.md +1 -5
  451. package/skills/service-itsm-incident-priority-configure/SKILL.md +1 -3
  452. package/skills/service-itsm-slack-itservice-configure/SKILL.md +1 -3
  453. package/skills/service-itsm-swarming-configure/SKILL.md +1 -3
  454. package/skills/service-itsm-teams-configure/SKILL.md +1 -3
  455. package/skills/service-itsm-teams-debug/SKILL.md +1 -3
  456. package/skills/service-itsm-teams-employee-agent-configure/SKILL.md +1 -3
  457. package/skills/service-itsm-teams-itdesk-configure/SKILL.md +1 -3
  458. package/skills/service-itsm-teams-itservice-configure/SKILL.md +1 -3
  459. package/skills/service-native-voice-recording-transcription-configure/SKILL.md +1 -3
  460. package/skills/service-omni-agent-users-create/SKILL.md +1 -3
  461. package/skills/service-omni-agent-work-sharing-configure/SKILL.md +1 -3
  462. package/skills/service-omni-attribute-routing-configure/SKILL.md +1 -3
  463. package/skills/service-omni-base-settings-configure/SKILL.md +1 -3
  464. package/skills/service-omni-channel-inventory-analyze/SKILL.md +1 -3
  465. package/skills/service-omni-channel-limits-analyze/SKILL.md +1 -3
  466. package/skills/service-omni-channel-setup-coordinate/SKILL.md +1 -3
  467. package/skills/service-omni-command-center-analyze/SKILL.md +1 -3
  468. package/skills/service-omni-command-center-configure/SKILL.md +1 -3
  469. package/skills/service-omni-permission-set-assign/SKILL.md +1 -3
  470. package/skills/service-omni-presence-status-deploy/SKILL.md +1 -3
  471. package/skills/service-omni-presence-user-config-deploy/SKILL.md +1 -3
  472. package/skills/service-omni-queue-deploy/SKILL.md +1 -3
  473. package/skills/service-omni-queue-members-assign/SKILL.md +1 -3
  474. package/skills/service-omni-queue-routing-config-deploy/SKILL.md +1 -3
  475. package/skills/service-omni-routing-flow-deploy/SKILL.md +1 -3
  476. package/skills/service-omni-service-channel-configure/SKILL.md +1 -3
  477. package/skills/service-omni-sidebar-configure/SKILL.md +1 -3
  478. package/skills/service-omni-skills-based-routing-configure/SKILL.md +1 -3
  479. package/skills/service-omni-supervisor-config-deploy/SKILL.md +1 -3
  480. package/skills/service-omni-supervisor-permset-assign/SKILL.md +1 -3
  481. package/skills/service-omni-supervisor-surface-deploy/SKILL.md +1 -3
  482. package/skills/service-omni-supervisor-users-create/SKILL.md +1 -3
  483. package/skills/service-omni-work-skill-routing-configure/SKILL.md +1 -3
  484. package/skills/tableau-next-asset-create/README.md +0 -65
@@ -0,0 +1,513 @@
1
+ ---
2
+ name: health-cloud-referral-management-coordinate
3
+ description: "Guided end-to-end setup of Health Cloud Referral Management. Ties the individual Setup pages, features, and integrations an admin would otherwise navigate by hand into one ordered, resumable, seven-act workflow: Act 0 foundation & preconditions (Health Cloud license, Person Accounts prereq, OmniStudio runtime, Clinical Service Request discovery), Act 1 turn on Referral Management (the ClinicalServiceRequest core — configure the CSR record page, configure the referral path, and set up Actionable Segmentation follow-up lists), Act 2 internal referral creation & routing (Create Referral flow, Include Referral Action in Provider Search via Criteria-Based Search & Filter, Case record type + Create-Case-from-CSR flow, Patient Referral expression set + decision table, Action Plans, CSR status/status-reason picklists, flow orchestration), Act 3 eligibility / prior auth / predictive scoring (EBV & PA Apex, MuleSoft FHIR named credential, Data Cloud scoring data kit), Act 4 outreach + appointment sync, Act 5 external document intake (Document AI for Health), and Act 6 the public referral portal (Experience Cloud guest site, reCAPTCHA verification, Web-to-Case, Create Referral OmniScript, analytics, and the guest referral record owner). Triggers on \"set up Referral Management\", \"configure Referral Management\", \"enable Referral Management\", \"set up patient referrals\", \"configure clinical referrals\", \"set up referral intake\", \"enable the referral portal\", \"set up the guest referral form\", \"configure referral management and the public intake site\". Encodes the hard ordering the UI does not surface (the backing feature must be ON before its component binds) and is explicit about which steps are live-dispatchable via the project-codey MCP versus which are GAPS (MDAPI-zip-only components, external systems, StandardValueSet-backed standard-field picklists). State-aware and resumable: re-read current org state before acting on any step."
4
+ metadata:
5
+ version: "1.0"
6
+ cliTools:
7
+ - tool:
8
+ - "sf"
9
+ semver: ">=2.0.0"
10
+ ---
11
+
12
+ **Setting up Referral Management means running all seven acts in order — Act 0 (foundation), Act 1 (turn on Referral Management), Act 2 (internal referral creation & routing), Act 3 (eligibility / prior auth / scoring), Act 4 (outreach + appointment sync), Act 5 (external document intake), and Act 6 (public referral portal).**
13
+
14
+ Guide an admin through standing up **Health Cloud Referral Management** in the **strict order** the underlying preferences and platform features require, with a validate-only stance on anything genuinely external to Salesforce (Health Cloud license, Person Accounts, MuleSoft, Marketing Cloud, Google reCAPTCHA, Data Cloud kits).
15
+
16
+ This skill drives the **project-codey MCP** (`discover` → `describe` → `dispatch`) against the target org. Most steps are live-dispatchable: the Referral Management org-preference toggles, Criteria-Based Search & Filter, the guest-referral record owner, appointment sync, reCAPTCHA verification, the Case record type (Tooling `RecordType`), the Business Rules Engine routes (expression set + decision table), and the flow/Apex/OmniScript/Experience-site surfaces. The rest are GAPS — external systems, user-level entitlements the running identity lacks, multipart-only transports `dispatch` can't send, **or Metadata-API types the Core MetadataCrud allowlist rejects (`PathAssistant`, `BusinessProcess`, `NamedCredential` — live-verified `UNSUPPORTED_OPERATION`), which are deployed via the Salesforce-CLI MDAPI fallback (rule 3/3a/5)**. **Surface every gap with its remediation; never fake a call for one.** Gate every write on an independent read-back, never the write's own echo.
17
+
18
+ ## Scope & definition of done — READ THIS FIRST
19
+
20
+ **An unqualified "set up / configure / enable Referral Management" means run ALL SEVEN ACTS in order (Act 0 → … → Act 6).** The setup is complete only when every non-gapped step has reached its verified end state (gate on the `verify-*` read-back, never the write echo) and every gapped step has been surfaced with its manual remediation. A run that ends partway through is a *partial* run — say so plainly if you must stop early.
21
+
22
+ **Deferred / gapped steps are NOT stop signals. Never fabricate a call for a gapped step — but before declaring a gap, try a second transport (Tooling sObject / metadata xmlRep / Connect).**
23
+
24
+ ### Manual-step documentation contract — ALWAYS cite the Help link
25
+
26
+ When you finish (or stop) and enumerate the **manual / out-of-band steps the admin must complete by hand** (MDAPI-zip component binds, `StandardValueSet` multipart deploys, Flow-Builder "Save As New Flow" clones, Setup-UI-only designers, external systems, or entitlement/license gaps), you **MUST include the Salesforce Help link for each one**. Never present a bare "you'll need to do X manually" without the doc that tells the admin *how*. The links live in two places, both authoritative — use whichever you have in hand:
27
+
28
+ 1. The **`manual_step_references`** map in this skill's structured data (a step-id → `{label, why_manual, help_urls}` table, where `help_urls` is a **list** — a step may need more than one doc, so cite **every** URL in it) — the canonical, queryable source.
29
+ 2. The per-capability tables in Acts 0–6 below, where each step's Help article is linked inline.
30
+
31
+ The manual steps and their Help articles (keep this in sync with the `manual_step_references` overlay):
32
+
33
+ | Manual step (id) | Why it's manual | Help article |
34
+ |---|---|---|
35
+ | `assign-clinical-service-request-page-layout` | CSR Lightning-page industries-component binds: try a whole-page read-modify-write `/headless/metadata` PUT first (a live check bound patientCard/timeline this way; earlier "silently dropped" reports were partial-page PUTs), fall back to an MDAPI zip deploy only if a read-back shows the bind didn't persist | [hc_admin_referral_management_clinical_service_request_layout](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_clinical_service_request_layout.htm&type=5) |
36
+ | `configure-referral-actionable-lists` | DPE / actionable-list **definition** is authored in the Actionable Segmentation designer (Setup-UI) | [actionable_segmentation_setup_lists](https://help.salesforce.com/s/articleView?id=ind.actionable_segmentation_setup_lists.htm&type=5) |
37
+ | `create-referral-screen-flow` | "Save As New Flow" clone of the packaged flow is Flow-Builder-UI-only (managed flow opaque to the API) | [hc_admin_referral_management_flow](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_flow.htm&type=5) |
38
+ | `include-referral-action-in-provider-search` | Search-criteria / searchable-object / search-action authoring is in the CBS&F designer (Setup-UI) | [hc_admin_provider_search_criteria_based](https://help.salesforce.com/s/articleView?id=ind.hc_admin_provider_search_criteria_based.htm&type=5) |
39
+ | `create-case-from-csr-flow` | "Save As New Flow" clone is Flow-Builder-UI-only | [hc_admin_referral_management_case_creation_flow](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_case_creation_flow.htm&type=5) |
40
+ | `add-csr-status-picklist-values` | CSR `Status` = `StandardValueSet` **multipart** MDAPI deploy (rule 3c); `dispatch` can't send it — drive via a Metadata API deploy (Salesforce CLI; concrete command in the execution-policy notes) or the Setup UI | *(no dedicated article — StandardValueSet transport, skill Transport rule 3c; feeds the BRE decision table, [hc_admin_referral_management_configure_use_bre_flow](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_configure_use_bre_flow.htm&type=5))* |
41
+ | `add-csr-status-reason-picklist-values` | CSR `StatusReason` = `StandardValueSet` multipart MDAPI deploy (rule 3c), same mechanics as above | *(no dedicated article — StandardValueSet transport, skill Transport rule 3c)* |
42
+ | `activate-referral-flow-orchestration` | In-place activation of the packaged orchestrator is Flow-Builder-UI-only | [hc_admin_referral_management_configure_csr_flow_orchestration](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_configure_csr_flow_orchestration.htm&type=5) |
43
+ | `install-datacloud-referral-scoring-data-kit` | External Data Cloud data kit — no cold-install route | [hc_admin_referral_management_predictive_scoring_setup](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_predictive_scoring_setup.htm&type=5) |
44
+ | `place-outbound-engagement-home-component` | Industries component binds via an MDAPI **FlexiPage** deploy (Salesforce CLI), not `dispatch`/`/headless/metadata` PUT | [hc_admin_referral_management_configure_patient_provider_outreach_template](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_configure_patient_provider_outreach_template.htm&type=5) |
45
+ | `prepare-external-referral-fax-intake` | Document AI for Health guided setup + IDP extraction-definition authoring (Setup-UI) + Agentforce for Health Cloud add-on license | [hc_admin_referral_management_process_received_document](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_process_received_document.htm&type=5) · [hc_admin_disease_surveillance_set_up_pdf_ingestion_idp](https://help.salesforce.com/s/articleView?id=ind.hc_admin_disease_surveillance_set_up_pdf_ingestion_idp.htm&type=5) |
46
+ | `provision-referral-experience-cloud-site` (site finish) | Public Access, guest profile, Security & Privacy, Activate are Experience-Builder-UI-only | [hc_admin_referral_management_guest_users_site_build](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_site_build.htm&type=5) |
47
+ | `register-recaptcha-site-key` | External Google reCAPTCHA console (v2 checkbox) sign-up | [hc_admin_referral_management_guest_users_recaptcha](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_recaptcha.htm&type=5) |
48
+ | `generate-web-to-case-html` | Setup-UI Web-to-Case HTML Generator (registers the reCAPTCHA key-pair nickname) | [hc_admin_referral_management_guest_users_recaptcha](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_recaptcha.htm&type=5) |
49
+ | `activate-create-referral-omniscript` | OmniStudio OmniScript editor "New Version" (Setup-UI) | [hc_admin_referral_management_guest_users_omniscript_configure](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_omniscript_configure.htm&type=5) |
50
+ | Act 6 Phase A — get org ready | Perms + Digital Experiences + org Trusted URL setup (Setup-UI) | [hc_admin_referral_management_guest_users_org_ready](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_org_ready.htm&type=5) |
51
+ | Act 6 Phase E — customize the site | Guest access + head markup + OmniScript placement (Experience-Builder-UI) | [hc_admin_referral_management_guest_users_site](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_site.htm&type=5) · [_config](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_config.htm&type=5) · [recaptcha_markup](https://help.salesforce.com/s/articleView?id=ind.hc_admin_recaptcha_markup.htm&type=5) · [_site_omniscript](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_site_omniscript.htm&type=5) |
52
+ | `review-guest-referral-security-exposure` | **PHI safety gate** — guest object access + sharing-rule scope is reviewed by hand in Experience Builder / Setup (Sharing Settings) **before** Publish; no served API enumerates the guest-visible surface | [hc_admin_referral_management_guest_users_site](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_site.htm&type=5) · [_config](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_config.htm&type=5) |
53
+ | `verify-guest-site-published-and-scoped` | Post-publish validation — confirming the live public site renders only the referral form (and enforces reCAPTCHA) requires an unauthenticated guest load; no served API performs a guest load | [hc_admin_referral_management_guest_users_site_build](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_site_build.htm&type=5) · [_org_ready](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_org_ready.htm&type=5) |
54
+
55
+ ## Mandatory pre-write plan — state this before your FIRST write
56
+
57
+ Before you execute a single write operation (any toggle, any deploy), post a short plan to the admin that makes your scope decision **explicit and reviewable**:
58
+
59
+ 1. **The full journey is seven acts** — list them: Act 0 (foundation), Act 1 (turn on Referral Management), Act 2 (creation & routing), Act 3 (eligibility/PA/scoring), Act 4 (outreach + appointment sync), Act 5 (external intake), Act 6 (public portal).
60
+ 2. **Which steps are live-dispatchable vs GAP.** Most steps are live-dispatchable via `dispatch` across four transport families (Aura toggles, Tooling sObjects, the metadata xmlRep master transport, and Connect APIs — see Prerequisites §B). Name the toggles + creates you will perform, and the gaps you will only surface: external systems (Data Cloud kit, Marketing Cloud, Google reCAPTCHA), manual-UI (Web-to-Case HTML), and entitlement/feature/context blocks (Document AI for Health license; runtime feature; guest-only context; unprovisioned analytics template). The CSR `Status`/`StatusReason` picklist adds (steps 18/19) are achievable but out-of-band — a `StandardValueSet` MDAPI deploy (multipart, so not via `dispatch`), driven via the Salesforce CLI or the Setup UI. Call out that `enable-person-accounts` is IRREVERSIBLE and fired only on explicit authorization.
61
+ 3. **Person Accounts is a MANDATORY prerequisite** (HC platform docs + the RM PRD; see Prerequisites §A.2). State your stance: read PA state first; if ON, proceed; if OFF, the setup is BLOCKED until it is enabled — delegate to initial-setup, or drive the IRREVERSIBLE `enable-person-accounts` chain (Transport rule 7) only on explicit authorization. Never report the setup complete with PA off.
62
+ 4. **Where you will start.** For an unqualified request this is Act 0, step 1 — never mid-flow.
63
+
64
+ ## Supported utterances
65
+
66
+ - "Set up Referral Management" / "Configure Referral Management" / "Enable Referral Management"
67
+ - "Set up patient referrals" / "Configure clinical referrals" / "Set up referral intake"
68
+ - "Enable the referral portal" / "Set up the guest referral form" / "Configure the public referral intake site"
69
+ - "Turn on the Referral Management app" (narrow → Act 1, but confirm the Act 0 prereqs first)
70
+ - "Set the guest referral record owner" (narrow → Act 6 owner step)
71
+
72
+ ## Session state (track across the conversation)
73
+
74
+ - `target_org_alias` — the org being configured; confirmed explicitly before any write (never silently inherited). All org interaction is through the project-codey MCP against the connected org.
75
+ - `person_accounts_confirmed` — bool; Person Accounts is confirmed ON (`Account.IsPersonAccount` exists / a PersonAccount record type is present). **Person Accounts is a MANDATORY RM prerequisite** (HC platform docs + the RM PRD). This gate must be `true` before any Act 1–6 write; if PA is OFF, the setup is BLOCKED until it is enabled (here, on explicit authorization of the irreversible enable, or via [[health-cloud-initial-setup]]).
76
+ - `act0_complete` … `act6_complete` — bool per act; acts run strictly 0→1→…→6. For an unqualified request, all seven must reach `true` (or be explicitly reported as gate-blocked/gapped) before you report the setup complete.
77
+ - `gaps_surfaced` — the running list of gapped steps you have reported to the admin. **Each entry is a triple `{step, remediation, help_urls}` — the Salesforce Help link(s) are a REQUIRED field of every entry, not an optional extra. `help_urls` is a list: most steps have one doc, but some (e.g. `prepare-external-referral-fax-intake`, `act6-phase-e-customize-site`) have several — carry ALL of them.** Look the `help_urls` up by step id in the Manual-step documentation contract table above (mirrored in the `manual_step_references` map). The final summary enumerates this list, so a missing (or dropped) link here becomes a missing link in the summary — never append a gap without its full link set.
78
+
79
+ ## Entry point — route on the admin's actual ask
80
+
81
+ **Default rule:** unless the admin's ask *explicitly narrows the scope*, treat it as the full setup and **run Acts 0→6 in order.** When in doubt, run the full journey.
82
+
83
+ | Signal | Where to start |
84
+ |---|---|
85
+ | **"Set up Referral Management" / "configure referral management" / "enable patient referrals" / no narrowing qualifier / no prior state known** | **Run the FULL journey: `verify-health-cloud-license` (Act 0 step 1), then Acts 0→1→…→6 in order. Not done until every non-gapped step is verified and every gap is surfaced.** |
86
+ | "Just turn on the Referral Management app" | Narrow → Act 1, but first run the Act 0 prereq reads (license, Person Accounts, current settings). |
87
+ | "Set up the public / guest referral form" | Narrow → Act 6 — the portal steps depend on the Act 1 CSR core being configured. |
88
+ | "Set the guest referral record owner" | Narrow → Act 6 owner steps (`read-guest-referral-record-owner-candidates` → `set-guest-referral-record-owner`). |
89
+ | Person Accounts is OFF | **BLOCKER** (see Prerequisites §A.2 / Transport rule 7). Enable via the IRREVERSIBLE `enable-person-accounts` chain only on explicit authorization, else redirect to [[health-cloud-initial-setup]]. Do not proceed through Acts 1–6 or report "done" while PA is off. |
90
+
91
+ ## Decision points (confirm before Act 1 writes; drive optional steps)
92
+
93
+ This workflow's optional surfaces are driven by the admin's answer to two questions. Confirm them up front; they gate which later steps run vs are skipped.
94
+
95
+ ### 1. Portal scope — default `internal-only`
96
+
97
+ > Do you need the **public guest referral portal** (Experience Cloud site + reCAPTCHA + Web-to-Case + guest OmniScript), or **internal referral creation only**?
98
+
99
+ - **`internal-only` (default):** Run Acts 0–5 plus the internal parts of Act 6 you can reach. **Skips** the Experience Cloud site provisioning, reCAPTCHA key registration, and Web-to-Case generation gaps.
100
+ - **`with-public-portal`:** Run all of Act 6. The guest-site provisioning, reCAPTCHA site-key registration, and Web-to-Case HTML are GAPS (external/manual) — surfaced, not automated. The `enable-captcha-verification` toggle and the `set-guest-referral-record-owner` write ARE live-dispatchable.
101
+
102
+ ### 2. Advanced modules — default `defer-external`
103
+
104
+ > Do you need the advanced modules — eligibility/prior-auth (EBV, MuleSoft FHIR), predictive scoring (Data Cloud), Marketing Cloud outreach, document/fax intake — configured now?
105
+
106
+ - **`defer-external` (default):** Surface Acts 3–5 as GAPS with their external-dependency remediation and move on. Acts 3–4 are not live-dispatchable via the MCP; in Act 5, the Disease Surveillance and Batch Document AI org-preference toggles ARE live-dispatchable — the gaps there are the Agentforce for Health Cloud add-on license, the IDP guided-setup authoring, and the flow/queue wiring (see Act 5).
107
+ - **`configure-now`:** Same behaviour — Acts 3–4 remain GAPS regardless (external systems / MDAPI-zip Apex), and Act 5 still gaps on license + IDP authoring + flows — but you will fire Act 5's live preference toggles and walk the admin through each remaining remediation in detail rather than a one-line summary.
108
+
109
+ ## Prerequisites
110
+
111
+ ### A. True prerequisites — validate before anything else (Act 0)
112
+
113
+ Act 0 has exactly **two** prerequisites. Validate both up front, surface each as a discrete checked line (✅/❌ + the value you queried), and if **either is unmet, STOP** — fire no Act 1–6 write and redirect. Don't try to fix a foundational gap from inside this skill.
114
+
115
+ 1. **Health Cloud Initial Setup is complete.** Do NOT re-implement the foundational Health Cloud checks in this skill — **delegate to the [[health-cloud-initial-setup]] SOR and run only its READ / verify steps (never any WRITE)** to confirm Health Cloud basic setup is done. That verification is the real gate; it subsumes: the Health Cloud license (the RM-side confirmation is `verify-health-cloud-license`), the **Health Cloud Platform Permission Set License** on the running admin, and the OmniStudio metadata runtime. **If Health Cloud is not set up, STOP the referral management setup and direct the user to complete Health Cloud initial setup first.**
116
+ - A Life Sciences Cloud license does NOT satisfy this — the gate keys on the Health Cloud license entitlement, not the license's marketing name. Name the prerequisite permission-set license exactly **"Health Cloud Platform Permission Set License"** in admin-facing output (not "Health Cloud Foundation").
117
+ - *OmniStudio:* the prerequisite is a **two-setting toggle** on the OmniStudio Settings page — **disable "Managed Package Runtime" AND enable "OmniStudio Metadata"** — so components run as native metadata. It is not on by default. Only the Create Referral OmniScript (Act 6) hard-depends on it; Act 0's `check-omnistudio-runtime` read seeds that (it reads only `standardOmniStudioRuntime`, the metadata-enabled half, and does NOT confirm Managed Package Runtime is off).
118
+ - *Admin access* (Modify All Data, or Customize Application + View/Modify Setup) for the running identity is required — the dispatcher `/headless/invoke/...` routes require it.
119
+ 2. **Person Accounts is enabled and configured correctly.** Referral Management resolves its Clinical Service Request patient as a PersonAccount, so PA must be ON and set up. **This may already have been covered by the Health Cloud Initial Setup checks in (1)** — if the delegated reads already confirmed PA, don't re-check. If PA is OFF, it is an IRREVERSIBLE platform feature owned by [[health-cloud-initial-setup]]: either redirect there, or — **only on explicit authorization of the irreversible enablement** — drive the readiness-gated `enable-person-accounts` chain (Transport rule 7). **Never proceed with PA off.**
120
+
121
+ ### B. Automatable by this skill (via the project-codey MCP)
122
+
123
+ Most steps are live-dispatchable via `dispatch` across four transport families:
124
+
125
+ - **Aura toggles + reads** (`/headless/invoke/...`): `enable-criteria-based-search-and-filter`, `enable-appointment-sync`, `enable-captcha-verification`, `read-guest-referral-record-owner-candidates` → `set-guest-referral-record-owner`, plus the Act-0 reads and `enable-person-accounts` (irreversible; readiness-gated — Transport rule 7).
126
+ - **Tooling sObjects**: `assign-clinical-service-request-page-layout` (`Layout`), `create-case-record-type` (`RecordType`, needs a Case BusinessProcess deployed first), the three Flows + orchestration activation (`Flow`/`FlowDefinition`), `create-ebv-prior-auth-apex-classes` (`ApexClass`).
127
+ - **Metadata xmlRep master transport** (`/services/data/v67.0/headless/metadata`, Transport rule 3): `activate-create-referral-omniscript` (`OmniProcess`) and Settings singletons. **NOT** `configure-referral-management-path` (`PathAssistant`), `create-case-business-process` (`BusinessProcess`), or `create-mulesoft-fhir-named-credential` (`NamedCredential`) — the Core MetadataCrud allowlist rejects those three (`UNSUPPORTED_OPERATION`, live-verified), so they go via the **Salesforce-CLI MDAPI deploy** fallback (rule 3/3a/5).
128
+ - **Connect APIs**: `configure-patient-referral-expression-set` + `load-patient-referral-decision-table` (Business Rules Engine, rule 4a), `provision-referral-experience-cloud-site` + `provision-ebv-callback-experience-site` (`POST /connect/communities`, rule 4), `assign-action-plans-permission-set` (Data-API `PermissionSetAssignment`), and the `create-referral-runtime` / `create-guest-referral-runtime` smoke tests.
129
+
130
+ The genuine GAPS are NOT transport problems: external systems (Data Cloud kit, Marketing Cloud, Google reCAPTCHA), manual-UI-only (Web-to-Case HTML), and entitlement/feature/context blocks (Document AI for Health license; Referral Management runtime feature for the running user; guest-only execution context; HLS Modernization analytics template not provisioned). **Separately, the CSR `Status`/`StatusReason` picklist adds (steps 18/19) are achievable but out-of-band** — the `StandardValueSet` MDAPI deploy that adds them (rule 3c) is `multipart/form-data`, which `dispatch` can't send, so a pure-MCP agent must fall back to the Salesforce CLI or the Setup UI (dispatch-first, CLI-fallback — Transport rule 0). See each Act's notes.
131
+
132
+ ## Transport & deploy discipline (applies to EVERY Act — read before your first write)
133
+
134
+ These rules are cross-cutting.
135
+
136
+ **Rule 0 — dispatch-first, CLI-fallback, manual last.** The project-codey MCP is the primary transport for EVERY step: first search the catalog (`discover` / `discover` → `describe` → `dispatch`) for a served Connect API or `/headless` operation that performs the step, then dispatch it and gate on an independent read-back. Only when NO served operation exists (a routes gap — search returns nothing / `dispatch` 404s), the dispatch errors, or the read-back shows the change did not stick, fall back to a **Metadata API deploy via the Salesforce CLI** — but only if you have shell access with the CLI resolvable and an authenticated target-org alias; build the minimal metadata source, deploy, and gate on the same read-back. Surface a step as a manual / out-of-band action (citing its Salesforce Help link) only as the LAST resort, when neither the platform nor the CLI can complete it. Never hand the admin a manual step you could have dispatched or deployed; never claim a step done without a read-back. The concrete CLI commands live in the skill's execution-policy notes; the steps that stay manual even WITH CLI access (external systems, managed-content clones, Setup/Experience-Builder-UI-only designers) are called out per Act.
137
+
138
+ 1. **Everything goes through the project-codey MCP.** `discover` (search — try multiple angles / search by controller class / `list_apis` by team before declaring "no API") → `describe` (ALWAYS before any PATCH/POST — you need the full input schema) → `dispatch` (hits the connected org). `implemented` = a real core Connect API; `proposed` = an Aura controller behind the Headless360 dispatcher (`/headless/invoke/...`). Both are first-class.
139
+
140
+ 2. **Prefer the `/headless/invoke/...` Aura toggles for the referral prefs** over any metadata equivalent: `enable-criteria-based-search-and-filter`, `enable-appointment-sync`, `enable-captcha-verification`, and the `owner-id-setup` read+`save-owner` chain each return 200; gate on an independent read-back.
141
+
142
+ 3. **`/services/data/v67.0/headless/metadata` is the xmlRep master transport — but it is backed by a STATIC MetadataCrud allowlist (Core-side `setup-ui-crud-api`), NOT every Metadata-API type.** Body is `{type, fullName, xmlRep}` where `xmlRep` is a **Metadata-API XML string** for the component. **Verb split: POST = create, PUT = update/merge (component-level).** It reaches the types the allowlist covers — verified live for Settings singletons (`type:IndustriesSettings`, GET + PUT) and `type:OmniProcess` (step 35; the schema validator walks required fields one at a time, e.g. `omniProcessType` then `uniqueName`, so probe the 400-chain to complete the body). **A type the allowlist does NOT cover returns `400 UNSUPPORTED_OPERATION "MetadataCrud does not support CREATE/READ on type: <T>"` — this is a hard Core gate, not a body problem.** `PathAssistant` (step 7), `BusinessProcess` (step 13 — even embedded in a parent `CustomObject`; see rule 3a), and `NamedCredential` (step 24) are all UNSUPPORTED for both CREATE and READ (live-verified) — deploy them via the MDAPI CLI fallback (Transport rule 0; same `sf project deploy start --metadata-dir` mechanics as rule 3c), and gate on a Tooling read-back. Use the version-prefixed path; the un-prefixed `/headless/metadata` (Aura-dispatcher) form returns `"No controller mapping"` and is NOT wired.
143
+
144
+ 3a. **A Case `BusinessProcess` is NOT reachable through `/headless/metadata` at all — deploy it via the MDAPI CLI fallback.** Neither the top-level `type:BusinessProcess` nor embedding it as a `businessProcesses` child of a parent `type:CustomObject` (`fullName:"Case"`) works: Core resolves the child to its own type and returns `400 UNSUPPORTED_OPERATION "MetadataCrud does not support CREATE on type: BusinessProcess"` (live-verified). The Tooling-REST `POST .../tooling/sobjects/BusinessProcess` path also fails (the complexvalue deserializer rejects scalar `Metadata` sub-fields). **The working transport is an MDAPI deploy** (rule 3c mechanics): build a minimal `objects/Case.object` (or a `businessProcesses`-scoped `CustomObject` component) with the `<businessProcesses>` element and deploy via the Salesforce CLI, then gate on a Tooling read-back. **The `<values>` inside the `businessProcesses` MUST be a subset of the target org's LIVE `Case.Status` picklist values — these vary per org, so discover them live (describe / `FieldDefinition`) before building the body; do NOT copy values from this SKILL or the SOR.** A value the org doesn't have fails deploy with `FIELD_INTEGRITY_EXCEPTION "Picklist value: <X> not found"`.
145
+
146
+ 3b. **The Case record type itself is created via the Tooling `RecordType` sObject** (after its BusinessProcess exists, rule 3a): `POST /services/data/v67.0/tooling/sobjects/RecordType` with `{FullName:'Case.<Name>', Metadata:{label, active, businessProcess:'<BP name>'}}` → 201. A Case RecordType REQUIRES `businessProcess` (400 "businessProcess required" without it) — unlike an **Account** RecordType, which needs none. RecordTypes are `deletable:false` via Tooling — deactivate (`active:false`), never DELETE. Gate on a Tooling `RecordType` read-back (confirm `BusinessProcessId` points to the BP).
147
+
148
+ 3c. **Standard picklist values on standard entities cannot be added via ANY REST transport — and the parent-CustomObject `valueSet` PUT returns a FALSE-POSITIVE `success:true` that is a SILENT NO-OP.** For CSR `Status`/`StatusReason`, all three transports fail: (a) Tooling `CustomField/ClinicalServiceRequest.Status` PATCH → 404 (standard fields are not `00N…`-addressable); (b) `type:CustomField` inline `valueSet` → `success:false FIELD_INTEGRITY_EXCEPTION "cannot define valueSet on a standard field. Use StandardValueSet instead"`; (c) the rule-3a parent pattern `PUT type=CustomObject` embedding `<fields><fullName>Status</fullName><valueSet>…` returns `success:true` **but the value is NOT added** (describe read-back shows original values unchanged). **Always verify a picklist write with a `describe` read-back — a false-positive success is more dangerous than an honest rejection.** The backing `StandardValueSet` DeveloperNames are **`CServiceRequestStatus`** (CSR `Status`) and **`CServiceRequestStatReason`** (CSR `StatusReason`); direct Tooling `StandardValueSet` PATCH fails (`FIELD_INTEGRITY "Full name must be specified"` / `MALFORMED_ID` / `Unable to load specified entity`; sentinel Id `000000000000000AAA`). **The working transport is an MDAPI `StandardValueSet` deploy:** `POST /services/data/v67.0/metadata/deployRequest` (`multipart/form-data`: JSON `deployOptions` + a zip of `package.xml` + `standardValueSets/<Name>.standardValueSet`). Because that endpoint is `multipart/form-data`, **`dispatch` (JSON body only) cannot send it** — drive the deploy via the Salesforce CLI (concrete `deployRequest` command in the execution-policy notes), a direct multipart HTTP POST to `/metadata/deployRequest`, the Metadata API SOAP endpoint, or the Setup UI picklist editor. Two load-bearing deploy rules: **(1) the deploy REPLACES the full value list, it does NOT merge** — **retrieve the existing `StandardValueSet:CServiceRequestStatus` FIRST** (via the same CLI) to capture the authoritative existing `fullName`s (the shipped FHIR values), then deploy the union (existing + new) or you drop the shipped values; **(2) the stored API `fullName`s use underscores** — `Waiting_for_Response`, `Manual_Review_Needed`, `Closed_No_Appointment` (labels have spaces/hyphens) — so the decision table (steps 16/17) must key on the underscore API values, not the display labels. `add-csr-status-picklist-values` / `add-csr-status-reason-picklist-values` are required content, achievable but out-of-band relative to the JSON-only `dispatch` surface.
149
+
150
+ 4. **Flows, Apex, OmniScripts, and Experience sites are all headlessly creatable via `dispatch` — no multipart MDAPI zip needed:**
151
+ - **Flows (screen, autolaunched, orchestrator) create via the Tooling `Flow` sObject** — `POST /services/data/v67.0/tooling/sobjects/Flow` with a JSON `Metadata` complexvalue (processType `Flow` / `AutoLaunchedFlow` / `Orchestrator`). Screen/canvas elements REQUIRE `locationX`/`locationY` (else 400 "Required field is missing: locationX"). (See Act 2 — for the packaged referral flows, clone rather than build from scratch.)
152
+ - **Flow activation is a Tooling `FlowDefinition` PATCH** — `PATCH /services/data/v67.0/tooling/sobjects/FlowDefinition/{id} {Metadata:{activeVersionNumber:N}}` → 204; read-back shows `ActiveVersionId` populated.
153
+ - **Apex classes create via the Tooling `ApexClass` sObject** — `POST /services/data/v67.0/tooling/sobjects/ApexClass {Body:"<full compilable source>"}` → 201. NEW classes POST directly; *updates* to an existing class need a `MetadataContainer` + `ContainerAsyncRequest`.
154
+ - **OmniScripts create+activate via the rule-3 metadata master transport** — `POST type:OmniScript` to create, then `PUT` with `isActive=true` to activate; read-back the `OmniProcess` via the **Data API** (`IsActive=true`; Tooling gives a misleading `INVALID_TYPE`). The create yields a *structural shell* — a functional OmniScript still needs its full element tree / `propertySetConfig` (a designer export). See Act 6 (clone the packaged OmniScript rather than build a shell).
155
+ - **Experience Cloud sites cold-create via `POST /services/data/v67.0/connect/communities`** `{name, templateName, urlPathPrefix}` → **202** `{jobId}` (async `SiteTaskCreate`); poll `BackgroundOperation` by that `jobId` until `Status:Complete`, then confirm the `Network` row exists. Requires Digital Experiences already enabled. Publishing the site Live + guest/branding config are follow-on steps.
156
+
157
+ The one hard multipart limit is the CSR `Status`/`StatusReason` picklist adds (steps 18/19 — rule 3c); every other step is reachable through `dispatch`.
158
+
159
+ 4a. **PRECONDITION — the Business Rules Engine FAMILY must be provisioned on the org, and it CANNOT be self-enabled headlessly.** Steps 16/17 create cleanly *only* when the BRE family is on. Without it, both calls hard-fail with a feature gate: `GET /connect/ruleengine/usage-types` → **403 `FUNCTIONALITY_NOT_ENABLED [BusinessRuleEngineFamily]`** and `POST /connect/business-rules/expression-set` → **403 `FUNCTIONALITY_NOT_ENABLED [InteractionCalculationProcedures]`** (the decision table additionally needs the Decision Table permission). The candidate enable route `PATCH /headless/invoke/platform/bredecision-table-access/handle-pref-enable` does NOT work headlessly (500 `CONTROLLER_ERROR` — the pref's `orgAccess` expression rejects the write). So on an org without the BRE family, **steps 16/17 are a hard GAP** (`feature_not_enabled: BusinessRuleEngineFamily / InteractionCalculationProcedures`): surface it, have the family enabled through the provisioning/licensing path (not a Setup toggle), then re-run.
160
+
161
+ Once provisioned: `POST /connect/business-rules/expression-set` requires `usageType`, which MUST be a value from `GET /connect/ruleengine/usage-types` — **`Bre`** (label "Default") is the general-purpose type; free-text guesses ("Decisioning") 400 "Value does not match expected type". `POST /connect/business-rules/decision-table/definitions` needs BOTH `dataSpaceName` AND a `parameters[]` array (absent `parameters` → 500 NPE); `parameters[].dataType` ∈ `{Boolean,Currency,Date,DateTime,Number,Percent,String}` (**not** "Text"); `usage` ∈ `{Input,Output,RowCriteria}`; **Output fields must NOT carry a `sequence`** ("You can't specify the sequence number for output fields"); needs the Decision Table permission. The "update Clinical Service Request status" table has FOUR ordered columns — **THREE Inputs (`WorkType`, `CSRStatusReason`, `InsuranceStatus`; `usage=Input`, each with an ordered `sequence` 1..3) mapping to ONE Output (`CSRStatus`; `usage=Output`, OMITS `sequence`)**. CSR Status is the OUTPUT the table sets, not an input. Row/data loads follow via `postDecisionTableFile`/`postDecisionTableRows`. **Use `type: LowVolume`, `sourceType: SingleSobject`, `sourceObject: ClinicalServiceRequest`, `dataSpaceName: 'default'`.** This succeeds with no data-space-registration step — `ClinicalServiceRequest` need only be **queryable** (`SELECT Id,Status,StatusReason FROM ClinicalServiceRequest` returns 200, even at 0 rows). Do NOT switch to `type: RealTime` to work around a failure: `RealTime` is Data Cloud-backed and returns `INVALID_API_INPUT "To set Type to RealTime, make sure that dataSourceType is set to ContextDefinition."` — a different source model this DT does not need. If a `LowVolume`/`SingleSobject` create returns `INVALID_CROSS_REFERENCE_KEY`, treat it as a **body/reference** problem (confirm `dataSpaceName='default'` resolves and that `sourceObject` + every `parameters[].fieldName` exist on the object), not an org-provisioning blocker.
162
+
163
+ 5. **A live probe overrides the corpus `status` flag — and when one transport 500s, look for a second before declaring a gap; but a second transport is not guaranteed to exist.** Example: `describe` reports the Aura `save-path-assistant` route as `implemented`, but a live call returns **500 `CONTROLLER_ERROR "appInfo is null"`** (the dispatcher can't populate the UI-service application context, and no body param injects it) — a dead end. The `/headless/metadata` master transport does NOT rescue it either: `PathAssistant` is **not on the Core MetadataCrud allowlist** — both `POST type:PathAssistant` and the READ return `400 UNSUPPORTED_OPERATION "MetadataCrud does not support CREATE/READ on type: PathAssistant"` (live-verified). So `configure-referral-management-path` is reached via the **Salesforce-CLI MDAPI deploy** fallback (rule 0): build a minimal `pathAssistants/<Name>.path` component and `sf project deploy start`, then read-back via Tooling `PathAssistant`.
164
+
165
+ 6. **Re-read to verify — never trust the write's own echo.** Toggles echo the written value; gate on the INDEPENDENT read-back (the `verify-*` step), which confirms the preference actually persisted. Where a route is irreversible or org-scoped, only fire after explicit confirmation and a read that shows it is genuinely off.
166
+
167
+ 7. **Person Accounts enablement is a readiness-gated 3-write chain — prefer the PROPOSED Aura wizard route over the implemented Connect endpoint.** `GET /headless/invoke/platform/person-account-settings` returns four gates (`termsConditionsAccepted`, `accountRecordTypeCreated`, `profilePermsSet`, `orgWideSharingSet`) + `allStepsComplete`. When profile-perms and OWD-sharing already pass, drive: (1) `PATCH .../person-account-settings/accept-terms-and-conditions`; (2) create an Account `RecordType` via Tooling (`{FullName:"Account.<Name>", Metadata:{label, active:true}}` — an **Account** RT needs NO businessProcess, unlike a Case RT, rule 3b); (3) re-read until `allStepsComplete:true`; (4) `PATCH .../person-account-settings/enable-person-accounts` → `personAccountsEnabled:true`; (5) verify with `SELECT Id, IsPersonAccount FROM Account LIMIT 1` (the `IsPersonAccount` field now exists). **The implemented Connect endpoint `POST /connect/accounts/person-accounts-enablement/enable` has a serialization defect (`JSON_PARSER_ERROR: connectProp is null`)** — use the proposed Aura wizard route, which serializes cleanly. Enable is IRREVERSIBLE — fire only on explicit authorization.
168
+
169
+ ---
170
+
171
+ ## Act 0 of 6 — Prerequisites
172
+
173
+ > **Act 0 is the prerequisite gate. It has exactly two prerequisites (see Prerequisites §A). Validate both before any Act 1–6 write; if either is unmet, STOP and redirect.**
174
+ >
175
+ > 1. **Health Cloud Initial Setup complete** — verify by delegating **READ-only** to the [[health-cloud-initial-setup]] SOR (run only its read/verify steps, never a write). **If Health Cloud is not set up, STOP the referral management setup and direct the user to complete Health Cloud initial setup first.**
176
+ > 2. **Person Accounts enabled & configured** — may already be covered by (1). If PA is off, redirect to initial setup, or — only on explicit authorization of the IRREVERSIBLE enablement — fire the `enable-person-accounts` chain (Transport rule 7). Never proceed with PA off.
177
+ >
178
+ > Beyond the two gates, Act 0 runs a few **read-only state reads** (current RM settings, OmniStudio metadata runtime, CSR picklist baseline) that seed later Acts. These do not gate the flow.
179
+
180
+ Run these in order. Nothing in Acts 1–6 fires until both prerequisites are confirmed.
181
+
182
+ | # | Step id | Purpose | Controller / API | Route |
183
+ |---|---|---|---|---|
184
+ | 1 | `verify-health-cloud-license` | **prerequisite 1** — HC initial setup complete | Delegate **READ-only** to the [[health-cloud-initial-setup]] SOR (reads only, no writes); STOP + redirect if HC is not set up. The RM-side license confirmation is the Health Cloud license check. | GET `/headless/invoke/platform/health-cloud-admin-feature-setup/has-health-cloud-licence` (proposed) + the initial-setup SOR's read steps |
185
+ | 2 | `read-referral-management-settings` | read (seeds resumability) | Reads the Referral Management settings | GET `/headless/invoke/platform/referral-management-settings` (proposed) |
186
+ | 3 | `enable-person-accounts` | **prerequisite 2** — PA enabled & configured (write only if off + authorized) | Verify first; if off and authorized: readiness-gated chain accept-terms → Account `RecordType` (Tooling) → `enable-person-accounts` (Transport rule 7) | GET `/headless/invoke/platform/person-account-settings`; PATCH `.../person-account-settings/enable-person-accounts` (proposed) |
187
+ | 4 | `check-omnistudio-runtime` | read (seeds Act 6) | Reads the OmniStudio preferences — including `standardOmniStudioRuntime` (metadata-enabled half of the two-setting toggle) | GET `/headless/invoke/platform/omni-studio-settings/get-omni-studio-prefs` (proposed) |
188
+ | 5 | `discover-clinical-service-request-picklists` | discovery (seeds Act 2) | Tooling: `FieldDefinition`/`EntityParticle` for `ClinicalServiceRequest` Status/StatusReason | GET `/services/data/v67.0/tooling/query/` |
189
+
190
+ **Act 0 — prerequisite notes (findings):**
191
+
192
+ - **Prerequisite 1 — Health Cloud Initial Setup complete (`verify-health-cloud-license`).** The delegated read-only [[health-cloud-initial-setup]] verification is the HALT gate (see §A.1). The RM-side spot-check returns a scalar boolean (`true` when provisioned); treat any error/`false` as "not provisioned."
193
+ - **`read-referral-management-settings`** — the settings read returns `{isReferralManagementAppEnabled, isCaptchaVerificationEnabled}`. Not a gate — it is the resumability read for BOTH toggles: Act 1 step 5a (the app master switch) is skipped when `isReferralManagementAppEnabled` already reads `true`, and the Act 6 captcha toggle when `isCaptchaVerificationEnabled` does.
194
+ - **Prerequisite 2 — Person Accounts enabled & configured (`enable-person-accounts`).** May already be confirmed by the prerequisite-1 delegation — if so, don't re-check. If off, drive the readiness-gated chain (Transport rule 7) only on explicit authorization of the irreversible enable, else redirect to [[health-cloud-initial-setup]]; never proceed with PA off. Trust the live readiness read over any stored note about PA state.
195
+ - **`check-omnistudio-runtime`** — read that seeds Act 6 (the Create Referral OmniScript), not a gate for the rest of the flow. Reads only `standardOmniStudioRuntime` (the metadata-enabled half of the two-setting toggle — see §A.1); if false, have the admin flip both settings before Act 6.
196
+ - **`discover-clinical-service-request-picklists`** feeds Act 2. It reads the current `ClinicalServiceRequest` Status + StatusReason picklist values so the Act-2 picklist steps know the baseline. Read-only; ClinicalServiceRequest is a standard Health Cloud entity.
197
+
198
+ ## Act 1 of 6 — Turn on Referral Management (the Clinical Service Request core)
199
+
200
+ > Act 1 opens by **turning on the Referral Management app master switch** (step 5a, `enableReferralManagementApp`) and reading it back (step 5b) — every referral runtime endpoint (`create-referral-runtime`, the guest form) is gated on it, and nothing else in the flow flips it. Then it runs in the order the Salesforce setup docs prescribe: **first configure the Clinical Service Request record page for referral coordinators** (step 6 — a **Lightning record page / FlexiPage** with four named components + its related lists), **then configure the referral Path** (step 7 — the Aura save route 500s AND the `/headless/metadata` master transport rejects `PathAssistant` as an unsupported type, so it deploys via the Salesforce-CLI MDAPI fallback), **then set up Actionable Segmentation** so coordinators work from follow-up lists of referral providers/patients (step 8).
201
+
202
+ | # | Step id | Purpose | Controller / API | Route |
203
+ |---|---|---|---|---|
204
+ | 5a | `enable-referral-management-app` | write | **Turn on the Referral Management app** (`enableReferralManagementApp` org pref). Body `{value:true}`; the controller writes the pref only on a Health Cloud org and returns a bare boolean (`false` = nothing written). Skip if step 2 already reads `isReferralManagementAppEnabled:true`. Fallback if the route does not resolve: `/headless/metadata` PUT `{type:"IndustriesSettings", fullName:"Industries", xmlRep:"<IndustriesSettings><enableReferralManagementApp>true</enableReferralManagementApp></IndustriesSettings>"}` (partial `xmlRep` merges; `fullName:"IndustriesSettings"` 400s). | PATCH `/headless/invoke/platform/referral-management-settings/handle-referral-management-app-toggle` |
205
+ | 5b | `verify-referral-management-app-enabled` | verify | Re-read the settings and require `isReferralManagementAppEnabled:true` before any referral runtime call. | GET `/headless/invoke/platform/referral-management-settings` |
206
+ | 6 | `assign-clinical-service-request-page-layout` | write | **Configure the CSR record page for referral coordinators** ([`hc_admin_referral_management_clinical_service_request_layout`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_clinical_service_request_layout.htm&type=5)). Primary artifact is a **Lightning record page (FlexiPage)** for `ClinicalServiceRequest`: in App Builder add custom **tabs** + the four supported components (**Action Launcher** directly on the page, **Assessment**, **Healthcare Appointment Scheduler**, **IndustriesHCCarePlanManager Flexcard**), then **Save and activate** as the org default. Secondary: in Object Manager add four **related lists** to the classic layout. | FlexiPage create POST `/headless/metadata`; industries-component binds via a **whole-page read-modify-write `/headless/metadata` PUT** (fall back to MDAPI zip deploy only if a read-back shows the bind dropped); classic `Layout` via Tooling `Layout` |
207
+ | 7 | `configure-referral-management-path` | write | **Configure the referral Path** (RM guided setup links generic Path docs: [`path_overview`](https://help.salesforce.com/s/articleView?id=sales.path_overview.htm&type=5)). `PathAssistant` metadata type; BOTH the Aura `save-path-assistant` route (500 `appInfo is null`) and `/headless/metadata` (400 `UNSUPPORTED_OPERATION` — `PathAssistant` not on the MetadataCrud allowlist, live-verified) fail, so deploy via the Salesforce-CLI MDAPI fallback (Transport rule 0/5) | `sf project deploy start` (MDAPI `pathAssistants/<Name>.path`); read-back via Tooling `PathAssistant` |
208
+ | 8 | `configure-referral-actionable-lists` | write | **Set up Actionable Segmentation for Referral Management** ([`actionable_segmentation_setup_lists`](https://help.salesforce.com/s/articleView?id=ind.actionable_segmentation_setup_lists.htm&type=5)). **First verify/assign the `ActionableSegmentationForHealthCloud` permission set to the running user** (Data-API `PermissionSetAssignment`; it ships with the Health Cloud Platform license, so read-back first and only assign if missing) — the running identity can't author a definition without it. **Then verify/enable the Data Pipelines org preference** (`appType=DataManager` — see [[SonicGettingStarted]]) — Data Processing Engine will not run without it — **then turn ON the Actionable Segmentation master feature toggle** (`save-pref` `{pref:"listPref", enabled:true}`; requires Data Pipelines + DPE already on) — **then** create an **actionable list definition** (Setup → **Actionable Segmentation Settings** → **New Data Processing Engine Definition**) so coordinators get follow-up lists of referral providers/patients; assign the remaining enabling permission set(s). | Perm-set verify/assign via Data-API `PermissionSetAssignment` (`ActionableSegmentationForHealthCloud`); Data Pipelines pref: PATCH `/headless/invoke/platform/sonic-getting-started/handle-sonic-pref` (proposed); Actionable Segmentation toggle: PATCH `/headless/invoke/platform/actionable-segmentation-settings/save-pref` + read-back GET `/headless/invoke/platform/actionable-segmentation-settings` (proposed); DPE definition authored in Actionable Segmentation Settings / the DPE designer (Setup-UI, GAP for `dispatch`) |
209
+
210
+ **Act 1 — notes (ordering & findings):**
211
+
212
+ - **`assign-clinical-service-request-page-layout`** — The CSR coordinator page is a *Lightning record page (FlexiPage)*, NOT a classic page Layout. It is the surface where coordinators schedule appointments, complete assessments, add care plans, enroll patients in care programs, and launch actions. In Lightning App Builder, build (or edit — open a CSR record → **Edit Page**) the `ClinicalServiceRequest` record page, add custom **tabs**, and place the **four supported components**:
213
+ - **Action Launcher** — launches actions from an **Action Launcher deployment that includes the Clinical Service Request object**. **Add it directly to the page, NOT onto a tab.**
214
+ - **Assessment** — complete intake/eligibility assessments (e.g., on a custom "Assessments" tab).
215
+ - **Healthcare Appointment Scheduler** — schedule appointments (e.g., on a custom "Appointments" tab).
216
+ - **IndustriesHCCarePlanManager Flexcard** — view and add care plans.
217
+
218
+ Then **Save and activate** the record page as the CSR org default. **If the org already ships a `ClinicalServiceRequest` Lightning record page from the healthcloud package, configure/activate it rather than authoring a duplicate.**
219
+ - **Secondary — related lists (classic layout).** In **Object Manager**, add the referral-relevant related lists to the CSR page layout: **Assessments**, **Care Plan Details**, **Care Program Enrollees**, and **Service Appointments**. If a related list isn't available, its backing feature isn't enabled yet — enable the feature in the org first.
220
+ - **Transport:** create the FlexiPage via `POST /services/data/v67.0/headless/metadata {type:"FlexiPage", fullName:"…", xmlRep:"…"}`, then activate it as the default record page via the CustomObject `actionOverrides` PUT (View/Large/Flexipage). **Component binds for the industries/OmniStudio components (the Flexcard, Healthcare Appointment Scheduler): FIRST attempt a whole-page read-modify-write PUT** — GET the full FlexiPage, add the component nodes to the retrieved record, and PUT the ENTIRE record back to `/headless/metadata`. A live verification showed this binds standard industries components (`healthcloud:patientCard` / `industries_common:timeline`); the earlier "silently dropped" reports were an artifact of *partial-page* PUTs. These specific components were not individually re-verified, so **fall back to an MDAPI zip deploy** (`POST /metadata/deployRequest`) only if a read-back shows the component did not persist. Enable each component's backing feature FIRST (access gate). **CRITICAL: any transport can return success while silently failing to persist the bind — never report this step complete on the write response alone; always re-fetch the FlexiPage and confirm the component node is present.**
221
+ - The classic Tooling `Layout` POST (`FullName: ClinicalServiceRequest-<Name> Layout`, `layoutSections` `TwoColumnsTopToBottom` → 201; `/headless/metadata` 400s "Invalid fullName" for `Layout`, so Tooling REST is the transport) is the transport for that **secondary related-lists** artifact, not the primary page.
222
+ - **`configure-referral-management-path`** — BOTH available live transports fail, so this step deploys via the **Salesforce-CLI MDAPI fallback** (Transport rule 0/5). (a) The Aura `save-path-assistant` route is a dead end (500 `CONTROLLER_ERROR "appInfo is null"` — the dispatcher can't populate the UI-service application context). (b) The `/headless/metadata` master transport does NOT rescue it: `PathAssistant` is **not on the Core MetadataCrud allowlist** — `POST type:PathAssistant` (and the READ) return `400 UNSUPPORTED_OPERATION "MetadataCrud does not support CREATE/READ on type: PathAssistant"` (live-verified). **The working transport:** build a minimal MDAPI source tree — `pathAssistants/ClinicalServiceRequest.Referral_Management_Path.path` (with `active`, `entityName=ClinicalServiceRequest`, `fieldName=Status`, a `<recordTypeName>` (REQUIRED — see below), and one `pathAssistantStep` per CSR Status value) + a `package.xml` naming the `PathAssistant` member — and `sf project deploy start --metadata-dir <dir>`, then read-back Tooling `SELECT Id,MasterLabel FROM PathAssistant`. **The `.path` source MUST include a `<recordTypeName>` element** — without it the deploy fails `FIELD_INTEGRITY_EXCEPTION "Required field is missing: recordTypeName"`. For a CSR with no custom record type, use the sentinel `<recordTypeName>__MASTER__</recordTypeName>`. `pathAssistantStep`s must reference picklist values that ACTUALLY EXIST on the field — on an org where the referral Status values (steps 18/19) are not yet added, build the path on the shipped FHIR values (e.g. `Draft`/`Active`/`Completed`) or a subset, then re-run to add referral-value steps once 18/19 land. The name "Referral Management Path" is illustrative — pick any clear name, and if a referral Path already exists on `ClinicalServiceRequest.Status`, reuse/update it (re-deploy the same `fullName` — MDAPI deploy upserts) rather than creating a second.
223
+ - **`configure-referral-actionable-lists`** — Actionable Segmentation lets referral coordinators work from **actionable lists**: curated follow-up lists of providers/patients (e.g. referrals awaiting a response, or facilities that haven't confirmed capacity) drawn from a dataset. An **actionable list definition** wraps a **Data Processing Engine** definition, so the flow is **verify/assign the `ActionableSegmentationForHealthCloud` perm set → enable Data Pipelines (+ DPE) → turn ON the Actionable Segmentation master feature toggle → create the definition → assign remaining perms**.
224
+ - **STEP 1 — verify/assign the `ActionableSegmentationForHealthCloud` permission set to the running user FIRST (precondition).** The running identity cannot author (or launch) an actionable list / DPE definition without the **Actionable Segmentation for Health Cloud** permission set (API name **`ActionableSegmentationForHealthCloud`**). On a Health Cloud org this perm set **ships with the Health Cloud Platform license**, so it is normally already granted by the [[health-cloud-initial-setup]] license gate — but do NOT assume it: **read it back first** (`SELECT Id FROM PermissionSetAssignment WHERE Assignee.Id = '<running user>' AND PermissionSet.Name = 'ActionableSegmentationForHealthCloud'`) and **assign it only if missing** via Data-API `PermissionSetAssignment` create (`DUPLICATE_VALUE` = already assigned = success — same mechanics as step 20). If the perm set itself doesn't exist on the org, that's a license gap → surface it and HALT this step.
225
+ - **STEP 2 — verify/enable the Data Pipelines org preference (precondition).** Actionable list definitions run on the **Data Processing Engine**, which is gated by the **Data Pipelines** org preference. Enable it with body `{value:true, appType:"DataManager"}` (`appType=DataManager`) — PATCH `/headless/invoke/platform/sonic-getting-started/handle-sonic-pref`. This route is AURA-IS-CANONICAL (no Connect/Tooling/Metadata equivalent — the atomic batch + post-enable hook can't be reconstructed from a generic pref-write) and requires View Setup + the Data Pipelines consumer permission. See the [[SonicGettingStarted]] node for the full pref contract. The corpus exposes no independent GET read-back for this pref (the page's `init` read is an orphan action, not a dispatch route), so confirm enablement by gating on the Actionable Segmentation toggle in STEP 3 succeeding (the DPE definition create in STEP 4 is the final gate) rather than a `verify-*` echo. **If Data Pipelines is off, creating the definition will fail — enable it before proceeding.**
226
+ - **STEP 3 — turn ON the Actionable Segmentation master feature toggle (the org preference).** Enabling Data Pipelines is necessary but NOT sufficient — Actionable Segmentation has its own master org preference on the **Actionable Segmentation Settings** setup page (`/lightning/setup/ActionableSegmentationSettings/home`) that must be turned ON before the feature (and its list definitions) is usable. Set it via `save-pref` with body `{pref:"listPref", enabled:true}` (`listPref` is the master Actionable Segmentation feature toggle; the sibling `adminConfigAccess` pref grants admin-config edit perm and can be enabled the same way if the admin needs it) — PATCH `/headless/invoke/platform/actionable-segmentation-settings/save-pref`. **ORDERING IS LOAD-BEARING: the toggle raises an org-pref-enablement error unless BOTH Data Pipelines AND the Data Processing Engine are already enabled** — which is exactly why this step follows STEP 2. Read-back via GET `/headless/invoke/platform/actionable-segmentation-settings`, which returns the `{listPref, adminConfigAccess}` pref map — gate on `listPref:true`, not the write echo. **Note:** the same setup page also bundles a CRM Analytics (Wave) app install that backs actionable lists (`install-wave-application`); if list datasets fail to materialize, verify the Wave app installed (`get-actionable-list-folder-status`).
227
+ - **STEP 4 — create the actionable list definition.** From Setup → **Actionable Segmentation Settings** → **New Data Processing Engine Definition**, name it (alphanumeric, begins with a letter), select the **primary object** (e.g. `ClinicalServiceRequest` / `Account`), **Launch Data Processing Engine Definition**, add the data-source / join / filter nodes (the primary object's data-source node with `Id`+`Name` is auto-created and non-deletable), then **save + activate + run** the DPE to materialize the dataset. List creators then build actionable lists from that dataset, set priority / agent guidance / sort order, and assign each list to an agent or queue.
228
+ - **Permissions / licenses:** requires **Industry Sales Excellence** + **Query for Datapipelines User** licenses. To create definitions the running user needs the **Actionable Segmentation for Health Cloud** perm set (`ActionableSegmentationForHealthCloud` — verified/assigned in STEP 1) **+ Data Pipelines Base User** perm set **+ View Setup and Configuration**. On Health Cloud the `ActionableSegmentationForHealthCloud` perm set ships with the **Health Cloud Platform license** (so you do NOT assign a separate *generic* Actionable Segmentation perm set — the [[health-cloud-initial-setup]] license gate normally already grants it; STEP 1 still reads it back and assigns only if missing) — but **Data Pipelines Base User** still must be assigned separately.
229
+ - **Transport:** the permission-set assignments (STEP 1) and the Actionable Segmentation master toggle + read-back (STEP 3, the `save-pref` write + the settings read-back) are live-dispatchable via `dispatch` (Data-API `PermissionSetAssignment` create; `DUPLICATE_VALUE` = already assigned = success — same mechanics as step 20). The **DPE definition authoring is a Setup-UI / DPE-designer task** — the join/filter node graph has no `dispatch` surface; the definition persists as a `BatchCalcJobDefinition`, but the node authoring is designer-only, so surface it as a UI/metadata step (do NOT fabricate a call). Optionally tune the **Actionable List `List Status` picklist** (Object Manager → **Actionable List** → Fields & Relationships → **List Status**) to your workflow's status values (draft / ready / in progress / completed) and set a default.
230
+
231
+ ## Act 2 of 6 — Internal referral creation & routing
232
+
233
+ > Act 2 opens with **Configure the Create Referral Flow** (step 9 — clone/save/activate the packaged flow), then **Include Referral Action in Provider Search** (steps 10–12 — enable Criteria-Based Search & Filter, then configure Provider Search so the **Create Referral** search action created in step 9 surfaces in provider search results), then covers the other packaged Flows + orchestration activation, the Case BusinessProcess (MDAPI deploy — `/headless/metadata` rejects the type) + Case record type, the expression set + decision table (Business Rules Engine Connect), and the Action Plans permission set. Two things are out-of-band relative to the JSON `dispatch` surface: the two CSR standard-field picklist-value adds (StandardValueSet, rule 3c) and the Case BusinessProcess (rule 3a). `create-case-business-process` is its own step (a prerequisite of the record type).
234
+
235
+ | # | Step id | Purpose | Controller / API | Route |
236
+ |---|---|---|---|---|
237
+ | 9 | `create-referral-screen-flow` | write (clone packaged) | **Configure the Create Referral Flow** ([`hc_admin_referral_management_flow`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_flow.htm&type=5)). Flow Builder automates referral creation — the flow creates the **Clinical Service Request**, CSR details, and document links, and creates/updates the related patient **Account**. From Setup → **Flows** → click **Create Referral**; review its elements, and to customize **Save As New Flow** (label + API name + description), drag/configure elements, then **Save and activate** (Health Cloud allows only ONE active Create Referral version; if not customizing, the packaged flow is already active). Then add it as a **quick action** (action type **Flow**) on the **patient Account** record page and, optionally, the **Clinical Service Request** detail page. Needs **Manage Flow**; prerequisite data = provider records + referral-reason code set bundles. | discover: GET `/services/data/v67.0/query/` (**Data API, NOT `/tooling/query/`** — `FlowDefinitionView` is a Data-API object; `/tooling/query/` 400s `INVALID_TYPE "sObject type 'FlowDefinitionView' is not supported"`) — `FlowDefinitionView` WHERE `ApiName='CreateReferral' AND NamespacePrefix='healthcloud'`) → clone via "Save As New Flow" (UI-only; managed flow is opaque to the Metadata/Tooling API, no headless clone) → activate the UNMANAGED clone via `FlowDefinition` PATCH |
238
+ | 10 | `enable-criteria-based-search-and-filter` | write | Enables Criteria-Based Search & Filter (body `{enable:true}`) | PATCH `/headless/invoke/platform/criteria-based-search-and-filter/set-criteria-based-search-and-filter-pref` (proposed) |
239
+ | 11 | `verify-criteria-based-search-and-filter` | verify | Reads the Criteria-Based Search & Filter preference | GET `/headless/invoke/platform/criteria-based-search-and-filter/get-criteria-based-search-and-filter-pref` (proposed) |
240
+ | 12 | `include-referral-action-in-provider-search` | write (CBS&F designer / Setup-UI) | **Include Referral Action in Provider Search** ([`hc_admin_provider_search_criteria_based`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_provider_search_criteria_based.htm&type=5)). Configure Provider Search with Criteria-Based Search & Filter so coordinators can initiate the Create Referral flow (step 9) directly from provider search results. After CBS&F is on (steps 10/11) **and Data Pipelines is on** (Act 1 step 8): (1) create a **search criteria configuration**; (2) create a **searchable object configuration** — recommended **`CareProviderSearchableField`** (a custom searchable object also needs a custom DPE definition); (3) **set up search actions**, choosing the prebuilt **Create Referral** action ("creates referral requests using data from selected search results"); (4) add the **Criteria-Based Search and Filter** component to the coordinators' Lightning page (e.g. account record page + care-coordinator app home page), and — for the portal (Act 6) — to the Experience Cloud site. **Perms:** Criteria-Based Search and Filter perm set **AND** Health Cloud Provider Relationship Management **or** Health Cloud Provider Search perm set (card view also needs OmniStudio Admin). | CBS&F designer / Setup-UI (search criteria + searchable object + search-action authoring; `discover` for a backing surface before declaring GAP); enablement via steps 10/11; component placement via App Builder / Experience Builder |
241
+ | 13 | `create-case-business-process` | write | Case `BusinessProcess` — prerequisite of the Case RT. `/headless/metadata` rejects it (`UNSUPPORTED_OPERATION` for both `type:BusinessProcess` and the parent-`CustomObject` embed, live-verified), so deploy via the Salesforce-CLI MDAPI fallback (Transport rule 3a) | `sf project deploy start` (MDAPI `objects/Case.object` with a `<businessProcesses>` element); read-back via Tooling `BusinessProcess` |
242
+ | 14 | `create-case-record-type` | write | Tooling `RecordType` — `{FullName:'Case.<Name>', Metadata:{label, active, businessProcess}}` (Case RT REQUIRES `businessProcess`; `deletable:false` → deactivate only; Transport rule 3b) | POST `/services/data/v67.0/tooling/sobjects/RecordType` |
243
+ | 15 | `create-case-from-csr-flow` | write (clone packaged) | **Configure Case Creation from a Clinical Service Request** ([`hc_admin_referral_management_case_creation_flow`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_case_creation_flow.htm&type=5)). **clone → save → activate:** discover the PACKAGED `healthcloud__CreateCaseUpdateCSR` flow ("Create Case and Update Clinical Service Request"), then CLONE it ("Save As New Flow"), and save + activate the clone; add "Referral" to CSR Source Channel + Case Origin picklists. Do NOT hand-build a new flow from scratch (if not customizing, the packaged flow is already active) | discover: GET `/services/data/v67.0/query/` (**Data API, NOT `/tooling/query/`** — see step 9; `FlowDefinitionView` is a Data-API object) — `FlowDefinitionView` WHERE `ApiName='CreateCaseUpdateCSR' AND NamespacePrefix='healthcloud'`) → clone ("Save As New Flow", UI-only) → activate the unmanaged clone via `FlowDefinition` PATCH |
244
+ | 16 | `configure-patient-referral-expression-set` | write | **Configure the Business Rules Engine flow to update CSR status** ([`hc_admin_referral_management_configure_use_bre_flow`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_configure_use_bre_flow.htm&type=5)). Create the expression set via the Business Rules Engine Connect API — `usageType` MUST be `Bre` (from `/connect/ruleengine/usage-types`; Transport rule 4a) | POST `/services/data/v67.0/connect/business-rules/expression-set` |
245
+ | 17 | `load-patient-referral-decision-table` | write | (same doc as step 16: [`hc_admin_referral_management_configure_use_bre_flow`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_configure_use_bre_flow.htm&type=5)) Create the decision table via the Business Rules Engine Connect API — needs `dataSpaceName` + `parameters[]` + **`sourceType: "SingleSobject"`** (case-sensitive enum `SingleSobject` / `MultipleSobjects` / `CsvUpload`; omitting it 400s "Specify a valid value for sourceType parameter", and guesses like `SObject` / `Entity` / `StandardObject` fail to parse) + `sourceObject` + `setupName` (Transport rule 4a) | POST `/services/data/v67.0/connect/business-rules/decision-table/definitions` |
246
+ | 18 | `add-csr-status-picklist-values` | write | required content — the exact CSR **Status** values below FEED the decision-table CSV (step 17). Transport is a `StandardValueSet` MDAPI deploy of **`CServiceRequestStatus`** (multipart, replaces full list — retrieve first); the JSON-only `dispatch` surface can't send it (rule 3c), so drive via the Salesforce CLI (execution-policy notes) or the Setup UI | `StandardValueSet` MDAPI deploy (Salesforce CLI) / Setup UI |
247
+ | 19 | `add-csr-status-reason-picklist-values` | write | CSR **StatusReason** is a **multipicklist** that ships with **zero** values; the exact values below also feed the decision table. Transport = `StandardValueSet` MDAPI deploy of **`CServiceRequestStatReason`**, same mechanics as 18 | `StandardValueSet` MDAPI deploy (Salesforce CLI) / Setup UI |
248
+ | 20 | `assign-action-plans-permission-set` | write | Data API: create `PermissionSetAssignment` ("Action Plans" perm set → admin) | POST `/services/data/v67.0/sobjects/PermissionSetAssignment` |
249
+ | 21 | `activate-referral-flow-orchestration` | write (clone/activate packaged) | **Set up the processing-stage Flow Orchestrator** ([`hc_admin_referral_management_configure_csr_flow_orchestration`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_configure_csr_flow_orchestration.htm&type=5)). **clone → save → activate:** to customize routing, CLONE the PACKAGED `healthcloud__AutoCsrReview` orchestrator ("Referral Management: Automate Clinical Service Request Review"; ships INACTIVE) via "Save As New Flow", then save + activate the clone; if unchanged, activate the packaged version in place via Flow Builder UI (the managed FlowDefinition is not exposed to Tooling, so in-place activation is UI-only; the PATCH transport targets an unmanaged clone). Do NOT invent a `referral-routing` orchestration from scratch | discover `FlowDefinitionView` → clone ("Save As New Flow") → PATCH `/services/data/v67.0/tooling/sobjects/FlowDefinition/{id}` (`{Metadata:{activeVersionNumber:N}}`) |
250
+
251
+ **Act 2 — notes (ordering & findings):**
252
+
253
+ - **`enable-criteria-based-search-and-filter` (10) + `verify-criteria-based-search-and-filter` (11)** — the enablement toggle for step 12 ("Include Referral Action in Provider Search"). PATCH body `{enable:true}` → 200 `{status:SUCCESS, isPrefEnabled:true}`; verify via step 11. This powers Provider Search's Criteria-Based Search & Filter, which hosts the **Create Referral** search action. Reversible. Per the doc, Provider Search also needs **Data Pipelines** ON — that toggle is Act 1 step 8 (`configure-referral-actionable-lists`, the Data Pipelines preference route); confirm it's on before configuring step 12.
254
+ - **`include-referral-action-in-provider-search` (12)** — this is the step **immediately after Configure the Create Referral Flow**, and it depends on that flow existing (step 9) because the **Create Referral** search action launches it. Follow [`hc_admin_provider_search_criteria_based`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_provider_search_criteria_based.htm&type=5) precisely:
255
+ 1. **Enable Criteria-Based Search and Filter** — done by steps 10/11; the doc pairs it with **Data Pipelines** (Act 1 step 8). Don't re-toggle if already on.
256
+ 2. **Create a search criteria configuration** (Configure the Search Criteria for a Searchable Object) — defines the custom search criteria, result filters, and result display.
257
+ 3. **(Card view)** — if results display as cards, the recommended container is the **`HealthCloudPSProviderCardContainer`** OmniStudio FlexCard; selecting/configuring a FlexCard needs the **OmniStudio Admin** perm set. (The shipped FlexCard doesn't localize age-group/operating-hours values — clone a custom FlexCard to work around that.)
258
+ 4. **Choose search-result actions** — the prebuilt actions are **Copy Records**, **Create Report**, and **Create Referral**. Select **Create Referral** ("creates referral requests using data from selected search results") — this is the action that puts referral creation into Provider Search. **Note:** on Experience Cloud sites only **Copy Records** is available to authenticated/guest users; **Create Report and Create Referral are NOT available on Experience Cloud sites**, so the portal (Act 6) guest form uses the Create Referral OmniScript (step 36), not this search action.
259
+ 5. **Create a searchable object configuration** (Configure a Searchable Object) — recommended searchable object is **`CareProviderSearchableField`**; a *custom* searchable object additionally requires a custom **Data Processing Engine** definition.
260
+ 6. **Set up search actions** (Set Up Search Actions in Criteria-Based Search and Filter) — wire the Create Referral action selected in (4) to the search configuration.
261
+ 7. **Add the Criteria-Based Search and Filter component to a page** — for internal users, place it on a standard/custom Lightning page (e.g. the **account record page** and the **home page of the apps care coordinators use**). For guest/authenticated portal users, add it to an **Experience Cloud site** (Act 6).
262
+ - **Perms:** the running user needs the **Criteria-Based Search and Filter** perm set **AND** the **Health Cloud Provider Relationship Management** *or* **Health Cloud Provider Search** perm set. Available only in Lightning Experience on Enterprise/Unlimited with Health Cloud (or Life Sciences Cloud).
263
+ - **Transport:** the enablement is live-dispatchable (steps 10/11). The search criteria configuration, searchable object configuration, and search-action authoring are **CBS&F designer / Setup-UI** tasks; before declaring a GAP, `discover`/`discover` for a backing metadata or Connect surface (Transport rule 1). Component placement is App Builder / Experience Builder. Do NOT fabricate a call for the designer authoring — surface it as a UI step.
264
+ - **`create-case-business-process` + `create-case-record-type`** — The Case `BusinessProcess` is NOT reachable via ANY JSON REST transport. (a) The Tooling-REST `BusinessProcess` sObject rejects it (the complexvalue deserializer rejects scalar `Metadata` sub-fields). (b) The `/headless/metadata` master transport rejects it too — both a top-level `type:BusinessProcess` and embedding it as a `businessProcesses` child of a parent `type:CustomObject` (`fullName:"Case"`) return `400 UNSUPPORTED_OPERATION "MetadataCrud does not support CREATE on type: BusinessProcess"` (Core resolves the child to its own type; live-verified). **The working transport is a Salesforce-CLI MDAPI deploy** (Transport rule 3a): build `objects/Case.object` (or a `businessProcesses`-scoped `CustomObject` component) carrying `<businessProcesses><fullName>Referral_Business_Process</fullName><isActive>true</isActive>…</businessProcesses>` plus a `package.xml`, `sf project deploy start --metadata-dir <dir>`, then read-back via Tooling `BusinessProcess`. Then the Case RT via Tooling `RecordType` `{FullName:'Case.Referral_Case', Metadata:{label, active:true, businessProcess:'Referral_Business_Process'}}` → 201 (a Case RT REQUIRES `businessProcess`, unlike an Account RT — rule 3b). RecordTypes are `deletable:false` → deactivate, never DELETE. The developer names (`Referral_Business_Process`, `Referral_Case`) are illustrative — any clear names work, and reuse an existing referral Case RT if the org already has one. Note: the corpus `CaseProcess` SOR names a server-side sObject that does not exist (404/`INVALID_TYPE`); the correct type is the generic `BusinessProcess`, deployed via MDAPI as above.
265
+ - **`create-referral-screen-flow` (9), `create-case-from-csr-flow` (15), `activate-referral-flow-orchestration` (21)** — **CLONE THE PACKAGED FLOW, THEN SAVE + ACTIVATE; DO NOT HAND-BUILD A NEW ONE FROM SCRATCH.** The procedure is: open the packaged flow → click **"Save As New Flow"** (clone with a new label + API name; the clone inherits all packaged elements) → configure as needed → **Save and activate** the clone → add it as a quick action. Cloning is required because **managed-package flows can't be edited in place**. Only ONE active version of the Create Referral flow is allowed, so activate the single configured clone. **If no customization is needed, the packaged flow ships already active and can be used as-is (skip the clone).** All three flows ship in the `healthcloud` managed package on a Health Cloud-licensed org. Do NOT hand-build namespace-less copies from scratch — those are non-canonical duplicates that shadow the shipped assets.
266
+ - **Step 9 → packaged `healthcloud__CreateReferral`** (ProcessType Flow, `IsActive=true`) — **Configure the Create Referral Flow** ([`hc_admin_referral_management_flow`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_flow.htm&type=5)). This is the **first step of Act 2**. The flow creates the Clinical Service Request, CSR details, and document links, and creates or updates the related patient Account; when launched from a page that carries patient or provider information it prepopulates with that information. **Prerequisite user permission: Manage Flow** (to open/edit/create a flow in Flow Builder). **Prerequisite data:** provider records and code set bundles for referral-reason codes (optionally the patient's member plans, conditions, and diagnoses, if that data already exists for the patient). **Follow the doc's procedure exactly:** (1) From Setup, enter *Flows* in the Quick Find box, select **Flows**, then click **Create Referral** — the basic create-referral flow's elements appear in the builder; (2) review the flow's elements and attributes — update them only if you want to customize further (if so, do steps 3–7; otherwise skip to step 8); (3) click **Save As New Flow**; (4) enter a label, API name, and description for the clone, then click **Save**; (5) drag any additional elements you want onto the canvas; (6) select each flow element and configure its screen properties to suit your business requirements; (7) **Save and activate** the flow — Health Cloud supports only **ONE active version** of the Create Referral flow; (8) from the **patient Account** record page, add a **quick action** that triggers the Create Referral flow, and optionally add the same quick action to the **Clinical Service Request** detail page. Create the quick action as a new action with **action type Flow** from the object's **Buttons, Links, and Actions** page, then add it to the **Salesforce Mobile and Lightning Experience Actions** section of that object's page layout; if you use **Action Launcher**, include the quick action in an **Action Launcher Deployment** record instead. (If you use the **Crisis Support Center Management** app, you can also add the Create Referral action to the **Bed Search** component.) *Discover (headless equivalent of step 1)*: `SELECT ApiName, Label, IsActive FROM FlowDefinitionView WHERE ApiName = 'CreateReferral' AND NamespacePrefix = 'healthcloud'` **via the Data API `GET /services/data/v67.0/query/` — NOT `/tooling/query/`** (`FlowDefinitionView` is a Data-API object; the Tooling query endpoint 400s `INVALID_TYPE "sObject type 'FlowDefinitionView' is not supported"`). `FlowDefinitionView.ApiName` is UN-namespaced with a separate `NamespacePrefix` column, so `'healthcloud__CreateReferral'` returns 0 rows; the column is `ApiName` NOT `DeveloperName`; no OR/disjunctions. *Clone (steps 3–4)*: "Save As New Flow" is a Flow Builder UI action — NO headless equivalent (the managed flow is opaque to the subscriber Metadata/Tooling API). *Activate the UNMANAGED clone (step 7)*: `FlowDefinition` PATCH `{Metadata:{activeVersionNumber:N}}` → 204.
267
+ - **Step 15 → packaged `healthcloud__CreateCaseUpdateCSR`** ("Create Case and Update Clinical Service Request", `AutoLaunchedFlow`, `IsActive=true`). Clone via "Save As New Flow" to customize, then save + activate. ALSO add the value **"Referral"** to the CSR **Source Channel** picklist and the **Case Origin** picklist so the flow's branching resolves.
268
+ - **Step 21 → packaged `healthcloud__AutoCsrReview`** ("Referral Management: Automate Clinical Service Request Review", Orchestrator). This ships **INACTIVE**. To customize the routing, clone via "Save As New Flow" then save + activate the clone (`FlowDefinition` PATCH `{Metadata:{activeVersionNumber:N}}`); if the packaged orchestrator is fine unchanged, activate it in place via Flow Builder UI (managed FlowDefinition is not exposed to Tooling; the PATCH transport works only on an unmanaged clone). Do NOT invent a `referral-routing` orchestration from scratch.
269
+ - **If any packaged flow is missing** (zero `FlowDefinitionView` rows), that is a license/package gap — HALT and surface it; do NOT author a substitute.
270
+ - **`configure-patient-referral-expression-set` + `load-patient-referral-decision-table`** — the "update Clinical Service Request status" decision table has FOUR ordered columns — **THREE Inputs (`WorkType`, `CSRStatusReason`, `InsuranceStatus`; each with an ordered `sequence` 1..3)** mapping to **ONE Output (`CSRStatus`; OMITS `sequence`)**. CSR Status is the OUTPUT the table sets, NOT an input. Key the `CSRStatusReason` input rows and the `CSRStatus` output rows on the underscore API `fullName`s from steps 18/19 (not the display labels). **Predictive/urgency scoring is NOT this decision table** — it is a separate Data Cloud **Scoring Framework template** ("Referral Management Scoring") that writes back to CSR `Referral Score` (see step 25); do not conflate the two.
271
+ - **Transport:** `usageType` MUST be a value from `GET /connect/ruleengine/usage-types` — **`Bre`** (label "Default") is the general-purpose type; free-text guesses ("Decisioning") 400 "Value does not match expected type". Decision table needs BOTH `dataSpaceName` AND `parameters[]` (absent `parameters` → 500 NPE); `parameters[].dataType` ∈ `{Boolean,Currency,Date,DateTime,Number,Percent,String}` (NOT "Text"); `usage` ∈ `{Input,Output,RowCriteria}`; **Output fields must NOT carry a `sequence`**; requires the Decision Table permission; `type: LowVolume`, `sourceType: SingleSobject`, `sourceObject: ClinicalServiceRequest`, `dataSpaceName: 'default'`. Rows/data load follow via `postDecisionTableFile`/`postDecisionTableRows`; teardown via `deleteExpressionSet` / decision-table DELETE. (Transport rule 4a.)
272
+ - **`add-csr-status-picklist-values` + `add-csr-status-reason-picklist-values`** — required content, not merely gaps. The values below **FEED the decision-table rows** (step 17 — the `CSRStatusReason` values key the Input rows and the `CSRStatus` values fill the Output column). A setup that skips them leaves the routing decision table unmatchable.
273
+ - **CSR `Status` (`type=picklist`) — target values:** `New`, `Processing`, `Waiting for Response`, `Manual Review Needed`, `Rejected`, `Accepted`, `Scheduled`, `Completed`, `Closed-No Appointment`. The field ships with 7 FHIR values (`Draft`, `Active`, `On-Hold`, `Revoked`, `Completed`, `Entered-in-Error`, `Unknown`); add the referral values on top. **Stored API `fullName`s use underscores:** `New`, `Processing`, `Waiting_for_Response`, `Manual_Review_Needed`, `Rejected`, `Accepted`, `Scheduled`, `Closed_No_Appointment` (labels have spaces/hyphens).
274
+ - **CSR `StatusReason` (`type=multipicklist`, ships with ZERO values) — target values:** `Missing Information`, `Manual Required`, `Complex Work Type`, `Inactive Insurance`, `No Rule Match`, `Ready for Prior Authorization` — API `fullName`s `Missing_Information`, `Manual_Required`, `Complex_Work_Type`, `Inactive_Insurance`, `No_Rule_Match`, `Ready_for_Prior_Authorization`.
275
+ - **Transport:** a **`StandardValueSet` MDAPI deploy** — see Transport rule 3c for the full mechanics (SVS DeveloperNames `CServiceRequestStatus` / `CServiceRequestStatReason`; multipart-only so `dispatch` can't send it; retrieve-first-then-deploy-union; underscore `fullName`s; the silent-no-op traps). **ALWAYS verify a picklist write with a `describe` read-back.** `discover-clinical-service-request-picklists` (step 5) gives the baseline.
276
+ - **`assign-action-plans-permission-set`** — assigning the "Action Plans" permission set is only a PREREQUISITE. The full deliverable is **configuring + publishing the Referral Management Action Plan Template** (~18 tasks, including the **EBV + Prior Auth tasks** that invoke the account-team callback Apex — see `create-ebv-prior-auth-apex-classes`). Do NOT treat "perm set assigned" as "Action Plan configured." Transport for the prerequisite: Data API `PermissionSetAssignment` create (the "Action Plans" permission set → running admin). `DUPLICATE_VALUE` on the POST = already assigned = success. Reversible via DELETE.
277
+
278
+ ## Act 3 of 6 — Eligibility / Prior Auth / Predictive Scoring
279
+
280
+ > Act 3 EBV setup is a **Care Benefit Verification Settings** record (Apex handler + endpoint URI + Named Credential) with the **account-team-supplied** `EBVCallbackService` + `PACallbackHandler` Apex deployed as **guest-accessible Apex REST callback receivers** at `/services/apexrest/ebv/callback`; EBV and Prior Auth are triggered as **Action Plan tasks** (Infinitus payer API). It is NOT an Experience site. The MuleSoft FHIR NamedCredential (step 24) must be named `GFCCredentials`. Only the Data Cloud scoring data kit is a genuine external GAP.
281
+
282
+ | # | Step id | Purpose | Controller / API | Route |
283
+ |---|---|---|---|---|
284
+ | 22 | `create-ebv-prior-auth-apex-classes` | write | **Set up Eligibility and Benefits Verification & Prior Authorization** ([`hc_admin_referral_management_ebv_prior_auth_flow`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_ebv_prior_auth_flow.htm&type=5)). deploy the **account-team-supplied** `EBVCallbackService` + `PACallbackHandler` Apex as **guest-accessible Apex REST callback receivers** (`/services/apexrest/ebv/callback`) — do NOT author a fabricated `ReferralEbvPriorAuthService`. Transport: Tooling `ApexClass` POST for the supplied source | POST `/services/data/v67.0/tooling/sobjects/ApexClass` |
285
+ | 23 | `provision-ebv-callback-experience-site` | write | (same doc as step 22: [`hc_admin_referral_management_ebv_prior_auth_flow`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_ebv_prior_auth_flow.htm&type=5)) EBV has **no Experience site**. The EBV artifact is a **Care Benefit Verification Settings** record (Apex handler + endpoint URI + Named Credential) + guest-accessible Apex REST — configure Care Benefit Verification Settings, NOT `POST /connect/communities` | Care Benefit Verification Settings (see note) |
286
+ | 24 | `create-mulesoft-fhir-named-credential` | write | name MUST be exactly **`GFCCredentials`** (load-bearing — the packaged Generic FHIR Client "MuleSoft Direct" app binds this literal name), **legacy named credential, PASSWORD auth** (not Anonymous). `/headless/metadata` rejects `NamedCredential` (`UNSUPPORTED_OPERATION`, live-verified), so deploy via the Salesforce-CLI MDAPI fallback (Transport rule 0); placeholder endpoint, real host+password secrets external | `sf project deploy start` (MDAPI `namedCredentials/GFCCredentials.namedCredential`) — proven live; read-back via Tooling `NamedCredential` |
287
+ | 25 | `install-datacloud-referral-scoring-data-kit` | write | **Set up predictive scoring for referrals** ([`hc_admin_referral_management_predictive_scoring_setup`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_predictive_scoring_setup.htm&type=5)). *(GAP — external Data Cloud data kit; no cold-install route)* | — |
288
+
289
+ **Act 3 — notes (ordering & findings):**
290
+
291
+ - **`create-ebv-prior-auth-apex-classes`** — the EBV/Prior-Auth Apex is `EBVCallbackService` + `PACallbackHandler`, which are **account-team-supplied** (Infinitus integration), NOT hand-authored. They are deployed as **guest-accessible Apex REST callback receivers** at `/services/apexrest/ebv/callback` (so the payer's async EBV/PA response can post back), and EBV + Prior Auth are invoked as **Action Plan tasks** (see step 20's Action Plan Template). They ship from the account team, not the healthcloud package. Obtain the two classes, deploy via Tooling `ApexClass` POST `{Body:"<supplied source>"}` (→ 201; class *updates* need a `MetadataContainer` + `ContainerAsyncRequest`), then expose them as a guest Apex REST resource and grant the guest user access. If the supplied classes are unavailable → HALT and surface the dependency; do NOT author a substitute.
292
+ - **`provision-ebv-callback-experience-site`** — EBV has NO Experience Cloud site. The EBV callback is a **guest-accessible Apex REST endpoint** (`/services/apexrest/ebv/callback`, backed by `EBVCallbackService` from step 22), not a community/site. The EBV configuration is a **Care Benefit Verification Settings** record that ties together the Apex callback handler, the callback **endpoint URI**, and the **Named Credential** (step 24, `GFCCredentials`). **Configure the Care Benefit Verification Settings record**; do NOT `POST /connect/communities` here (that cold-create transport is valid, but it's used for the guest portal in step 31).
293
+ - **`create-mulesoft-fhir-named-credential`** — the Named Credential MUST be named exactly `GFCCredentials` and use PASSWORD authentication. The name is **load-bearing** — the packaged Generic FHIR Client "MuleSoft Direct" app looks up this exact developer name; a differently-named credential is invisible to it. It is a **legacy named credential** with username/password auth to the MuleSoft FHIR endpoint, NOT Anonymous/NoAuthentication. Transport: `/headless/metadata` rejects `NamedCredential` — `POST type:NamedCredential` returns `400 UNSUPPORTED_OPERATION "MetadataCrud does not support CREATE on type: NamedCredential"` (live-verified). **The working transport is a Salesforce-CLI MDAPI deploy** (Transport rule 0), proven live: build `namedCredentials/GFCCredentials.namedCredential` (`<protocol>Password</protocol>`, endpoint, principal) + `package.xml`, `sf project deploy start --metadata-dir <dir>` (verified live — the deploy creates the credential where the `/headless/metadata` POST cannot), then read-back via Tooling `NamedCredential`. A **placeholder endpoint** is OK — the real MuleSoft FHIR host + password secrets remain an external step, but the platform credential artifact is created.
294
+ - **`install-datacloud-referral-scoring-data-kit`** — GAP (external_dependency): installing a Data Cloud data kit requires the Data Cloud provisioning surface + a packaged kit artifact; not a Setup metadata/Connect write reachable via `dispatch`. No cold-install route.
295
+
296
+ ## Act 4 of 6 — Outreach + Appointment Sync
297
+
298
+ > Act 4 covers outbound-engagement component placement (step 26) and appointment sync. **Step 26 places the Outbound Engagement component (`runtime_ime_distribution:distributionComponentWrapper`) on the Home page and sets its `outboundEngagementTemplates` property — via MDAPI FlexiPage deploy, not `dispatch`.** Referral outreach is NOT Marketing Cloud (SFMC): the **Referral Outreach Patient & Provider flows** are CORE App-template flows deployed UNMANAGED once a campaign is created from the Referral Management template — in-platform, deployable via the Metadata API (Salesforce CLI), and activatable via the step-27 activation contract (the email-only flow activates headlessly; the SMS-bearing flow additionally needs an out-of-band SMS sender code).
299
+
300
+ | # | Step id | Purpose | Controller / API | Route |
301
+ |---|---|---|---|---|
302
+ | 26 | `place-outbound-engagement-home-component` | write | **Configure patient & provider outreach** ([`hc_admin_referral_management_configure_patient_provider_outreach_template`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_configure_patient_provider_outreach_template.htm&type=5)). Place the **Outbound Engagement** component (`runtime_ime_distribution:distributionComponentWrapper`) on the target Home page and set its **`outboundEngagementTemplates`** property to the referral templates. Transport: FIRST attempt a **whole-page read-modify-write `/headless/metadata` PUT** (GET the full Home FlexiPage, add the `runtime_ime_distribution:distributionComponentWrapper` region + templates, PUT the whole record back). A live check bound this class of standard industries component via whole-page PUT (patientCard/timeline); this specific component was not individually re-verified, so **fall back to an MDAPI FlexiPage deploy** (Salesforce CLI — see the execution-policy notes) only if a read-back shows the component dropped | MDAPI `FlexiPage` deploy — `componentName: runtime_ime_distribution:distributionComponentWrapper`, region `top` |
303
+ | 27 | `configure-marketing-cloud-outreach` | write | (same doc as step 26: [`hc_admin_referral_management_configure_patient_provider_outreach_template`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_configure_patient_provider_outreach_template.htm&type=5)) The **Referral Outreach Patient & Provider flows** are CORE App-template flows deployed UNMANAGED by the ReferralManagement App template once a campaign is created from the Referral Management template — NOT managed packaged flows (no clone needed) and NOT SFMC. Both ship `InvalidDraft`. Activation contract (retrieve/deploy as MDAPI `.flow`, atomic per deploy → one flow per package): (1) bind Communication Subscription + channel-type Id on each `sendEmailMessage` AND `sendSmsMessage` action, (2) set a valid email `senderId` (the authed User Id works, send-as-user), (3) publish campaign content via `POST /connect/cms/contents/publish`, (4) map required content-schema fields (`patientName`/`providerName`/`visitType`), (5) SMS-bearing flow additionally needs an out-of-band SMS sender code (registered `Text` MessagingChannel), (6) set `status` Active / PATCH `FlowDefinition`. Steps 1–3,6 headless; 4 metadata; 5 out-of-band | retrieve → bind subscription + senderId + publish + map schema → activate `ReferralOutreach{Patient,Provider}` (`FlowDefinition`) |
304
+ | 28 | `enable-appointment-sync` | write | Toggles patient appointment-scheduling settings (body `{value:true}`) | PATCH `/headless/invoke/platform/patient-appointment-scheduling-settings/handle-patient-appointment-scheduling-toggle` (proposed) |
305
+ | 29 | `verify-appointment-sync` | verify | Reads the patient appointment-scheduling preference | GET `/headless/invoke/platform/patient-appointment-scheduling-settings` (proposed) |
306
+
307
+ **Act 4 — notes (ordering & findings):**
308
+
309
+ - **`place-outbound-engagement-home-component`** (the first step of Act 4) — the "Outbound Engagement" component an admin drags in Lightning App Builder is **`runtime_ime_distribution:distributionComponentWrapper`**. **Do NOT confuse it with `runtime_ime_distribution:outboundHomePage`** (masterLabel "Outbound Engagement Home") — that is a *different* component with no design properties; the wrapper is the one that carries the template property.
310
+ - **Template selection = the `outboundEngagementTemplates` design property**, a **multi-value list of `OutboundEngagementTmplView` DeveloperNames** (NOT 18-char record Ids, NOT external Ids). For Referral Management the two values are **`AppointmentManagement_HomePage`** and **`ReferralManagement_HomePage`**.
311
+ - **Transport: FIRST attempt a whole-page read-modify-write `/headless/metadata` PUT** — GET the full `FlexiPage:<name>`, add the component region + templates to the retrieved record, and PUT the ENTIRE record back via project-codey `execute_api` (JSON body: `type:"FlexiPage", fullName, xmlRep`). A live verification bound standard industries components this way (Patient Card / Timeline); the earlier "silently drops" reports were an artifact of *partial-page* PUTs. This specific component was not individually re-verified, so **fall back to an MDAPI `FlexiPage` deploy via the Salesforce CLI** (concrete command in the execution-policy notes) only if the read-back shows the component did not persist. Always **gate on a read-back** (retrieve `FlexiPage:<name>` again → confirm `<componentName>` + both `<valueListItems>` persisted) — any transport can report success while silently failing to persist, so the read-back is the only proof.
312
+ - **HomePage FlexiPage shape:** `template` = `home:desktopTemplate`, regions `top`/`bottomLeft`/`bottomRight`/`sidebar`; place the wrapper in region `top`. Example item instance:
313
+ ```xml
314
+ <componentInstance>
315
+ <componentInstanceProperties>
316
+ <name>outboundEngagementTemplates</name>
317
+ <valueList>
318
+ <valueListItems><value>AppointmentManagement_HomePage</value></valueListItems>
319
+ <valueListItems><value>ReferralManagement_HomePage</value></valueListItems>
320
+ </valueList>
321
+ </componentInstanceProperties>
322
+ <componentName>runtime_ime_distribution:distributionComponentWrapper</componentName>
323
+ <identifier>runtime_ime_distribution_distributionComponentWrapper</identifier>
324
+ </componentInstance>
325
+ ```
326
+ - **Target page:** any Home page opened in App Builder (e.g. `Marketing_CRM_Classic_Home`; the standard Sales-app home is `Home_Page_Default`). **Two things MDAPI can't do:** (1) assign the FlexiPage as a *standard* app's Home (e.g. `standard__Marketing` exposes only `<defaultLandingTab>`, no FlexiPage element — UI-only "Activation → Assign to Apps"); (2) the component-access gate — placement requires **Distribution component access** (granted when Industries outbound engagement is enabled for the org); enable the backing Outbound Engagement feature first.
327
+ - **Prereqs (upstream, not this step):** Marketing Cloud Engagement enablement lives on the UMA setup page (`UmaMarketingCloudEngagement`); the template-driven engagement *creation* runtime is the `postOutboundEngagement` Connect API (`otbdEngmtTmplViewExternalId`), a separate, `dispatch`-callable action — NOT component placement.
328
+ - **`configure-marketing-cloud-outreach`** — referral outreach is NOT Marketing Cloud (SFMC). The two outreach flows — **Referral Outreach Patient** and **Referral Outreach Provider** — are **CORE App-template flows** (`ReferralOutreachPatient` / `ReferralOutreachProvider`, shipped in the platform's Referral Management app template), deployed **UNMANAGED** (subscriber-owned) by a `FlowDefinitionUpsert` node in the "Referral Management Emails and SMS" App template (name `ReferralManagement`), which also `ManagedContentUpsert`-creates their email/SMS content. They **materialize once an admin creates a campaign from the Referral Management template**. Both are `AutoLaunchedFlow`, record-triggered (`IndivRelatedRecord`) on `ClinicalServiceRequest`, and drive email/SMS via IME distribution `sendEmailMessage`/`sendSmsMessage` actions. Because they are unmanaged, they surface in Tooling and ARE retrievable/deployable via the `sf` CLI — **no clone needed** (unlike the managed clone-first path for CreateReferral/CreateCaseUpdateCSR).
329
+ - **PREREQ entitlements:** IME Content Distribution / Industries Outbound Engagement + Communication Subscription (consent) framework + at least one Data Cloud MarketSegment — the same gate as `place-outbound-engagement-home-component`.
330
+ - **TRANSPORT:** retrieve/edit/deploy the flows as **MDAPI `.flow` files** (retrieve the flows via the Salesforce CLI into `unpackaged/flows/<ApiName>.flow`; edit XML; deploy the metadata directory back — concrete commands in the execution-policy notes). **NOT** `.flow-meta.xml` (that is the source-format filename; MDAPI uses `.flow`). An MDAPI deploy is **atomic per deploy** — if one flow fails validation the whole deploy rolls back, so **deploy each flow in its OWN package** to activate the good one independently of a blocked sibling. **Label/API-name are cross-wired in the shipped template**: file `ReferralOutreachPatient_<hash>.flow` carries `<masterLabel>Referral Outreach Provider</masterLabel>` and vice-versa — match on `masterLabel`, not the filename.
331
+ - **ACTIVATION CONTRACT** — both flows ship `<status>InvalidDraft</status>`:
332
+ 1. **Bind Communication Subscription** — each `sendEmailMessage` AND `sendSmsMessage` action carries two empty inputs, `communicationSubscriptionId` + `commSubscriptionChannelTypeId`; inject a `CommSubscription` Id + a `CommSubscriptionChannelType` Id as `<value><stringValue>ID</stringValue></value>`. Discover with `SELECT Id, Name FROM CommSubscription` / `SELECT Id, Name FROM CommSubscriptionChannelType`. This binding clears the shipped InvalidDraft cause.
333
+ 2. **Set the email `senderId` (From address)** — each `sendEmailMessage` action needs a `senderId` input pointing at a valid, **active** email From address, else the deploy fails with `Select a valid From address.` **The authed running-User Id works directly** (`senderId = <UserId>`, send-as-user). A `SenderEmailAddress` record is the alternative, but it requires an **active** `EmailDomainKey` (DKIM CNAME published in DNS) — an unverified domain stays `Status=Inactive` and is rejected, and `EmailDomainKey.IsActive` is read-only. So use the User Id unless the org has a DKIM-verified sending domain.
334
+ 3. **Publish content** — the send actions reference ManagedContent (`contentId` MC-keys); Draft content fails the deploy with `We can't send unpublished content.` Use `POST /connect/cms/contents/publish` with `{contentIds:[...], contentSpaceOrFolderId:"<contentSpaceId>"}`. Publish **every** `contentId` referenced by **both** flows (the two reference different content sets).
335
+ 4. **Map content-schema fields** — the published content schema requires merge fields `patientName`, `providerName`, and `visitType`; an unmapped one fails the deploy with `Enter a value for the Content Schema.<field> input parameter.` The template ships only a single `contentSchemaParameter` (→ `GetPatientName.Name`); add a `<transformValueActions>` `Map` block for each required field on **every** `contentSchemaParameter` block whose published schema demands it (e.g. `providerName` → `elementReference` `GetRequesterName.Name`).
336
+ 5. **SMS sender code (OUT-OF-BAND — blocks the SMS-bearing flow)** — a flow containing `sendSmsMessage` actions additionally fails activation with `Select a valid sender code.` The `sendSmsMessage` action (E360 `SendSmsAction`) takes a `senderId` input; at activation the validator requires that `senderId` point at a **`MessagingChannel` record whose `ChannelProviderStatus == ACTIVE` AND `MessageType == TEXT`** (a carrier-registered 10DLC number / short code, assigned to the business unit). There is **no headless API** to provision such a channel. The registration path is the **E360 SMS Connect surface** (`/connect/e360sms/{brands,codes,campaigns,compliance/management}`, node `e360-sms-messaging`), which sits behind an E360 SMS license **and Data Cloud / CDP tenant provisioning**. On an org without the E360 SMS tenant the SMS flow cannot be activated at all. **The email-only flow ("Referral Outreach Provider") activates fully via 1–4; the email+SMS flow ("Referral Outreach Patient") stays `InvalidDraft` until a `Text`+`ACTIVE` `MessagingChannel` (sender code) exists.**
337
+ 6. **Activate** — once its applicable prerequisites are satisfied, set `<status>Active</status>` in the flow XML and redeploy (Metadata API activates on deploy) OR PATCH `FlowDefinition {Metadata:{activeVersionNumber:N}}` once the flow is a valid Draft.
338
+ - **NET:** steps 1, 2, 3, 6 are fully headless (`sf` CLI / Connect API). Step 4 is metadata-doable but content-schema-dependent. Step 5 (SMS sender code) is out-of-band org provisioning. Do NOT wire SFMC connection secrets, and do NOT create throwaway `SenderEmailAddress`/`EmailDomainKey` records for an unverifiable domain — use the authed User as sender.
339
+ - **`enable-appointment-sync`** — the referral↔appointment status sync is the packaged "Synchronize Appointment and CSR Statuses" flow (activate it) + the Healthcare Appointment Scheduler component on the CSR Lightning record page (one of the four FlexiPage components from step 6). **Intelligent Appointment Management (IAM) is a SEPARATE product** — this Aura toggle turns on IAM's appointment-scheduling settings, a prerequisite/adjacent capability, NOT the referral status-sync mechanism itself. Do NOT treat flipping this one toggle as "referral appointment sync is done": also **activate the packaged "Synchronize Appointment and CSR Statuses" flow** and **place the Healthcare Appointment Scheduler component** on the CSR record page. Transport for the toggle: PATCH body `{value:true}` → 200 (empty success body); verify via step 29. Reversible. (The un-prefixed `/headless/metadata IndustriesSettings` equivalent 404s — see Transport rule 3.) The GET read-back returns a BARE BOOLEAN SCALAR (`true` when enabled), not a pref map — gate on `body == true`.
340
+
341
+ ## Act 5 of 6 — External document intake (Create Referrals from Inbound Documents / Document AI for Health)
342
+
343
+ > Act 5 is **Create Referrals from Inbound Documents** ([`hc_admin_referral_management_process_received_document`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_process_received_document.htm&type=5)): transform documents received by **email and fax** into Clinical Service Requests using **Intelligent Document Automation** + the **Process Received Document** invocable action — NOT "Einstein Document Reader" and NOT an external fax provider. The documented setup runs on the **Public Health Settings** guided setup in a **strict order**: (1) enable the **Disease Surveillance** org preference — which is what *surfaces* the "Set Up Document AI for Health" guided setup — then (2) complete the Document AI for Health guided setup, then (3) turn on **Batch Document AI for Health**, then (4) build the intake automation (queues + record-triggered flows + the Process Received Document invocable), then (5) grant field access. The two org-preference toggles (Disease Surveillance, Batch Document AI) ARE live-dispatchable via the MCP; the guided-setup / IDP extraction-definition authoring, the flow/queue wiring, and the **Agentforce for Health Cloud add-on** license are the gaps.
344
+
345
+ | # | Step id | Purpose | Controller / API | Route |
346
+ |---|---|---|---|---|
347
+ | 30 | `prepare-external-referral-fax-intake` | write (multi-part) | **Create Referrals from Inbound Documents** — enable the Disease Surveillance org pref (surfaces the Document AI for Health guided setup), set up Document AI for Health, turn on Batch Document AI for Health, then wire the **Process Received Document** intake automation. See the 5-part procedure in the notes. | Public Health Settings set-preference + Batch Intelligent Doc Extract pref + Document AI guided setup + record-triggered flows/queues (mixed live + GAP) |
348
+
349
+ **Act 5 — notes (ordering & findings):**
350
+
351
+ - **`prepare-external-referral-fax-intake`** — per **Create Referrals from Inbound Documents** ([`hc_admin_referral_management_process_received_document`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_process_received_document.htm&type=5)), referral fax/email intake runs on **Intelligent Document Automation** + the **Process Received Document** invocable action — do NOT wire an external fax service. **The corpus einstein `document-reader/toggle-einstein-doc-reader-pref` (and `einstein-doccapture/toggle-document-reader-pref`) route is a *different* feature ("Einstein Doc Reader") — it is NOT the documented enable path for referral document intake; do not use it here.** Follow the documented setup in order:
352
+
353
+ - **PART 1 — enable the Disease Surveillance org preference FIRST (it surfaces the Document AI for Health guided setup).** Per **Set Up Document AI for Health** ([`hc_admin_disease_surveillance_set_up_pdf_ingestion_idp`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_disease_surveillance_set_up_pdf_ingestion_idp.htm&type=5)), Document AI for Health is configured from the **Public Health Settings** page guided setup, and per **Enable Disease Surveillance** that guided setup only appears once the **Disease Surveillance** preference is turned on (Setup → **Public Health Settings** → turn on **Disease Surveillance**). This preference is **live-dispatchable**: PATCH `/headless/invoke/platform/public-health-settings/set-preference` body `{orgPref:"diseaseSurveillancePref", value:true}` (returns the boolean set; Customize Application gate; enabling publishes Product Feature Telemetry). **Gate on an INDEPENDENT read-back — never the write echo:** GET `/headless/invoke/platform/public-health-settings/get-preference?orgPref=diseaseSurveillancePref` → `true`. Reversible, **but note disabling `diseaseSurveillancePref` while `diseaseCaseClassificationPref` is on disables BOTH atomically**. The four allowlisted Public Health prefs (`diseaseSurveillancePref`, `diseaseCaseClassificationPref`, `healthCloudGenAIPref`, `deDupeForDSPref`) live on the [[PublicHealthSettings]] node.
354
+ - **PART 2 — Set Up Document AI for Health (guided setup on Public Health Settings).** In Setup → **Public Health Settings**, follow the guided setup to Set Up Document AI for Health (automates PDF/fax data extraction and maps it to Health Cloud objects). **License:** requires the **Agentforce for Health Cloud add-on** (Enterprise/Unlimited + Health Cloud). **Perm sets (per the doc):** **Health Cloud Foundation** + **Disease Surveillance** + **Data Cloud Architect** + **Document AI for Health** + **Context Service Admin**.
355
+ - **FIRST — verify/assign the `Document AI for Health` permission set to the running user (precondition for the guided setup).** API name **`AgentforceDiseaseSurveillanceIDP`** (namespace `force`). Without it the running identity can't author or run the Document AI extraction setup. **Read it back first** — `SELECT Id FROM PermissionSetAssignment WHERE Assignee.Id = '<running user>' AND PermissionSet.Name = 'AgentforceDiseaseSurveillanceIDP'` (the `Name` is un-namespaced with a separate `PermissionSet.NamespacePrefix = 'force'` column — same convention as `FlowDefinitionView.ApiName`; do NOT query `force__AgentforceDiseaseSurveillanceIDP`) — and **assign it only if missing** via Data-API `PermissionSetAssignment` create (`POST /services/data/v67.0/sobjects/PermissionSetAssignment` `{PermissionSetId, AssigneeId}`; `DUPLICATE_VALUE` = already assigned = success — same mechanics as step 20). If the perm set itself doesn't exist on the org, that's the **Agentforce for Health Cloud add-on** license gap (below) → surface it and HALT this part. The sibling perm sets in the doc list (Disease Surveillance, Data Cloud Architect, Context Service Admin, Health Cloud Foundation) follow the same read-back-then-assign pattern.
356
+ - The guided-setup / IDP extraction-definition authoring (document types, extraction models, field mappings) is a Setup-UI / IDP-designer task — see the [[IntelligentDocExtract]] companion node (document-extraction-definition templates + flows) — with no single `dispatch` write, so surface it as a UI step; do NOT fabricate a call. **GAP (`entitlement_missing`) when the add-on license is absent** — the guided setup cannot complete without it; surface, license Agentforce for Health Cloud, then re-run.
357
+ - **PART 3 — turn on Batch Document AI for Health.** Per **Set Up Document AI for Health for Referral Management**, once Document AI for Health is set up, turn on batch processing (Setup → **Batch Document AI for Health**). **Live-dispatchable:** PATCH `/headless/invoke/industries/industries-healthcare/batch-intelligent-doc-extract-setup-page/set-preference` `{orgPref:<batch pref>, value:true}` (Customize Application gate). **Discover the exact `orgPref` key via** GET `.../batch-intelligent-doc-extract-setup-page/get-preference` (do NOT hardcode it), set the batch source content folder via PATCH `.../batch-intelligent-doc-extract-setup-page/save-folder-selection {contentFolderId}`, and gate on the GET read-back.
358
+ - **PART 4 — build the intake automation (Process Received Document).** Per the main article, the **Process Received Document** invocable action uses text extracted from received documents to populate patient details and the requested procedure/diagnostic service. Build the workflow: (a) create a **queue for newly received documents** and another **queue for documents that have had their data extracted**; (b) a **record-triggered flow** that moves newly received documents to the received-documents queue; (c) a second **record-triggered flow** that moves extracted documents to the processed-documents queue — **when a `ReceivedDocument.OcrStatus` change triggers this flow, include a Run Asynchronously path** (per the doc, this guards against errors in the background Process Received Document run). Record-triggered flows are Tooling `Flow`-creatable (Transport rule 4), but the queue routing + invocable wiring is flow-designer work — surface as a UI/metadata step (see the doc's "Sample of Automated Document Queues"); do NOT fabricate a call.
359
+ - **PART 5 — grant field access.** Per the main article, make sure users who manage referrals have access to the **`IsAccepted`** field on the **Clinical Service Request** object (FLS via permission set / profile).
360
+ - **Net:** Parts 1 and 3 (the Disease Surveillance pref + the Batch Document AI toggle) are live-dispatchable and MUST each be gated on their read-back; Part 2's guided Document AI setup is license-gated (Agentforce for Health Cloud add-on) + Setup-UI; Part 4's flows/queues/invocable wiring is flow-designer; Part 5 is FLS. Do NOT wire an external fax provider, and do NOT use the einstein doc-reader toggle.
361
+
362
+ ## Act 6 of 6 — Public referral portal (Experience Cloud + reCAPTCHA + Web-to-Case + OmniScript + guest owner)
363
+
364
+ > **This act follows the documented "Provide a Secure Referral Form to Guest Users" flow, whose canonical UI entry point is the Referral Management Settings page's guided setup.** The docs prescribe FIVE ordered phases (see the notes): **A** get the org ready (Person Accounts + OmniStudio, permission assignments, the **Guest Referral permission set**, enable Digital Experiences, register the site domain, add Google as a Trusted URL, and on the RM Settings page turn on **Require reCAPTCHA Verification** + **Assign Owner**); **B** build the site on the **Build Your Own (Aura)** template (public access → guest-profile record types/object perms → Security & Privacy CSP → trusted sites → activate); **C** set up reCAPTCHA (Google sign-up → turn on Web-to-Case → the Web-to-Case HTML Generator registers the key pair); **D** customize the **Create Referral OmniScript** (New Version → set `captchaSiteKey` + `captchaKeyPairName` → activate); **E** finish the site (assign the guest perm set + sharing rules + guest file uploads → add reCAPTCHA head markup → add the OmniScript component → publish). The live-dispatchable writes are the **Require reCAPTCHA Verification** toggle (step 32; see the HC silent-no-op caveat), the **guest referral record owner** (steps 38–39), and the **site cold-create** (step 31). The Google reCAPTCHA key, Web-to-Case HTML, Experience-Builder site config, sharing rules, head markup, and OmniScript authoring are external/manual GAPS. Analytics enablement (step 37) is PARTIAL (Phase 1 base CRM Analytics; Phase 2 requires a provisioned template) and orthogonal to these docs. Run per the `portal_scope` decision.
365
+
366
+ | # | Step id | Purpose | Controller / API | Route |
367
+ |---|---|---|---|---|
368
+ | 31 | `provision-referral-experience-cloud-site` | write | `POST /connect/communities` with the **Aura** Build-Your-Own template — its exact `templateName` is **`"Build Your Own"`** (the Aura variant carries NO suffix; only the LWR variant is `"Build Your Own (LWR)"`). Aura ships the OmniScript component the guest form needs — NOT "Customer Service"/LWR. `{name, templateName, urlPathPrefix}` → 202 + async `SiteTaskCreate` | POST `/services/data/v67.0/connect/communities` |
369
+ | 32 | `enable-captcha-verification` | write | Toggles Require reCAPTCHA Verification (body `{value:true}`) | PATCH `/headless/invoke/platform/referral-management-settings/handle-captcha-verification-toggle` (proposed) |
370
+ | 33 | `verify-captcha-verification` | verify | Reads the Referral Management settings → `isCaptchaVerificationEnabled` | GET `/headless/invoke/platform/referral-management-settings` (proposed) |
371
+ | 34 | `register-recaptcha-site-key` | write | *(GAP — Google reCAPTCHA v2 sign-up; **Domain = your guest site URL**; capture Site Key + Secret Key)* | — |
372
+ | 35 | `generate-web-to-case-html` | write | *(GAP — manual UI: turn on Web-to-Case, then Web-to-Case HTML Generator registers the reCAPTCHA key pair → `captchaKeyPairName`)* | — |
373
+ | 36 | `activate-create-referral-omniscript` | write (clone packaged) | CLONE the packaged `HealthCloudReferral/CreateReferral` OmniScript, set **`captchaSiteKey` + `captchaKeyPairName`**, then activate. Do NOT create an empty shell with a colliding `uniqueName`. **PRECONDITION: confirm the packaged script is present via `GET /connect/omni-designer/os/get-scripts` (type `HealthCloudReferral`, subType `CreateReferral`) — it usually ships file-based, so an empty `OmniProcess` table does NOT mean it is missing; content-blocked only if `get-scripts` lacks it too (see step note).** Stays manual: Core's clone resource is designer-internal (not served) and the captcha-property write is unverified. | `get-scripts` discovery + OmniStudio designer clone/activate |
374
+ | 37 | `enable-referral-management-analytics` | write | Phase 1 enable CRM Analytics; Phase 2 the analytics app auto-install (`templateApiName`, `appName`, `params`) | PATCH `.../insights-setup-getting-started/enable`; PATCH `.../health-cloud-admin-feature-setup/send-auto-install-request` (proposed) |
375
+ | 38 | `read-guest-referral-record-owner-candidates` | read | Reads the Salesforce-licensed users eligible to own guest referrals | GET `/headless/invoke/industries/industries-healthcare/owner-id-setup/get-salesforce-licensed-users` (proposed) |
376
+ | 39 | `set-guest-referral-record-owner` | write | Saves the guest referral record owner (body `{ownerId}`) | PATCH `/headless/invoke/industries/industries-healthcare/owner-id-setup/save-owner` (proposed) |
377
+
378
+ **Act 6 — notes (documented procedure, ordering & findings):**
379
+
380
+ **The documented flow ("Provide a Secure Referral Form to Guest Users") runs in FIVE ordered phases (A→E below), and the canonical UI entry point is the Referral Management Settings page's guided setup** (Setup → **Referral Management Settings** → *"follow the guided setup steps to set up your Experience Cloud site, set up reCAPTCHA, and install and configure the Create Referral OmniScript"*). The executable table steps are called out by number inside each phase.
381
+
382
+ - **PHASE A — Get your org ready** ([`hc_admin_referral_management_guest_users_org_ready`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_org_ready.htm&type=5)). (1) Confirm **Person Accounts** on (Act 0 prereq) and **OmniStudio** present — for HC this is the **standard/metadata** mode (**OmniStudio Metadata ON + Managed Package Runtime OFF**; Prereqs §A / Act 0 `check-omnistudio-runtime`), even though the doc phrases it as "install the OmniStudio managed package." (2) Assign user permissions: **Customize Application** (web-form editors), **OmniStudio Admin** (OmniScript editors), **Create and Set Up Experiences** + **View Setup and Configuration** (site builders). (3) Create the **Guest Referral permission set** — Label "Guest Referral Permission Set", **License = OmniStudio**; enable the system permission *"Enables admin/developer to create new OS/DR/VIP instances"*; grant **Read** (object + all fields) on **Omni Processes** AND **Omni Process Compilations**. (4) Enable **Digital Experiences** (Setup → Digital Experiences → Settings → Enable Digital Experiences — itself dispatchable via the `CommunitiesSettings` metadata write; the `Network` sObject becoming queryable is the on/off probe), select **"Hide badges from guest users in Experience Builder sites"**, then under **Sites** register your Salesforce Site domain and select **"Allow using standard external profiles for self-registration, user creation, and login."** (5) Add **Google as a Trusted URL** (Setup → Trusted URLs → New: API Name `Google`, URL `https://www.google.com`, select **all** CSP Directives) — this is the ORG-level Trusted URL, distinct from the site-level Trusted Sites in Phase B. (6) On the **Referral Management Settings** page turn on **Require reCAPTCHA Verification** (step 32) and click **Assign Owner** (steps 38–39). (7) Then use that page's **guided setup** to drive Phases B–E.
383
+ - **`enable-captcha-verification` (step 32) → `verify-captcha-verification` (step 33)** — this is the **"Require reCAPTCHA Verification"** control on the **Referral Management Settings** page (its "Experience Cloud Settings" surface). Aura route PATCH `.../referral-management-settings/handle-captcha-verification-toggle {value:true}` → 200; verify GET `.../referral-management-settings` → `isCaptchaVerificationEnabled:true`. It enables **server-side captcha enforcement** — the reason `postGuestReferral` then requires a `captchaToken` (runtime step 41 / C1). **HC caveat:** the backing pref is the industries captcha-verification preference (`IndustriesSettings.enableIndustriesCaptchaVerification`); the `ReferralManagementSettings` node's recipe flags that the Aura toggle **can silently no-op behind a Health-Cloud gate** — so if the step-33 read-back doesn't flip, fall back to the Metadata master transport (Transport rule 3): PUT `/services/data/v67.0/headless/metadata {type:"IndustriesSettings", fullName:"IndustriesSettings", xmlRep:"<IndustriesSettings><enableIndustriesCaptchaVerification>true</enableIndustriesCaptchaVerification></IndustriesSettings>"}` (partial-body merge), then re-verify via `readMetadata`. This toggle is ONE piece, not the whole reCAPTCHA wiring — Phases C + E complete it. Reversible.
384
+ - **`read-guest-referral-record-owner-candidates` → `set-guest-referral-record-owner`** — the GET returns `List<UserInfo>{id, name, email, profileName, selected}` (Salesforce-licensed users eligible to own guest-created referrals; the User Id field is named `id`, NOT `userId`); the PATCH body is `{ownerId:<id>}` (the chosen element's `id`) → void 200. the save operation throws `'OwnerId is invalid'` if `ownerId` is blank/invalid, so pick a real `id` from the read (the currently-set owner shows `selected:true`). This sets the guest referral record owner value, for which there is no Metadata/Connect/Tooling equivalent — the Aura `save-owner` route is canonical.
385
+ - **PHASE B — Build the guest referral site** ([`hc_admin_referral_management_guest_users_site_build`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_site_build.htm&type=5)) → **`provision-referral-experience-cloud-site` (step 31)** plus its Experience-Builder config. Use the AURA Build-Your-Own template, NOT `"Customer Service"` — only the Aura template hosts the OmniScript (OmniStudio) Lightning component the guest Create Referral form is embedded into; an LWR/Customer-Service site cannot render it and the form will not appear. **UI label vs API:** Experience Builder labels it *"Build Your Own (Aura)"*, but the Connect API `templateName` is the un-suffixed **`"Build Your Own"`** (`"Build Your Own (Aura)"` 400s `INVALID_INPUT "The specified template does not exist."`; only the LWR variant carries a suffix, `"Build Your Own (LWR)"`). **Do NOT hardcode the string blind — enumerate `GET /services/data/v67.0/connect/communities/templates` first and match the Aura BYO entry**, since the exact label is org/version-sensitive. Cold-create: `POST /connect/communities {name, templateName:"Build Your Own", urlPathPrefix:"referrals"}` → **202** `{jobId}` (async); poll `BackgroundOperation` by the jobId → `Status:Complete, Type:SiteTaskCreate`; the `Network` row then exists (`Status:UnderConstruction`). Requires Digital Experiences enabled (Phase A; independently confirmable — the `Network` sObject is queryable). Transport rule 4. **Then finish the site in Experience Builder (UI, no headless route — surface as manual):** (a) **General Settings → enable Public Access** (creates the Guest Referral Site guest user profile + guest user); (b) on the **guest user profile**, Record Type Settings → Accounts → add **Person Account** and set it as **Default Record Type**, and Standard Object Permissions → **Accounts: Read + Create**, **Code Sets: Read**; (c) **Security & Privacy** → Clickjack Protection = **"Allow framing by the same origin only"**, Security Level = **"Relaxed CSP: Permit Access to Inline Scripts and Allowed Hosts"**; (d) add **Trusted Sites** `Google` = `https://www.google.com` and `gstatic` = `https://www.gstatic.com` (both Active) — these two site-level Trusted Sites let the reCAPTCHA widget load, distinct from the org Trusted URL (Phase A) and from the Google reCAPTCHA *registered domain* (Phase C); (e) **Activate** the site (Administration workspace → Activate). Copy the site URL — Phase C needs it for reCAPTCHA sign-up. Publishing Live is a Phase E follow-on.
386
+ - **PHASE C — Set up reCAPTCHA** ([`hc_admin_referral_management_guest_users_recaptcha`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_recaptcha.htm&type=5)) → **`register-recaptcha-site-key` (step 34)** + **`generate-web-to-case-html` (step 35)**; both external/manual GAPS. **(1) Sign up for reCAPTCHA (Google console):** the reCAPTCHA type MUST be **reCAPTCHA v2, "I'm not a robot" Checkbox (Challenge)** — NOT v3 (score-based) and NOT the invisible/Enterprise variants (the guest OmniScript widget expects the v2 checkbox challenge). **For Domain, enter the URL of your guest referral Experience Cloud site** (the site from Phase B) — *NOT* `google.com`/`gstatic.com`. (Those two are added elsewhere: as site-level **Trusted Sites** in Phase B step (d) and Google as an org-level **Trusted URL** in Phase A step (5); a prior version of this skill wrongly listed them as the Google reCAPTCHA domains.) Register → receive a public/private key pair; copy the **Site Key** (→ OmniScript `captchaSiteKey`, Phase D) and **Secret Key** into a text file — both are needed by the Web-to-Case HTML Generator. **(2) Turn on Web-to-Case** (Setup → Web-to-Case → enable) — a precondition for the generator. **(3) Generate a Web Form with reCAPTCHA Verification** (Setup → **Web-to-Case HTML Generator**): keep **"Include reCAPTCHA in HTML"** selected; next to **reCAPTCHA API Key Pair** click the lookup → **New**, enter a **nickname** + the Google Site/Secret keys, and **Save** — this **registers the key pair on the Salesforce platform, and that nickname IS the `captchaKeyPairName`** used in the OmniScript (Phase D). Click **Generate**, copy the HTML, click Finished. Manual/UI-only — surface both key values + the nickname to the admin.
387
+ - **PHASE D — Customize the Create Referral OmniScript** ([`hc_admin_referral_management_guest_users_omniscript_configure`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_omniscript_configure.htm&type=5)) → **`activate-create-referral-omniscript` (step 36)**. Requires the **OmniStudio Admin** permission set and **standard OmniStudio** (OmniStudio Settings → **OmniStudio Metadata ON, Managed Package Runtime OFF**; Act 0 `check-omnistudio-runtime` / `standardOmniStudioRuntime` ON). The Create Referral OmniScript ships as the **`HealthCloudReferral` / `CreateReferral`** OmniScript (`Type=HealthCloudReferral`, `SubType=CreateReferral`, language Multi-Language, name "Create Referral"). **PRECONDITION — find the packaged script before cloning.** It typically ships **file-based** (`isFileBasedScript:true`, `isActive:false`, from the `healthcloud_referral_flows` content), so it is NOT an `OmniProcess` row until cloned — `SELECT COUNT() FROM OmniProcess` can read 0 on an org that has it. FIRST call `GET /services/data/v67.0/connect/omni-designer/os/get-scripts` and look for type `HealthCloudReferral` / subType `CreateReferral`; also accept an existing `OmniProcess` row with that Type/SubType. Only if NEITHER has it is this step content-blocked (a missing-content precondition, NOT a transport failure) — deploy the healthcloud OmniStudio content so `CreateReferral` materializes, THEN proceed. **Why this stays manual:** Core does implement a whole-process clone (`POST /connect/omni-designer/clone-omni-process {id, type:"OS"}` → an inactive DB-backed copy; activation is then `IsActive=true` with any other active version deactivated first), but that resource is designer-internal (not served by the catalog) and writing the captcha properties into the cloned element over sObject REST is unverified — do not fabricate that chain; use the designer. Per the doc: App Launcher → **OmniStudio** app → **OmniScripts** → search **HealthCloudReferral/CreateReferral** → open → **New Version** (this is the "clone"; click **Edit** after New Version only if you want a different type/subtype/name). In the new version, on the **InitializeValues** set-values element set **`captchaSiteKey`** = the Google reCAPTCHA **Site Key** (Phase C) and **`captchaKeyPairName`** = the **nickname** of the Web-to-Case reCAPTCHA API key pair (Phase C); review/customize the **ReferralForm** step; then **Activate Version**. Do NOT `POST type:OmniScript` an empty shell with the same Type/SubType/Language — it collides with the packaged script and produces a non-functional duplicate. The captcha fields are load-bearing for the guest form (step 41 / C1: the guest endpoint requires a `captchaToken`).
388
+ - **PHASE E — Customize your Experience Cloud site** ([`hc_admin_referral_management_guest_users_site`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_site.htm&type=5)) — three UI sub-steps, all manual (no headless route): **(1) Configure Guest User Access** ([`..._config`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_config.htm&type=5)): assign the **Guest Referral permission set** (Phase A) to the site's **guest user** (site General Settings → guest user profile → View Users → the guest user → Permission Set Assignments → Edit → move it to Enabled); create **sharing rules** (Setup → Sharing Settings) granting the guest user **Read Only** access to active **Code Sets** (Criteria: `Active` equals `True`) AND active **Omni Processes** (Criteria: `Active` equals `True`) — without the Omni Processes rule the guest can't render the OmniScript; and enable **Salesforce Files → General Settings → "Allow site guest users to upload files"** (for the referral document upload). **(2) Add reCAPTCHA verification markup** ([`hc_admin_recaptcha_markup`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_recaptcha_markup.htm&type=5)): Experience Builder → Settings → **Advanced settings → Edit Head Markup** → paste the Google `grecaptcha` script (loads `https://www.google.com/recaptcha/api.js` and wires the `grecaptchaRender`/`grecaptchaReset` events that render + reset the widget) → Save + **publish**. **(3) Add the Create Referral OmniScript to the site** ([`..._site_omniscript`](https://help.salesforce.com/s/articleView?id=ind.hc_admin_referral_management_guest_users_site_omniscript.htm&type=5)): in Experience Builder drag the **OmniScript** component onto the canvas and set **OmniScript Type = `HealthCloudReferral`**, **SubType = `CreateReferral`** (or your custom version's type/subtype) → **Publish**. Only after publish does the guest form show the "I'm not a robot" checkbox and accept submissions.
389
+ - **PHI-safety gates around Publish (both manual — no served route):** the guest site is **public and unauthenticated**, so publishing it on an over-broad guest access scope silently exposes **PHI** to the open internet — treat that as a breach, not a config nit. Two checkpoints bracket the Publish sub-step above:
390
+ - **`review-guest-referral-security-exposure` (BEFORE Publish)** — an admin MUST review the guest user profile's object permissions AND the guest sharing rules created in Phase E step (1), and confirm they expose **ONLY** the referral-intake surface the Create Referral OmniScript needs (and its minimum required lookups): **never** Person Account, Clinical Service Request, Case, or any other **PHI**-bearing records. Remove every object/field the form does not require from guest access. Do **NOT** publish until this review passes.
391
+ - **`verify-guest-site-published-and-scoped` (AFTER Publish)** — the post-publish read-back for this phase (Phase E has no served verify route). Load the public site URL **logged out** and confirm end-to-end that (1) the site is **Live** and reachable, (2) only the Create Referral OmniScript form is browsable as guest — no Person Account / Clinical Service Request / Case data is reachable — and (3) reCAPTCHA is enforced on submit. Complete this check **before** `create-guest-referral-runtime` (step 41) is exercised.
392
+ - **`enable-referral-management-analytics`** — **PARTIAL (two-phase).** Referral analytics is a **category inside the Health Cloud "Enhanced Analytics for Healthcare" CRM Analytics app**, not a standalone toggle.
393
+ - **Phase 1 — enable base CRM Analytics (reversible):** PATCH `/headless/invoke/platform/insights-setup-getting-started/enable` (the CRM Analytics enable operation, `implemented`, no body) → 200; read back GET `.../insights-setup-getting-started` → `isAnalyticsFullyEnabled:true` (7 enablement steps). Reverse via the sibling `.../disable`. Requires CRM Analytics (Insights) enabled.
394
+ - **Phase 2 — auto-install the HC analytics app with the referral category on:** PATCH `/headless/invoke/platform/health-cloud-admin-feature-setup/send-auto-install-request` → the analytics app auto-install operation (`templateApiName`, `appName`, `params`) with `templateApiName = "sfdc_internal__HLSModernizationApp"` (label "Enhanced Analytics for Healthcare") and `params:{isReferral_Selected:"true"}` (sibling categories: `isUtilizationManagement_Selected`/`isCareManagement_Selected`/`isHomeHealth_Selected`/`isRiskScore_Selected`). Referral analytics builds the `CSR_Referral_tp` / `CSR_Referral_History_tp` datasets (CSR = Clinical Service Request → clinical referrals). The `templateApiName`, the `isReferral_Selected`/sibling param keys, and the dataset names are org/version-sensitive — re-confirm against the provisioned org's `/wave/templates` before relying on the exact strings.
395
+ - **Prerequisites:** assign the **HealthCare Analytics Admin** + **CRM Analytics Plus Admin** permission sets, then Phase 1, then Phase 2. There is **no** HC AdminSetup config JSON for this (unlike WarrantyAnalytics).
396
+ - **Why PARTIAL:** Phase 2 requires the `sfdc_internal__HLSModernizationApp` CRMA template package provisioned in the org; if absent, it returns 200 `{status:"NOT_FOUND", message:"No App Exist."}` (`/wave/templates?type=app` empty) — not a transport gap. Attempt Phase 2 on a provisioned org, then gate on the app/datasets appearing.
397
+ - **Disambiguation (the naming trap):** the corpus node `ReferralManagementAnalyticsSetup` (Aura `runtime_industries_referral_management:referralMarketingAnalyticsSetup`, template `Referral_Analytics`) is **B2C Referral MARKETING analytics — a different feature.** Clinical Referral Management analytics is the HC "Enhanced Analytics for Healthcare" category above, NOT that B2C marketing surface.
398
+
399
+ ## Runtime validation (end-to-end proof the setup works)
400
+
401
+ Once Act 1 (and the internal-creation surfaces) are in place, these native Connect APIs prove the pipeline end-to-end. They are `implemented` (real Connect endpoints). Each sits behind a runtime gate (below), so treat them as diagnostics of the org's runtime readiness, not proof-of-success steps.
402
+
403
+ | # | Step id | Purpose | Controller / API | Route |
404
+ |---|---|---|---|---|
405
+ | 40 | `create-referral-runtime` | validate | Connect `postReferralManagement` (`ReferralManagementInputRepresentation`) | POST `/services/data/v67.0/connect/health/referral-management/referrals` (implemented) |
406
+ | 41 | `create-guest-referral-runtime` | validate | Connect `postGuestReferral` (guest intake) | `POST /connect/health/referral-management/guest-referrals` — guest-only + UiTier-excluded (HTTP 404 for external callers; authenticated POST → "This API can only be called by Guest"), so **no served/dispatchable route** — GAP; exercise only via the published guest form |
407
+
408
+ - **`create-referral-runtime`** validates the internal path: with the app enabled (Act 1 steps 5a/5b) and Person Accounts present, POST a referral and confirm a `ClinicalServiceRequest` is created. The runtime is gated at the **user** level even with the org-level Referral Management app ON: an unentitled user gets 403 `FUNCTIONALITY_NOT_ENABLED`. The gate is a user-level permission-set assignment (Referral Management runtime access), not another org toggle — a residual GAP (`feature_not_enabled_for_user`) the admin closes by granting the running user the runtime permission set.
409
+ - **`create-guest-referral-runtime`** validates the public path: it uses the guest referral record owner set in step 39. **TWO gates, and the guest-context gate fires FIRST.** An authenticated POST to `postGuestReferral` returns `UNKNOWN_EXCEPTION "This API can only be called by Guest."` — the caller-identity (guest-context) check is a hard first gate, rejecting the request before any `captchaToken` validation. The `captchaToken` requirement is the SECOND gate: `postGuestReferral`'s input representation requires a **mandatory `captchaToken`** field (a Google reCAPTCHA response token, `ReCaptcha` type, ~2-minute TTL) produced only when a real user solves the reCAPTCHA widget on the published guest form. **Net: this endpoint is NOT smoke-testable from any authenticated/programmatic session** — (1) the session is not a Guest user, and (2) no valid `captchaToken` can be synthesized. Verify it ONLY by submitting through the published guest referral form as an actual guest (a human solves the reCAPTCHA → a live token is minted and posted; requires the Experience site published Live — see Act 6). The captcha gate is the whole point of `enable-captcha-verification` (step 32) + the site-key/OmniScript captcha fields (steps 34/36).
410
+ - Treat both as smoke tests of the completed setup, not setup steps proper. Neither succeeding is required for "done" — but each failure is a real, reportable signal (a missing user entitlement, and an unpublished guest site) rather than a corpus error.
411
+
412
+ ## Definition of done (the whole skill)
413
+
414
+ An unqualified Referral Management setup is **complete only when every non-gapped step across Acts 0–6 has reached its verified end state** (gate on each `verify-*` read-back) AND every gapped step has been surfaced to the admin with its manual remediation. The live-dispatchable core is: Criteria-Based Search & Filter ON (Act 2), appointment sync ON (Act 4), captcha verification ON + guest referral record owner set (Act 6), with `create-referral-runtime`/`create-guest-referral-runtime` optionally exercised as smoke tests. If Person Accounts is off, the setup is BLOCKED (redirect to [[health-cloud-initial-setup]]), not partially done.
415
+
416
+ **Final-summary format — the manual steps MUST each carry their Help link(s).** When you write the closing summary and list the manual / out-of-band steps (the `gaps_surfaced` list), render each as: **step name — one-line remediation — [Help doc](url)** for **every** URL in that step's `help_urls` list (steps with several docs, like `prepare-external-referral-fax-intake` and `act6-phase-e-customize-site`, render one link per doc). A manual step missing any of its Salesforce Help links is an incomplete summary; go back to the Manual-step documentation contract table (top of this skill) and add them. Do not present the manual steps as a bare bullet list of "do X by hand" with no links.
417
+
418
+ **Org-specific values (picklist values, permission-set / user / data-space IDs, template API names) MUST be discovered live per-org** — never hardcode IDs or picklist sets, and always gate each write on its read-back.
419
+
420
+ ## Resumability
421
+
422
+ Every step is skippable and revisitable. Before acting on any step, re-read the corresponding `read-`/`verify-`/`check-`/`discover-` step to detect existing org state and avoid duplicating work — the agent should determine where to begin from org state, not assume a fresh org. Skip a write when its read shows the target state is already correct (`read-referral-management-settings` resolves the Act-6 captcha toggle state).
423
+
424
+ ## Underlying setup-page nodes (companion references — do not duplicate their step definitions)
425
+
426
+ This workflow sequences operations already defined on these setup-page nodes and sibling skills; call them by controller method / route rather than re-deriving:
427
+
428
+ - `ReferralManagementSettings` — the Referral Management app + captcha verification toggles.
429
+ - `CriteriaBasedSearchAndFilter` — Provider Search Criteria-Based Search & Filter preference.
430
+ - `OwnerIdSetup` — guest referral record owner (the guest-referral owner save operation).
431
+ - `PatientAppointmentSchedulingSettings` — appointment sync toggle.
432
+ - `OmniStudioSettings` — Standard OmniStudio runtime pref.
433
+ - `ClinicalServiceRequest` — the standard Health Cloud referral entity (Status/StatusReason picklists, page layout, path).
434
+ - `PersonAccountSettings` (via [[health-cloud-initial-setup]]) — the irreversible Person Accounts prerequisite this skill delegates.
435
+ - `SonicGettingStarted` — the Data Pipelines org-preference toggle (`appType=DataManager`) that gates the Data Processing Engine behind Actionable Segmentation (step 8).
436
+ - `PublicHealthSettings` — the Public Health Settings page backing Act 5's Disease Surveillance org-preference toggle (set-preference / get-preference; allowlisted prefs `diseaseSurveillancePref`, `diseaseCaseClassificationPref`, `healthCloudGenAIPref`, `deDupeForDSPref`); enabling Disease Surveillance surfaces the Document AI for Health guided setup.
437
+ - `IntelligentDocExtract` — the Document AI for Health / Intelligent Document Automation config surface (document-extraction-definition templates + flows) behind Act 5; batch enablement via `batch-intelligent-doc-extract-setup-page` (`set-preference`, `get-preference`, `save-folder-selection`).
438
+
439
+ Additional capabilities referenced inline: the Health Cloud license gate, the OmniStudio runtime preference read, the Tooling API (Layout, picklist/RecordType discovery), and the native `ReferralManagement` Connect API (runtime create).
440
+
441
+ <!-- skill-validate: ignore-start -->
442
+ <!-- codey:operations start -->
443
+ ## Operations Reference
444
+
445
+ Operations this skill uses — routing and dependency reference.
446
+
447
+ | Operation | Purpose | Status | Call | Depends on |
448
+ |-----------|---------|--------|------|------------|
449
+ | `verify-health-cloud-license` | read | — | `GET /headless/invoke/platform/health-cloud-admin-feature-setup/has-health-cloud-licence` | — |
450
+ | `read-referral-management-settings` | read | — | `GET /headless/invoke/platform/referral-management-settings` | — |
451
+ | `enable-person-accounts` | write | — | `PATCH /headless/invoke/platform/person-account-settings/enable-person-accounts` | — |
452
+ | `check-omnistudio-runtime` | read | — | `GET /headless/invoke/platform/omni-studio-settings/get-omni-studio-prefs` | — |
453
+ | `discover-clinical-service-request-picklists` | discovery | — | `GET /services/data/v67.0/tooling/query/` | — |
454
+ | `enable-referral-management-app` | write | — | `PATCH /headless/invoke/platform/referral-management-settings/handle-referral-management-app-toggle` | — |
455
+ | `verify-referral-management-app-enabled` | verify | — | `GET /headless/invoke/platform/referral-management-settings` | `enable-referral-management-app` |
456
+ | `assign-clinical-service-request-page-layout` | write | — | — | — |
457
+ | `configure-referral-management-path` | write | — | — | `discover-clinical-service-request-picklists` |
458
+ | `configure-referral-actionable-lists` | write | — | — | — |
459
+ | `create-referral-screen-flow` | write | — | — | — |
460
+ | `enable-criteria-based-search-and-filter` | write | — | `PATCH /headless/invoke/platform/criteria-based-search-and-filter/set-criteria-based-search-and-filter-pref` | — |
461
+ | `verify-criteria-based-search-and-filter` | verify | — | `GET /headless/invoke/platform/criteria-based-search-and-filter/get-criteria-based-search-and-filter-pref` | `enable-criteria-based-search-and-filter` |
462
+ | `include-referral-action-in-provider-search` | write | — | — | `create-referral-screen-flow`, `enable-criteria-based-search-and-filter`, `configure-referral-actionable-lists` |
463
+ | `create-case-business-process` | write | — | — | — |
464
+ | `create-case-record-type` | write | — | `POST /services/data/v67.0/tooling/sobjects/RecordType` | `create-case-business-process` |
465
+ | `create-case-from-csr-flow` | write | — | — | — |
466
+ | `configure-patient-referral-expression-set` | write | — | `POST /connect/business-rules/expression-set` | — |
467
+ | `load-patient-referral-decision-table` | write | — | `POST /connect/business-rules/decision-table/definitions` | `configure-patient-referral-expression-set`, `add-csr-status-picklist-values`, `add-csr-status-reason-picklist-values` |
468
+ | `add-csr-status-picklist-values` | write | — | — | — |
469
+ | `add-csr-status-reason-picklist-values` | write | — | — | — |
470
+ | `assign-action-plans-permission-set` | write | — | `POST /sobjects/PermissionSetAssignment` | — |
471
+ | `activate-referral-flow-orchestration` | write | — | — | — |
472
+ | `create-ebv-prior-auth-apex-classes` | write | — | `POST /services/data/v67.0/tooling/sobjects/ApexClass` | — |
473
+ | `provision-ebv-callback-experience-site` | write | — | — | `create-ebv-prior-auth-apex-classes`, `create-mulesoft-fhir-named-credential` |
474
+ | `create-mulesoft-fhir-named-credential` | write | — | — | — |
475
+ | `install-datacloud-referral-scoring-data-kit` | write | — | — | — |
476
+ | `place-outbound-engagement-home-component` | write | — | — | — |
477
+ | `configure-marketing-cloud-outreach` | write | — | — | — |
478
+ | `enable-appointment-sync` | write | — | `PATCH /headless/invoke/platform/patient-appointment-scheduling-settings/handle-patient-appointment-scheduling-toggle` | — |
479
+ | `verify-appointment-sync` | verify | — | `GET /headless/invoke/platform/patient-appointment-scheduling-settings/get-patient-appointment-scheduling-org-pref` | `enable-appointment-sync` |
480
+ | `enable-disease-surveillance-pref` | write | — | `PATCH /headless/invoke/platform/public-health-settings/set-preference` | — |
481
+ | `verify-disease-surveillance-pref` | verify | — | `GET /headless/invoke/platform/public-health-settings/get-preferences` | `enable-disease-surveillance-pref` |
482
+ | `enable-intelligent-doc-extract-pref` | write | — | `PATCH /headless/invoke/platform/intelligent-doc-extract/set-preference` | — |
483
+ | `verify-intelligent-doc-extract-pref` | verify | — | `GET /headless/invoke/platform/intelligent-doc-extract/get-preference` | `enable-intelligent-doc-extract-pref` |
484
+ | `prepare-external-referral-fax-intake` | write | — | — | `verify-disease-surveillance-pref`, `verify-intelligent-doc-extract-pref` |
485
+ | `provision-referral-experience-cloud-site` | write | — | `POST /services/data/v67.0/connect/communities` | `act6-phase-a-get-org-ready` |
486
+ | `enable-captcha-verification` | write | — | `PATCH /headless/invoke/platform/referral-management-settings/handle-captcha-verification-toggle` | — |
487
+ | `verify-captcha-verification` | verify | — | `GET /headless/invoke/platform/referral-management-settings` | `enable-captcha-verification` |
488
+ | `register-recaptcha-site-key` | write | — | — | — |
489
+ | `generate-web-to-case-html` | write | — | — | `register-recaptcha-site-key` |
490
+ | `activate-create-referral-omniscript` | write | — | — | `register-recaptcha-site-key`, `generate-web-to-case-html`, `check-omnistudio-runtime` |
491
+ | `enable-referral-management-analytics` | write | — | `PATCH /headless/invoke/platform/insights-setup-getting-started/enable` | — |
492
+ | `read-guest-referral-record-owner-candidates` | read | — | `GET /headless/invoke/industries/industries-healthcare/owner-id-setup/get-salesforce-licensed-users` | — |
493
+ | `set-guest-referral-record-owner` | write | — | `PATCH /headless/invoke/industries/industries-healthcare/owner-id-setup/save-owner` | `read-guest-referral-record-owner-candidates` |
494
+ | `create-referral-runtime` | validate | — | `POST /services/data/v67.0/connect/health/referral-management/referrals` | `verify-referral-management-app-enabled` |
495
+ | `create-guest-referral-runtime` | validate | — | — | `enable-captcha-verification`, `register-recaptcha-site-key`, `activate-create-referral-omniscript`, `set-guest-referral-record-owner` |
496
+ | `act6-phase-a-get-org-ready` | write | — | — | — |
497
+ | `act6-phase-e-customize-site` | write | — | — | `provision-referral-experience-cloud-site`, `activate-create-referral-omniscript`, `verify-captcha-verification`, `set-guest-referral-record-owner` |
498
+ | `verify-person-accounts-enabled` | verify | — | `GET /headless/invoke/platform/person-account-settings/check-person-account-readiness` | `enable-person-accounts` |
499
+ | `verify-configure-referral-management-path` | verify | — | `GET /services/data/v67.0/tooling/query/` | `configure-referral-management-path` |
500
+ | `verify-create-case-business-process` | verify | — | `GET /services/data/v67.0/tooling/query/` | `create-case-business-process` |
501
+ | `verify-create-case-record-type` | verify | — | `GET /services/data/v67.0/tooling/query/` | `create-case-record-type` |
502
+ | `verify-configure-patient-referral-expression-set` | verify | — | `GET /connect/business-rules/expression-set/{expressionSetId}` | `configure-patient-referral-expression-set` |
503
+ | `verify-load-patient-referral-decision-table` | verify | — | `GET /connect/business-rules/decision-table/definitions/{decisionTableId}` | `load-patient-referral-decision-table` |
504
+ | `verify-assign-action-plans-permission-set` | verify | — | `GET /services/data/v67.0/query/` | `assign-action-plans-permission-set` |
505
+ | `verify-ebv-prior-auth-apex-classes` | verify | — | `GET /services/data/v67.0/tooling/query/` | `create-ebv-prior-auth-apex-classes` |
506
+ | `verify-mulesoft-fhir-named-credential-created` | verify | — | `GET /services/data/v67.0/tooling/query/` | `create-mulesoft-fhir-named-credential` |
507
+ | `verify-referral-experience-cloud-site-provisioned` | verify | — | `GET /services/data/v67.0/connect/communities` | `provision-referral-experience-cloud-site` |
508
+ | `verify-referral-management-analytics-enabled` | verify | — | `GET /headless/invoke/platform/insights-setup-getting-started` | `enable-referral-management-analytics` |
509
+ | `verify-guest-referral-record-owner-saved` | verify | — | — | `set-guest-referral-record-owner` |
510
+ | `review-guest-referral-security-exposure` | validate | — | — | `provision-referral-experience-cloud-site`, `set-guest-referral-record-owner` |
511
+ | `verify-guest-site-published-and-scoped` | verify | — | — | `act6-phase-e-customize-site`, `review-guest-referral-security-exposure` |
512
+ <!-- codey:operations end -->
513
+ <!-- skill-validate: ignore-end -->