Dynamically Deliver and Enhance Next Best Action Recommendations from Salesforce Objects or External Data Sources
Where: This change applies to Lightning Experience in Essentials, Professional, Enterprise, Performance, Unlimited, and Developer editions.
Why: Generate and Enhance elements help you programatically scale your integrations by providing efficient new ways to create and modify large numbers of recommendations dynamically.
Instead of defining recommendations manually as records in Salesforce, you can use the Generate element. Connect this element to an Apex action that returns a list of recommendations and those recommendations will become part of the current strategy execution. This functionality allows personalized recommendations to be created dynamically in situations where the large number of possibilities makes manual recommendation creation inconvenient. For example, if you have a product database with 200,000 products, you don’t want to create 200,000 recommendations one at a time.
Need smarter recommendations? The Enhance element allows you to use AI-driven predictions from services such as Einstein Discovery and Einstein Prediction Builder to enhance recommendations with additional information, such as propensity scores, from a connected external datasource.
Let’s look at an example. Your company is an auto parts dealer with a large catalog of parts and accessories and you use a screen flow to recommend parts to your customers based on a car’s make, model, and year. Instead of creating a single, static recommendation for each individual part or accessory, you can maintain that information in the Product object in Salesforce or use SQL to retrieve data from an external database. Use a Generate element with an Apex invocable action to call the Apex class and generate part and accessory recommendations dynamically for your strategy.
Now assume that your company integrates separate datasources from the manufacturers of the parts and accessories you sell, and those datasources include information about the current availability of each item (in stock, back ordered, or unavailable). You can connect an Enhance element to your strategy’s Load or Generate element to provide that availability information to users in the recommendation.
How: To use the Enhance or Generate recommendation element, just drag it onto the canvas of your Next Best Action strategy. Select the Apex action. Note that an Apex class must have a method marked as an invocable method in order to appear as an Apex action in declarative tools like Strategy Builder.

