omnistudio-omniscript-generate
OmniStudio OmniScript creation and validation with 120-point scoring. Use when building guided digital experiences, multi-step forms, or interactive processes that orchestrate Integration Procedures and Data Mappers. TRIGGER when: user creates OmniScripts, designs step flows, configures element type
By forcedotcom · 4,639 installs
npx skills add forcedotcom/sf-skills --skill omnistudio-omniscript-generate
Source repository · Upstream listing
omnistudio omniscript generate: 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 : [PASS] 90+ (Deploy) [REVIEW] 67 89 (Review) [BLOCK] <67 (Block fix required)
Scope
In scope : Creating OmniScripts from requirements, element selection and PropertySetConfig design, dependency analysis (Integration Procedures, DataRaptors), data flow tracing, 120 point validation scoring, deployment and activation
Out of scope : Building FlexCards (use omnistudio flexcard generate ), creating Integration Procedures directly (use omnistudio integration procedure generate ), mapping full dependency trees (use omnistudio dependencies analyze ), deploying metadata to org (use platform metadata deploy )
Required Inputs
Gather these before building:
Input Description Default
Type Process category (e.g., ServiceRequest , Enrollment ) None — required
SubType Specific variation (e.g., NewCase , UpdateAddress ) None — required
Language Locale for the OmniScript English
Purpose Business process this OmniScript guides None — required
Target org Org alias for deployment Current default org
Data sources Objects/APIs to query or update Identify from requirements
Core Responsibilities
1. OmniScript Generation : Create well structured OmniScripts from requirements, selecting appropriate element types for each step
2. Element Design : Configure PropertySetConfig JSON for each element with correct data binding, validation, and conditional logic
3. Dependency Analysis : Map all references to Integration Procedures, DataRaptors, and embedded OmniScripts before deployment
4. Data Flow Analysis : Trace data through the OmniScript JSON structure — from prefill through user input to final save actions
CRITICAL: Orchestration Order
omnistudio dependencies analyze → omnistudio datamapper generate → omnistudio integration procedure generate → omnistudio omniscript generate → omnistudio flexcard generate (you are here: omnistudio omniscript generate)
OmniScripts consume Integration Procedures and DataRaptors. Build those FIRST. FlexCards may launch OmniScripts — build FlexCards AFTER. Use omnistudio dependencies 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
Run scripts/check duplicate omniscript.sh <Type <SubType <Language <org to verify no duplicate Type/SubType/Language exists.
Build the OmniScript :
1. Create the OmniProcess record with Type, SubType, Language, and OmniProcessType='OmniScript'
2. Create OmniProcessElement child records for each Step (Level=0)
3. Create OmniProcessElement child records for each element within Steps (Level=1+, ordered by Order field)
4. Configure PropertySetConfig JSON for each element
5. 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):
Phase 4: Deployment
1. Prerequisites : Verify org auth ( sf org display o <org ). Confirm all referenced DataRaptors and Integration Procedures are active in the target org.
2. Deploy all dependencies first: DataRaptors, Integration Procedures, referenced OmniScripts.
3. Run scripts/deploy omniscript.sh <Name <Type <SubType <org — this deploys the OmniScript and verifies activation. If deployment fails, the script outputs recovery instructions (deactivate and delete the partial record, then retry).
4. Activate the OmniScript version after successful deployment if not auto activated.
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
Rules / Constraints
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
Integration Procedure (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
Typ