You are here:
Export and Import Omniscripts
Export or import Omniscripts to use them in another org, such as when you create them in a sandbox or to use sample data packs that Salesforce provides. When exporting or importing data packs for Omniscripts, if you encounter Apex limit errors such as heap or CPU limits, reduce the size of the data pack by unselecting dependencies during the export process. Additionally, break the data pack into multiple smaller data packs. As a best practice, we recommend including no more than 10 elements in each data pack.
Export an Omniscript
To export an Omniscript in the new designer on the standard runtime, use the Salesforce CLI. Omnistudio exports the file in JSON format.
Before you begin:
- Set up Salesforce CLI.
- Authorize your org.
- Export any associated Data Mappers, Integration Procedures, and Flexcards, in
that order.
See Export or Import an Omnistudio Data Mapper, Export or Import an Omnistudio Integration Procedure, and Export and Import Flexcards.
-
From a terminal in VS Code, enter this command, and replace the variables with
values for your org.
sf data export tree --query "SELECT IsMetadataCacheDisabled, IsTestProcedure, Description, OverrideKey, Name, OmniProcessKey, Language, PropertySetConfig, LastPreviewPage, OmniProcessType, ElementTypeComponentMapping, SubType, ResponseCacheType, IsOmniScriptEmbeddable, CustomJavaScript, IsIntegrationProcedure, VersionNumber, DesignerCustomizationType, Namespace, Type, RequiredPermission, WebComponentKey, IsWebCompEnabled,(SELECT Description, DesignerCustomizationType, Name, EmbeddedOmniScriptKey, IsActive, Type, ParentElementId, PropertySetConfig, SequenceNumber, Level, Id from OmniProcessElements) from OmniProcess where OmniProcessType='OmniScript' and id='omniscript_id'" --target-org org_alias --plan --output-dir export_directory - Verify whether the JSON file is downloaded in the export directory.
Import an Omniscript
To import an Omniscript in the new designer on the standard runtime, use the Salesforce CLI.
Before you begin:
- Set up Salesforce CLI.
- Import any associated Data Mappers, Integration Procedures, and Flexcards, in
that order.
See Export or Import an Omnistudio Data Mapper, Export or Import an Omnistudio Integration Procedure, and Export and Import Flexcards.
sf data import tree --plan ./export_directory/OmniProcess-OmniProcessElement-plan.json --target-org org_alias
Export an Omniscript from the Designer on a Managed Package
Export Omniscripts in a data pack to share them with other Salesforce orgs.
- From the App Launcher, find and select Omniscripts.
- Expand an Omniscript and select the version to export.
-
Click
, and then
select Export.
- Follow the instructions and enter the information as needed.
- To store the data pack and access it from Omni DataPacks, select Add To Library.
- To store the data pack on your local machine, select Download.
- Click Done.

