sf-industry-commoncore-omniscript: OmniStudio OmniScript Creation and Validation
Expert OmniStudio OmniScript builder for declarative, step-based guided digital experiences. OmniScripts are the OmniStudio analog of Screen Flows: multi-step, interactive processes that collect input, orchestrate server-side logic (Integration Procedures, DataRaptors), and present results to the user — all without code.
Quick Reference
Scoring: 120 points across 6 categories. Thresholds: ✅ 90+ (Deploy) | ⚠️ 67-89 (Review) | ❌ <67 (Block - fix required)
Core Responsibilities
- OmniScript Generation: Create well-structured OmniScripts from requirements, selecting appropriate element types for each step
- Element Design: Configure PropertySetConfig JSON for each element with correct data binding, validation, and conditional logic
- Dependency Analysis: Map all references to Integration Procedures, DataRaptors, and embedded OmniScripts before deployment
- Data Flow Analysis: Trace data through the OmniScript JSON structure — from prefill through user input to final save actions
CRITICAL: Orchestration Order
sf-industry-commoncore-omnistudio-analyze → sf-industry-commoncore-datamapper → sf-industry-commoncore-integration-procedure → sf-industry-commoncore-omniscript → sf-industry-commoncore-flexcard (you are here: sf-industry-commoncore-omniscript)
OmniScripts consume Integration Procedures and DataRaptors. Build those FIRST. FlexCards may launch OmniScripts — build FlexCards AFTER. Use sf-industry-commoncore-omnistudio-analyze to map the full dependency tree before starting.
Key Insights
| Insight |
Details |
| Type/SubType/Language triplet |
Uniquely identifies an OmniScript. All three values are required and form the composite key. Example: Type=ServiceRequest, SubType=NewCase, Language=English |
| PropertySetConfig |
JSON blob containing all element configuration — layout, data binding, validation rules, conditional visibility. This is where the real logic lives |
| Core namespace |
OmniProcess with IsIntegrationProcedure = false (equivalently OmniProcessType='OmniScript'). Elements are child OmniProcessElement records |
| Element hierarchy |
Elements use Level/Order fields for tree structure. Level 0 = Steps, Level 1+ = elements within steps. Order determines sequence within a level |
| Version management |
Multiple versions can exist; only one can be active per Type/SubType/Language triplet. Activate via the IsActive field |
| Data JSON |
OmniScripts pass a single JSON data structure through all steps. Elements read from and write to this shared JSON via merge field syntax |
Workflow Design (5-Phase Pattern)
Phase 1: Requirements Gathering
Before building, evaluate alternatives: OmniScripts are best for complex, multi-step guided processes. For simple single-screen data entry, consider Screen Flows. For data display without interaction, consider FlexCards.
Ask the user to gather:
- Type: The process category (e.g.,
ServiceRequest, Enrollment, ClaimSubmission)
- SubType: The specific variation (e.g.,
NewCase, UpdateAddress, FileAppeal)
- Language: Typically
English unless multi-language support is required
- Purpose: What business process this OmniScript guides the user through
- Target org: Org alias for deployment
- Data sources: Which objects/APIs need to be queried or updated
Then: Check existing OmniScripts to avoid duplication, identify reusable Integration Procedures or DataRaptors, and map the dependency chain.
Phase 2: Design & Element Selection
Design each step and select element types appropriate to the interaction pattern.
Container Elements
| Element Type |
Purpose |
Key Config |
| Step |
Top-level container for a group of UI elements; each Step is a page in the wizard |
chartLabel, knowledgeOptions, show (conditional visibility) |
| Conditional Block |
Show/hide a group of elements based on conditions |
conditionType, show expression |
| Loop Block |
Iterate over a data list and render elements for each item |
loopData (JSON path to array) |
| Edit Block |
Inline editing container for tabular data |
editFields, dataSource |
Input Elements
| Element Type |
Purpose |
Key Config |
| Text |
Single-line text input |
label, placeholder, pattern (regex validation) |
| Text Area |
Multi-line text input |
label, maxLength, rows |
| Number |
Numeric input with optional formatting |
label, min, max, step, format |
| Date |
Date picker |
label, dateFormat, minDate, maxDate |
| Date/Time |
Date and time picker |
label, dateFormat, timeFormat |
| Checkbox |
Boolean toggle |
label, defaultValue |
| Radio |
Radio button group for single selection |
label, options (static or data-driven) |
| Select |
Dropdown selection |
label, options, optionSource (static/data) |
| Multi-select |
Multiple item selection |
label, options, maxSelections |
| Type Ahead |
Search/autocomplete input |
label, dataSource, searchField, minCharacters |
| Signature |
Signature capture pad |
label, penColor, backgroundColor |
| File |
File upload |
label, maxFileSize, allowedExtensions |
| Currency |
Currency input with locale formatting |
label, currencyCode, min, max |
| Email |
Email input with format validation |
label, placeholder |
| Telephone |
Phone number input with masking |
label, mask, placeholder |
| URL |
URL input with format validation |
label, placeholder |
| Password |
Masked text input |
label, minLength |
| Range |
Slider input |
label, min, max, step |
| Time |
Time picker |
label, timeFormat |
Display Elements
| Element Type |
Purpose |
Key Config |
| Text Block |
Static content display (HTML supported) |
textContent, HTMLTemplateId |
| Headline |
Section heading |
text, level (h1-h6) |
| Aggregate |
Calculated summary display |
aggregateExpression, format |
| Disclosure |
Expandable/collapsible content |
label, defaultExpanded |
| Image |
Image display |
imageURL, altText |
| Chart |
Data visualization |
chartType, dataSource |
Action Elements
| Element Type |
Purpose |
Key Config |
| DataRaptor Extract Action |
Pull data from Salesforce |
bundle, inputMap, outputMap |
| DataRaptor Load Action |
Push data to Salesforce |
bundle, inputMap |
| Integration Procedure Action |
Call server-side Integration Procedure |
ipMethod (Type_SubType), inputMap, outputMap, remoteOptions |
| Remote Action |
Call Apex @RemoteAction or REST |
remoteClass, remoteMethod, inputMap |
| Navigate Action |
Page navigation or redirection |
targetType, targetId, URL |
| DocuSign Envelope Action |
Trigger DocuSign envelope |
templateId, recipientMap |
| Email Action |
Send email |
emailTemplateId, recipientMap |
Logic Elements
| Element Type |
Purpose |
Key Config |
| Set Values |
Variable assignment and data transformation |
elementValueMap (key-value pairs) |
| Validation |
Input validation rules with custom messages |
validationFormula, errorMessage |
| Formula |
Calculate values using formula expressions |
expression, dataType |
| Submit Action |
Final submission of collected data |
postMessage, preTransformBundle, postTransformBundle |
Phase 3: Generation & Validation
# Verify no duplicate Type/SubType/Language exists
sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND Language='<Language>' AND OmniProcessType='OmniScript'" -o <org>
Build the OmniScript:
- Create the OmniProcess record with Type, SubType, Language, and OmniProcessType='OmniScript'
- Create OmniProcessElement child records for each Step (Level=0)
- Create OmniProcessElement child records for each element within Steps (Level=1+, ordered by Order field)
- Configure PropertySetConfig JSON for each element
- Wire action elements to their Integration Procedures / DataRaptors
Validation (STRICT MODE):
- BLOCK: Missing Type/SubType/Language, circular OmniScript embedding, broken IP/DataRaptor references, missing required PropertySetConfig fields
- WARN: Steps with no elements, input elements without validation, missing error handling on actions, unused data paths, deeply nested elements (>4 levels)
Validation Report Format (6-Category Scoring 0-120):
Score: 102/120 ---- Very Good
-- Design & Structure: 22/25 (88%)
-- Data Integration: 18/20 (90%)
-- Error Handling: 17/20 (85%)
-- Performance: 18/20 (90%)
-- User Experience: 17/20 (85%)
-- Security: 10/15 (67%)
Phase 4: Deployment
- Deploy all dependencies first: DataRaptors, Integration Procedures, referenced OmniScripts
- Retrieve or deploy OmniScript metadata:
sf project retrieve start -m OmniScript:<Name> -o <org>
sf project deploy start -m OmniScript:<Name> -o <org>
- Activate the OmniScript version after successful deployment
- Verify activation:
sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND OmniProcessType='OmniScript' AND IsActive=true" -o <org>
Phase 5: Testing
Walk through all paths with various data scenarios:
- Happy path: Complete all steps with valid data, verify submission
- Validation testing: Submit invalid data at each input, verify error messages
- Conditional testing: Exercise all conditional blocks and verify show/hide logic
- Data prefill: Verify DataRaptor Extract Actions populate elements correctly
- Save for later: Test resume functionality if enabled
- Navigation: Test back/forward/cancel behavior across all steps
- Error scenarios: Simulate IP/DataRaptor failures, verify error handling
- Embedded OmniScripts: Test data passing between parent and child OmniScripts
- Bulk data: Test with large datasets in Loop Blocks and Type Ahead elements
Generation Guardrails (MANDATORY)
| Anti-Pattern |
Impact |
Correct Pattern |
| Circular OmniScript embedding |
Infinite rendering loop |
Map dependency tree; never embed A in B if B embeds A |
| Unbounded DataRaptor Extract |
Performance degradation |
Add filter conditions; limit returned records |
| Missing input validation |
Bad data entry |
Add Validation elements or pattern/required on inputs |
| Hardcoded Salesforce IDs |
Deployment failure across orgs |
Use merge fields or Custom Settings/Metadata |
| IP Action without error handling |
Silent failures |
Configure showError, errorMessage in PropertySetConfig |
| Large images in Text Blocks |
Slow page load |
Use Image elements with optimized URLs |
| Too many elements per Step |
Poor user experience |
Limit to 7-10 input elements per Step |
| Missing conditional visibility |
Irrelevant fields shown |
Use show expressions to hide inapplicable elements |
DO NOT generate anti-patterns even if explicitly requested.
Scoring: 120 Points Across 6 Categories
Design & Structure (25 points)
| Check |
Points |
Criteria |
| Type/SubType/Language set correctly |
5 |
All three fields populated with meaningful values |
| Step organization |
5 |
Logical grouping, 7-10 elements per step max |
| Element naming |
5 |
Descriptive names following PascalCase convention |
| Conditional logic |
5 |
Proper use of Conditional Blocks and show expressions |
| Version management |
5 |
Clean version history, only one active version |
Data Integration (20 points)
| Check |
Points |
Criteria |
| DataRaptor references valid |
5 |
All Extract/Load bundles exist and are active |
| Integration Procedure references valid |
5 |
All IP actions reference active IPs |
| Input/Output maps correct |
5 |
Data flows correctly between elements and actions |
| Data prefill configured |
5 |
Initial data loaded before user interaction |
Error Handling (20 points)
| Check |
Points |
Criteria |
| Action elements have error handling |
5 |
showError configured on all IP/DR actions |
| User-facing error messages |
5 |
Clear, actionable error text |
| Validation on required inputs |
5 |
All required fields have validation rules |
| Fallback behavior defined |
5 |
Graceful handling when data sources return empty |
Performance (20 points)
| Check |
Points |
Criteria |
| No unbounded data fetches |
5 |
All DataRaptor Extracts have filters/limits |
| Lazy loading configured |
5 |
Action elements fire on step entry, not OmniScript load |
| Element count per Step reasonable |
5 |
No Step with >15 elements |
| Conditional rendering used |
5 |
Elements hidden when not applicable (not just invisible) |
User Experience (20 points)
| Check |
Points |
Criteria |
| Logical step flow |
5 |
Steps follow natural task progression |
| Input labels and help text |
5 |
All inputs have clear labels and contextual help |
| Navigation controls |
5 |
Back, Next, Cancel, Save for Later configured appropriately |
| Responsive layout |
5 |
Elements configured for mobile and desktop breakpoints |
Security (15 points)
| Check |
Points |
Criteria |
| No sensitive data in client-side JSON |
5 |
Passwords, SSNs, tokens kept server-side |
| IP actions use server-side processing |
5 |
Sensitive logic in Integration Procedures, not client OmniScript |
| Field-level access respected |
5 |
Data access matches user profile/permission set |
CLI Commands
# List active OmniScripts
sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE IsActive=true AND OmniProcessType='OmniScript'" -o <org>
# Query elements for a specific OmniScript
sf data query -q "SELECT Id,Name,ElementType,PropertySetConfig,Level,Order FROM OmniProcessElement WHERE OmniProcessId='<id>' ORDER BY Level,Order" -o <org>
# Retrieve OmniScript metadata
sf project retrieve start -m OmniScript:<Name> -o <org>
# Deploy OmniScript metadata
sf project deploy start -m OmniScript:<Name> -o <org>
# Check OmniScript versions
sf data query -q "SELECT Id,VersionNumber,IsActive,LastModifiedDate FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND OmniProcessType='OmniScript' ORDER BY VersionNumber DESC" -o <org>
Cross-Skill Integration
| From Skill |
To sf-industry-commoncore-omniscript |
When |
| sf-industry-commoncore-omnistudio-analyze |
-> sf-industry-commoncore-omniscript |
"Analyze dependencies before building OmniScript" |
| sf-industry-commoncore-datamapper |
-> sf-industry-commoncore-omniscript |
"DataRaptor ready, build the OmniScript that uses it" |
| sf-industry-commoncore-integration-procedure |
-> sf-industry-commoncore-omniscript |
"IP ready, wire it into the OmniScript action" |
| From sf-industry-commoncore-omniscript |
To Skill |
When |
| sf-industry-commoncore-omniscript |
-> sf-industry-commoncore-flexcard |
"Build FlexCard that launches this OmniScript" |
| sf-industry-commoncore-omniscript |
-> sf-deploy |
"Deploy OmniScript to target org" |
| sf-industry-commoncore-omniscript |
-> sf-industry-commoncore-omnistudio-analyze |
"Map full dependency tree before deployment" |
| sf-industry-commoncore-omniscript |
-> sf-industry-commoncore-integration-procedure |
"Need a new IP for this OmniScript action" |
| sf-industry-commoncore-omniscript |
-> sf-industry-commoncore-datamapper |
"Need a DataRaptor for data prefill" |
Edge Cases
| Scenario |
Solution |
| Multi-language OmniScript |
Create separate versions per Language with shared Type/SubType. Use translation workbench for labels |
| Embedded OmniScript data passing |
Map parent data JSON keys to child OmniScript input via prefillJSON. Test data round-trip |
| Large Loop Block datasets |
Paginate or limit DataRaptor results. Consider server-side filtering in IP |
| OmniScript in FlexCard flyout |
Ensure FlexCard passes required context data. Test flyout sizing |
| Community/Experience Cloud deployment |
Verify OmniScript component is available in Experience Builder. Check guest user permissions |
| Save & Resume (Save for Later) |
Configure saveNameTemplate, saveExpireInDays. Test resume with partial data |
| Versioning conflicts |
Deactivate old version before activating new. Never have two active versions for same triplet |
| Custom Lightning Web Components in OmniScript |
Register LWC as OmniScript-compatible. Follow omniscript-lwc namespace conventions |
Debug: OmniScript not rendering -> check activation status + element hierarchy | Data not prefilling -> verify DataRaptor Extract output mapping + JSON path | IP action failing -> check IP independently first + verify input map | Steps not showing -> review conditional visibility expressions
Notes
Dependencies (required): sf-industry-commoncore-datamapper, sf-industry-commoncore-integration-procedure | Dependencies (optional): sf-deploy, sf-industry-commoncore-flexcard, sf-industry-commoncore-omnistudio-analyze | API: 66.0 | Mode: Strict (warnings block) | Scoring: Block deployment if score < 67 | Reference docs: See references/ for element types and best practices
Creating OmniScripts programmatically: Use REST API (sf api request rest --method POST --body @file.json). Required fields: Name, Type, SubType, Language, VersionNumber. OmniScripts default to IsIntegrationProcedure=false (do NOT set OmniProcessType — it is computed). The sf data create record --values flag cannot handle JSON textarea fields like PropertySetConfig. Create child OmniProcessElement records via REST API for each Step and element.
License
MIT License.
Copyright (c) 2026 David Ryan (weytani)
1---2name: sf-industry-commoncore-omniscript3description: >4 OmniStudio OmniScript creation and validation with 120-point scoring. Use when5 building guided digital experiences, multi-step forms, or interactive processes6 that orchestrate Integration Procedures and Data Mappers.7 TRIGGER when: user creates OmniScripts, designs step flows, configures element8 types, or reviews existing OmniScript configurations.9 DO NOT TRIGGER when: building FlexCards (use sf-industry-commoncore-flexcard), creating Integration10 Procedures directly (use sf-industry-commoncore-integration-procedure), or analyzing dependencies11 (use sf-industry-commoncore-omnistudio-analyze).12license: MIT13metadata:14 source: https://skillmd.com/skills/om-scogo/sf-industry-commoncore-omniscript15 version: "1.0.0"16 author: "David Ryan (weytani)"17 scoring: "120 points across 6 categories"18---1920# sf-industry-commoncore-omniscript: OmniStudio OmniScript Creation and Validation2122Expert OmniStudio OmniScript builder for declarative, step-based guided digital experiences. OmniScripts are the OmniStudio analog of Screen Flows: multi-step, interactive processes that collect input, orchestrate server-side logic (Integration Procedures, DataRaptors), and present results to the user — all without code.2324## Quick Reference2526**Scoring**: 120 points across 6 categories. **Thresholds**: ✅ 90+ (Deploy) | ⚠️ 67-89 (Review) | ❌ <67 (Block - fix required)2728---2930## Core Responsibilities31321. **OmniScript Generation**: Create well-structured OmniScripts from requirements, selecting appropriate element types for each step332. **Element Design**: Configure PropertySetConfig JSON for each element with correct data binding, validation, and conditional logic343. **Dependency Analysis**: Map all references to Integration Procedures, DataRaptors, and embedded OmniScripts before deployment354. **Data Flow Analysis**: Trace data through the OmniScript JSON structure — from prefill through user input to final save actions3637---3839## CRITICAL: Orchestration Order4041**sf-industry-commoncore-omnistudio-analyze → sf-industry-commoncore-datamapper → sf-industry-commoncore-integration-procedure → sf-industry-commoncore-omniscript → sf-industry-commoncore-flexcard** (you are here: sf-industry-commoncore-omniscript)4243OmniScripts consume Integration Procedures and DataRaptors. Build those FIRST. FlexCards may launch OmniScripts — build FlexCards AFTER. Use sf-industry-commoncore-omnistudio-analyze to map the full dependency tree before starting.4445---4647## Key Insights4849| Insight | Details |50|---------|---------|51| **Type/SubType/Language triplet** | Uniquely identifies an OmniScript. All three values are required and form the composite key. Example: Type=`ServiceRequest`, SubType=`NewCase`, Language=`English` |52| **PropertySetConfig** | JSON blob containing all element configuration — layout, data binding, validation rules, conditional visibility. This is where the real logic lives |53| **Core namespace** | OmniProcess with `IsIntegrationProcedure = false` (equivalently `OmniProcessType='OmniScript'`). Elements are child OmniProcessElement records |54| **Element hierarchy** | Elements use Level/Order fields for tree structure. Level 0 = Steps, Level 1+ = elements within steps. Order determines sequence within a level |55| **Version management** | Multiple versions can exist; only one can be active per Type/SubType/Language triplet. Activate via the `IsActive` field |56| **Data JSON** | OmniScripts pass a single JSON data structure through all steps. Elements read from and write to this shared JSON via merge field syntax |5758---5960## Workflow Design (5-Phase Pattern)6162### Phase 1: Requirements Gathering6364**Before building, evaluate alternatives**: OmniScripts are best for complex, multi-step guided processes. For simple single-screen data entry, consider Screen Flows. For data display without interaction, consider FlexCards.6566**Ask the user** to gather:67- **Type**: The process category (e.g., `ServiceRequest`, `Enrollment`, `ClaimSubmission`)68- **SubType**: The specific variation (e.g., `NewCase`, `UpdateAddress`, `FileAppeal`)69- **Language**: Typically `English` unless multi-language support is required70- **Purpose**: What business process this OmniScript guides the user through71- **Target org**: Org alias for deployment72- **Data sources**: Which objects/APIs need to be queried or updated7374**Then**: Check existing OmniScripts to avoid duplication, identify reusable Integration Procedures or DataRaptors, and map the dependency chain.7576### Phase 2: Design & Element Selection7778Design each step and select element types appropriate to the interaction pattern.7980#### Container Elements8182| Element Type | Purpose | Key Config |83|-------------|---------|------------|84| **Step** | Top-level container for a group of UI elements; each Step is a page in the wizard | `chartLabel`, `knowledgeOptions`, `show` (conditional visibility) |85| **Conditional Block** | Show/hide a group of elements based on conditions | `conditionType`, `show` expression |86| **Loop Block** | Iterate over a data list and render elements for each item | `loopData` (JSON path to array) |87| **Edit Block** | Inline editing container for tabular data | `editFields`, `dataSource` |8889#### Input Elements9091| Element Type | Purpose | Key Config |92|-------------|---------|------------|93| **Text** | Single-line text input | `label`, `placeholder`, `pattern` (regex validation) |94| **Text Area** | Multi-line text input | `label`, `maxLength`, `rows` |95| **Number** | Numeric input with optional formatting | `label`, `min`, `max`, `step`, `format` |96| **Date** | Date picker | `label`, `dateFormat`, `minDate`, `maxDate` |97| **Date/Time** | Date and time picker | `label`, `dateFormat`, `timeFormat` |98| **Checkbox** | Boolean toggle | `label`, `defaultValue` |99| **Radio** | Radio button group for single selection | `label`, `options` (static or data-driven) |100| **Select** | Dropdown selection | `label`, `options`, `optionSource` (static/data) |101| **Multi-select** | Multiple item selection | `label`, `options`, `maxSelections` |102| **Type Ahead** | Search/autocomplete input | `label`, `dataSource`, `searchField`, `minCharacters` |103| **Signature** | Signature capture pad | `label`, `penColor`, `backgroundColor` |104| **File** | File upload | `label`, `maxFileSize`, `allowedExtensions` |105| **Currency** | Currency input with locale formatting | `label`, `currencyCode`, `min`, `max` |106| **Email** | Email input with format validation | `label`, `placeholder` |107| **Telephone** | Phone number input with masking | `label`, `mask`, `placeholder` |108| **URL** | URL input with format validation | `label`, `placeholder` |109| **Password** | Masked text input | `label`, `minLength` |110| **Range** | Slider input | `label`, `min`, `max`, `step` |111| **Time** | Time picker | `label`, `timeFormat` |112113#### Display Elements114115| Element Type | Purpose | Key Config |116|-------------|---------|------------|117| **Text Block** | Static content display (HTML supported) | `textContent`, `HTMLTemplateId` |118| **Headline** | Section heading | `text`, `level` (h1-h6) |119| **Aggregate** | Calculated summary display | `aggregateExpression`, `format` |120| **Disclosure** | Expandable/collapsible content | `label`, `defaultExpanded` |121| **Image** | Image display | `imageURL`, `altText` |122| **Chart** | Data visualization | `chartType`, `dataSource` |123124#### Action Elements125126| Element Type | Purpose | Key Config |127|-------------|---------|------------|128| **DataRaptor Extract Action** | Pull data from Salesforce | `bundle`, `inputMap`, `outputMap` |129| **DataRaptor Load Action** | Push data to Salesforce | `bundle`, `inputMap` |130| **Integration Procedure Action** | Call server-side Integration Procedure | `ipMethod` (Type_SubType), `inputMap`, `outputMap`, `remoteOptions` |131| **Remote Action** | Call Apex @RemoteAction or REST | `remoteClass`, `remoteMethod`, `inputMap` |132| **Navigate Action** | Page navigation or redirection | `targetType`, `targetId`, `URL` |133| **DocuSign Envelope Action** | Trigger DocuSign envelope | `templateId`, `recipientMap` |134| **Email Action** | Send email | `emailTemplateId`, `recipientMap` |135136#### Logic Elements137138| Element Type | Purpose | Key Config |139|-------------|---------|------------|140| **Set Values** | Variable assignment and data transformation | `elementValueMap` (key-value pairs) |141| **Validation** | Input validation rules with custom messages | `validationFormula`, `errorMessage` |142| **Formula** | Calculate values using formula expressions | `expression`, `dataType` |143| **Submit Action** | Final submission of collected data | `postMessage`, `preTransformBundle`, `postTransformBundle` |144145### Phase 3: Generation & Validation146147```bash148# Verify no duplicate Type/SubType/Language exists149sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND Language='<Language>' AND OmniProcessType='OmniScript'" -o <org>150```151152**Build the OmniScript**:1531. Create the OmniProcess record with Type, SubType, Language, and OmniProcessType='OmniScript'1542. Create OmniProcessElement child records for each Step (Level=0)1553. Create OmniProcessElement child records for each element within Steps (Level=1+, ordered by Order field)1564. Configure PropertySetConfig JSON for each element1575. Wire action elements to their Integration Procedures / DataRaptors158159**Validation (STRICT MODE)**:160- **BLOCK**: Missing Type/SubType/Language, circular OmniScript embedding, broken IP/DataRaptor references, missing required PropertySetConfig fields161- **WARN**: Steps with no elements, input elements without validation, missing error handling on actions, unused data paths, deeply nested elements (>4 levels)162163**Validation Report Format** (6-Category Scoring 0-120):164```165Score: 102/120 ---- Very Good166-- Design & Structure: 22/25 (88%)167-- Data Integration: 18/20 (90%)168-- Error Handling: 17/20 (85%)169-- Performance: 18/20 (90%)170-- User Experience: 17/20 (85%)171-- Security: 10/15 (67%)172```173174### Phase 4: Deployment1751761. Deploy all dependencies first: DataRaptors, Integration Procedures, referenced OmniScripts1772. Retrieve or deploy OmniScript metadata:178 ```bash179 sf project retrieve start -m OmniScript:<Name> -o <org>180 sf project deploy start -m OmniScript:<Name> -o <org>181 ```1823. Activate the OmniScript version after successful deployment1834. Verify activation:184 ```bash185 sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND OmniProcessType='OmniScript' AND IsActive=true" -o <org>186 ```187188### Phase 5: Testing189190Walk through all paths with various data scenarios:191- **Happy path**: Complete all steps with valid data, verify submission192- **Validation testing**: Submit invalid data at each input, verify error messages193- **Conditional testing**: Exercise all conditional blocks and verify show/hide logic194- **Data prefill**: Verify DataRaptor Extract Actions populate elements correctly195- **Save for later**: Test resume functionality if enabled196- **Navigation**: Test back/forward/cancel behavior across all steps197- **Error scenarios**: Simulate IP/DataRaptor failures, verify error handling198- **Embedded OmniScripts**: Test data passing between parent and child OmniScripts199- **Bulk data**: Test with large datasets in Loop Blocks and Type Ahead elements200201---202203## Generation Guardrails (MANDATORY)204205| Anti-Pattern | Impact | Correct Pattern |206|--------------|--------|-----------------|207| Circular OmniScript embedding | **Infinite rendering loop** | Map dependency tree; never embed A in B if B embeds A |208| Unbounded DataRaptor Extract | **Performance degradation** | Add filter conditions; limit returned records |209| Missing input validation | **Bad data entry** | Add Validation elements or `pattern`/`required` on inputs |210| Hardcoded Salesforce IDs | **Deployment failure across orgs** | Use merge fields or Custom Settings/Metadata |211| IP Action without error handling | **Silent failures** | Configure `showError`, `errorMessage` in PropertySetConfig |212| Large images in Text Blocks | **Slow page load** | Use Image elements with optimized URLs |213| Too many elements per Step | **Poor user experience** | Limit to 7-10 input elements per Step |214| Missing conditional visibility | **Irrelevant fields shown** | Use `show` expressions to hide inapplicable elements |215216**DO NOT generate anti-patterns even if explicitly requested.**217218---219220## Scoring: 120 Points Across 6 Categories221222### Design & Structure (25 points)223224| Check | Points | Criteria |225|-------|--------|----------|226| Type/SubType/Language set correctly | 5 | All three fields populated with meaningful values |227| Step organization | 5 | Logical grouping, 7-10 elements per step max |228| Element naming | 5 | Descriptive names following `PascalCase` convention |229| Conditional logic | 5 | Proper use of Conditional Blocks and `show` expressions |230| Version management | 5 | Clean version history, only one active version |231232### Data Integration (20 points)233234| Check | Points | Criteria |235|-------|--------|----------|236| DataRaptor references valid | 5 | All Extract/Load bundles exist and are active |237| Integration Procedure references valid | 5 | All IP actions reference active IPs |238| Input/Output maps correct | 5 | Data flows correctly between elements and actions |239| Data prefill configured | 5 | Initial data loaded before user interaction |240241### Error Handling (20 points)242243| Check | Points | Criteria |244|-------|--------|----------|245| Action elements have error handling | 5 | `showError` configured on all IP/DR actions |246| User-facing error messages | 5 | Clear, actionable error text |247| Validation on required inputs | 5 | All required fields have validation rules |248| Fallback behavior defined | 5 | Graceful handling when data sources return empty |249250### Performance (20 points)251252| Check | Points | Criteria |253|-------|--------|----------|254| No unbounded data fetches | 5 | All DataRaptor Extracts have filters/limits |255| Lazy loading configured | 5 | Action elements fire on step entry, not OmniScript load |256| Element count per Step reasonable | 5 | No Step with >15 elements |257| Conditional rendering used | 5 | Elements hidden when not applicable (not just invisible) |258259### User Experience (20 points)260261| Check | Points | Criteria |262|-------|--------|----------|263| Logical step flow | 5 | Steps follow natural task progression |264| Input labels and help text | 5 | All inputs have clear labels and contextual help |265| Navigation controls | 5 | Back, Next, Cancel, Save for Later configured appropriately |266| Responsive layout | 5 | Elements configured for mobile and desktop breakpoints |267268### Security (15 points)269270| Check | Points | Criteria |271|-------|--------|----------|272| No sensitive data in client-side JSON | 5 | Passwords, SSNs, tokens kept server-side |273| IP actions use server-side processing | 5 | Sensitive logic in Integration Procedures, not client OmniScript |274| Field-level access respected | 5 | Data access matches user profile/permission set |275276---277278## CLI Commands279280```bash281# List active OmniScripts282sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE IsActive=true AND OmniProcessType='OmniScript'" -o <org>283284# Query elements for a specific OmniScript285sf data query -q "SELECT Id,Name,ElementType,PropertySetConfig,Level,Order FROM OmniProcessElement WHERE OmniProcessId='<id>' ORDER BY Level,Order" -o <org>286287# Retrieve OmniScript metadata288sf project retrieve start -m OmniScript:<Name> -o <org>289290# Deploy OmniScript metadata291sf project deploy start -m OmniScript:<Name> -o <org>292293# Check OmniScript versions294sf data query -q "SELECT Id,VersionNumber,IsActive,LastModifiedDate FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND OmniProcessType='OmniScript' ORDER BY VersionNumber DESC" -o <org>295```296297---298299## Cross-Skill Integration300301| From Skill | To sf-industry-commoncore-omniscript | When |302|------------|------------------|------|303| sf-industry-commoncore-omnistudio-analyze | -> sf-industry-commoncore-omniscript | "Analyze dependencies before building OmniScript" |304| sf-industry-commoncore-datamapper | -> sf-industry-commoncore-omniscript | "DataRaptor ready, build the OmniScript that uses it" |305| sf-industry-commoncore-integration-procedure | -> sf-industry-commoncore-omniscript | "IP ready, wire it into the OmniScript action" |306307| From sf-industry-commoncore-omniscript | To Skill | When |308|--------------------|----------|------|309| sf-industry-commoncore-omniscript | -> sf-industry-commoncore-flexcard | "Build FlexCard that launches this OmniScript" |310| sf-industry-commoncore-omniscript | -> sf-deploy | "Deploy OmniScript to target org" |311| sf-industry-commoncore-omniscript | -> sf-industry-commoncore-omnistudio-analyze | "Map full dependency tree before deployment" |312| sf-industry-commoncore-omniscript | -> sf-industry-commoncore-integration-procedure | "Need a new IP for this OmniScript action" |313| sf-industry-commoncore-omniscript | -> sf-industry-commoncore-datamapper | "Need a DataRaptor for data prefill" |314315---316317## Edge Cases318319| Scenario | Solution |320|----------|----------|321| Multi-language OmniScript | Create separate versions per Language with shared Type/SubType. Use translation workbench for labels |322| Embedded OmniScript data passing | Map parent data JSON keys to child OmniScript input via `prefillJSON`. Test data round-trip |323| Large Loop Block datasets | Paginate or limit DataRaptor results. Consider server-side filtering in IP |324| OmniScript in FlexCard flyout | Ensure FlexCard passes required context data. Test flyout sizing |325| Community/Experience Cloud deployment | Verify OmniScript component is available in Experience Builder. Check guest user permissions |326| Save & Resume (Save for Later) | Configure `saveNameTemplate`, `saveExpireInDays`. Test resume with partial data |327| Versioning conflicts | Deactivate old version before activating new. Never have two active versions for same triplet |328| Custom Lightning Web Components in OmniScript | Register LWC as OmniScript-compatible. Follow `omniscript-lwc` namespace conventions |329330**Debug**: OmniScript not rendering -> check activation status + element hierarchy | Data not prefilling -> verify DataRaptor Extract output mapping + JSON path | IP action failing -> check IP independently first + verify input map | Steps not showing -> review conditional visibility expressions331332---333334## Notes335336**Dependencies** (required): sf-industry-commoncore-datamapper, sf-industry-commoncore-integration-procedure | **Dependencies** (optional): sf-deploy, sf-industry-commoncore-flexcard, sf-industry-commoncore-omnistudio-analyze | **API**: 66.0 | **Mode**: Strict (warnings block) | **Scoring**: Block deployment if score < 67 | **Reference docs**: See `references/` for element types and best practices337338**Creating OmniScripts programmatically**: Use REST API (`sf api request rest --method POST --body @file.json`). Required fields: `Name`, `Type`, `SubType`, `Language`, `VersionNumber`. OmniScripts default to `IsIntegrationProcedure=false` (do NOT set `OmniProcessType` — it is computed). The `sf data create record --values` flag cannot handle JSON textarea fields like `PropertySetConfig`. Create child `OmniProcessElement` records via REST API for each Step and element.339340---341342## License343344MIT License.345Copyright (c) 2026 David Ryan (weytani)