Import Asset Bundle with scripts
important
For 9.x ODF versions, go to the related ODF 9.x documentation.
Previously, it took a long time to transfer a Business Process with all dependencies. It required multiple operations and manual steps, in-depth model knowledge, Nexus, and s3 credentials.
With the Asset Bundle import feature, everything required for a BP delivery is now conveniently wrapped in a self-sufficient package, which can be ported to a target environment in few simple steps. The import mechanism supports large files and is less error-prone than traditional methods. Successful import is asynchronous—meaning fast—and verified by a checksum. This accelerates BP delivery, decreases the total cost of development, and eventually contributes to continuous integration.
note
For development teams, the recommendation is to follow publish with the Maven approach.
Check before import
- Prepare an Asset Bundle. It can be provided to you by WorkFusion or created in-house. If you don't have an Asset Bundle, you can create one manually or using Maven and ODF.
- AutoML supports 10.x and 10.x-compatible models. 9.2.x and 9.3.x AutoML models transfer requires additional actions. For details, see Migrate 9.x AutoML models to 10.x. AutoML models earlier than 9.2.x are not supported.
- Be careful when including Global Variables into the Asset Bundle
datastoredirectory. Global Variables typically contain environment-specific data. Doing so, you will re-write Global Variables for the entirety of Business Processes (BPs) on a target instance. - The maximum allowed Asset Bundle size is 3 GB. If an Asset Bundle is larger, split it into several bundles and import them one by one.
- Data Stores, AutoML models, BCBs, standalone Rules, Automation Training Sets, Templates (including Macro), Use Cases, and S3 files with the names already present on a target instance are re-written upon import.
- In case a Business Process with the name already present on a target environment is imported, Control Tower behavior depends on whether the source and target BPs are identical.
- If the BP is the same, a new instance is created within the BP definition of the same name.
- If the source BP changes significantly (a step or rule added or removed, a Bot Config changed, a Manual Task inside a step changed), the new BP definition is created instead. Schedules run the new BP definition instead of the old one.
Import Asset Bundle with SSO enabled
Whether you are using SSO or not determines which username or password the import script utilizes. When importing an Asset Bundle with SSO enabled, you cannot use your SSO ID or password. The recommended approach is as follows:
- Disable SSO. In the console, run the following command:
wf.sso.saml.enable=false
- Restart Control Tower by running:
wfmanager restart workfusion
- Log in to WorkFusion with the pre-SSO id or password.
- Create a special REST API user and enable the Advanced Package Import and Import/Export permissions.
- Enable SSO by running:
wf.sso.saml.enable=true
- Restart Control Tower by running:
wfmanager restart workfusion
Now, SSO is enabled, and you can use that REST API user ID and password for REST API authentication.
Deploy Asset Bundle
- Prepare an Asset Bundle. Asset Bundles can be generated by Control Tower of versions 9.2.2 and 10.1.
- Make sure you have the necessary permissions in Control Tower. These are Advanced Package Import and Import/Export.
- If a Business Process with the same name exists on the target instance, stop the BP to update it.
- Download the script for your operating system:
- Windows, TLS 1.1: Asset-Bundle-import-Windows-tls11.ps1
- Windows, TLS 1.2: Asset-Bundle-import-Windows-tl12.ps1
- Linux: Asset-Bundle-Import-Linux.sh
- macOS: Asset-Bundle-Import-Mac.sh
- Follow the instructions for your operating system:
Windows
Windows:
Run PowerShell in a mode that bypasses the Script Execution Policy by executing the command below.
powershell -executionpolicy bypass
Specify the path to the script directory by executing the following command in the console:
cd <path to the script directory>Execute the above-mentioned script, providing relevant variables. When using SSO, you will need to additionally configure credentials as the standard CT credentials won't work.
.\Asset-Bundle-Import-windows.ps1 -ctHost '<Control Tower Host URL>' -ctUser '<ct username>' -ctPassword '<ct password>'The Control Tower Host URL must not end with '/'. See the example below.
.\Asset-Bundle-Import-windows.ps1 -ctHost 'https://demoserver.workfusion.com/workfusion' -ctUser 'demouser' -ctPassword 'demopassword1!@@#'After the script starts successfully, a file selection dialog window opens. Select the zip file of your Asset Bundle.
Linux
Linux:
Run Terminal.
Execute the following command:
cd <path to the script directory>Execute the script mentioned above, providing relevant variables. When using SSO, you will need to additionally configure credentials as the standard CT credentials won't work.
./Asset-Bundle-Import-Linux.sh '<path to Asset Package>' <Control Tower Host URL> '<ct username>' '<ct password>'The Control Tower Host URL must not end with '/'. See the example below.
./Asset-Bundle-Import-Linux.sh 'C:\\demo-folder\\demo-package.zip' https://demoserver.workfusion.com 'demouser' 'demopassword1!@@#'
macOS
macOS
Run Terminal.
Execute the following command:
cd <path to the script directory>Execute the script mentioned above, providing relevant variables. When using SSO, you will need to additionally configure credentials as the standard CT credentials won't work.
sh Asset-Package-Import-Mac.sh <path to Asset Package> <Control Tower Host URL> <ct username> <ct password>The Control Tower Host URL must not end with '/'. See the example below:
sh Asset-Package-Import-Mac.sh /Users/Demouser/Demo-package.zip https://demoserver.workfusion.com demouser demopassword1!@@#
The console shows the progress of the operations. In the end, you will see the status of the import procedure.
Login successful Asset Bundle <C:\Users\John_Appleseed\Downloads\negativenews-package-10.1.zip> Import has started Checking import status: Import in progress, attempt 1 Checking import status: Import in progress, attempt 2 Checking import status: Import in progress, attempt 3 Checking import status: Import in progress, attempt 4 Checking import status: Import in progress, attempt 5 Checking import status: Import in progress, attempt 6 Checking import status: Import in progress, attempt 7 Checking import status: Import in progress, attempt 8 Checking import status: Import in progress, attempt 9 Checking import status: Import in progress, attempt 10 Checking import status: Import in progress, attempt 11 Checking import status: Import in progress, attempt 12 Checking import status: Import in progress, attempt 13 Checking import status: Import in progress, attempt 14 Checking import status: Import in progress, attempt 15 Checking import status: Import in progress, attempt 16 Asset Bundle Import job finished with status: SUCCEEDED C:\Users\John_Appleseed\Downloads>- If the status is Succeded, proceed to Control Tower and check the imported assets.
- If the status is Failed, open the import summary file located in the script directory, read error messages, correct the bundle, and repeat the import procedure.
If you prefer to import an Asset Bundle using REST API endpoints, refer to the Asset Bundle Migration API page.
Check after import
- Check the BP and its structure, workflow, components, Manual Tasks automation settings.
- If you imported an Asset Bundle that contains a BP with automated manual tasks, you need to select the Accuracy threshold values for all models and Activate Cognitive Bots on the AutoML tab of the BP designer page.
- If your BP uses Global Variables and these Global Variables are not present in the Asset Bundle, configure them manually on the target environment.
Mind known issues
- If you import a modified AutoML model artifact, it must have a version different from the one present on the target environment. Otherwise, BP execution will fail until BEP is restarted.
- Repeatable import of the Composite type Rules results in duplicates created across an instance.