Work with Embedded App Auto-Install Requests
Embedded app templates can create apps without any custom code, but you can add customizations to your embedded app lifecycle. Create Apex classes that use the CRM Analytics auto-installer to create and manage auto-install requests for your embedded app.
The CRM Analytics auto-installer is a metadata-based API that manages the lifecycle of a CRM Analytics templated app. No user access to CRM Analytics Studio and the template configuration wizard is required.
The auto-installer provides management functionality for embedded apps. Creating customized runtime functionality requires knowledge of Apex. Auto-install requests can also be managed via Analytics CLI Plugin commands or using Connect API REST calls.
Concurrent Auto-Install Requests
The auto-installer uses asynchronous processing that allows a maximum of 10 Enqueued, InProgress, or AppInProgress requests at a time. Until existing requests complete their cycle or their RequestStatus is updated to Cancelled, no more requests can transition from New to Enqueued.
App-Specific Concurrent Requests
No app-specific auto-install WaveAppDelete, StartDataflow, WaveAppUpdate requests can be Enqueued until existing requests that are in progress are completed or canceled with the same folder id.
Cancellation Policy
If an auto-install request is canceled, the auto-installer attempts to abort the request, but there’s no guarantee when or if the request can be aborted.
These use cases show how to create customized auto-install app management using Apex code. Examples include enabling CRM Analytics in the install org, configuring the app creation settings, and creating and updating embedded apps.
CRM Analytics Enablement
Any use of a CRM Analytics templated app requires the CRM Analytics preference to be enabled before an app can be created and managed.
The CRM Analytics auto-installer can automatically enable this preference so any other auto-installer task can be taken. The auto-installer can enable or disable any of these preferences based on the Auto-Installer configuration specified by the API caller:
- CRM Analytics Replication
- Sharing Inheritance
Apex Example
For information on auto-install requests and auto-install configuration metadata, see:
WaveAutoInstallRequestreferenceAutoInstallAppConfigurationRepresentationreference.
App Create
The WaveAppCreate auto-install task creates a CRM Analytics app based on the TemplateApiName and values specified by the caller.
After the app creation process is complete, the auto-install request is updated automatically by the app template framework. If deleteAppOnConstructionFailure is set to true and the app fails to create, the app is automatically deleted.
App Update
The WaveAppUpdate auto-install task performs an upgrade or reset on an existing CRM Analytics app based on the TemplateApiName, the FolderId of the app, and values specified by the caller.
After the app update is completed, the app template framework automatically updates the auto-install request. If deleteAppOnConstructionFailure is set to true and the app fails to update, the app is automatically deleted.
App Delete
The WaveAppDelete auto-install task simply deletes an existing CRM Analytics app based on the TemplateApiName and FolderId that the caller specifies.
No auto-install requests can be in progress for the specified folder id when the delete request is enqueued.
Start Dataflow
The StartDataflow auto-install task executes a dataflow for the specified folder. Dataflow execution is only allowed for apps that are based on an Embedded App template.
After the dataflow is completed, the templating framework automatically marks the auto-install request as completed.
Guaranteed Execution Order
The CRM Analytics Auto-Install Request framework is dependent on asynchronous processing, making it impossible to assure ordering of multiple auto-install requests.
To create request ordering, that auto-installer uses auto-install request dependencies, which guarantee that one auto-install request runs and finishes before another related auto-install request executes. Auto-install request dependencies don’t guarantee that dependencies are executed before other enqueued requests that aren’t part of the dependency chain.
Auto-install requests that have dependencies on other requests must have a status of New to be auto-enqueued by the framework. Dependencies with any other status are ignored.
If any auto-install request in the request hierarchy fails for any reason (including canceled), subsequent related requests auto-fail as well.
Request dependencies have these limits:
- A single auto-install request can depend on up to 10 other auto-install requests, directly or indirectly through the dependency chain.
- All parent auto-install requests must exist and be in
Newstatus before the child can declare a dependency on a parent request.
To monitor auto-install requests, use the Auto-Installed App page in Setup. For more information, see Monitor, Update, and Delete Auto-Installed Apps.
You can also create and manage auto-install requests using the Salesforce Analytics Plugin CLI and CRM Analytics REST API endpoints.
To use the Analytics Plugin auto-install commands, see the autoinstall Commands reference.
To use the CRM Analytics REST API, see the Auto-Install Requests List Resource and the Auto-Install Requests Resource references.