Improve recommendations with Next Best Action and Agentforce

Deliver Improved Recommendations Through Next Best Action and Agentforce

By

Have you ever wished you could give your users exactly the right guidance at just the right moment? That’s the magic of Next Best Action! Whether it’s helping a sales rep spot the perfect opportunity for a follow-up or guiding a service agent with a recommended solution, Next Best Action allows you to create custom recommendations that show up exactly when and where they’re needed.

With Next Best Action, you can leverage Salesforce’s powerful flow automation to set up recommendation strategies tailored to your unique business needs. And now, with added support for Agentforce and artificial intelligence (AI) integrations, you can pair structured recommendations with advanced AI insights. Ready to level up your game in delivering actionable advice? Let’s dive into what Next Best Action can do for you!

The power of Agentforce + Next Best Action

Next Best Action has always been tightly integrated with predictive AI tools through custom Apex actions, but now, you have the full power of Agentforce as well. Combining this declarative approach with the power of both predictive and generative AI tools available in Salesforce can yield incredibly powerful results. You’ll get the most value from this synergy if any of the following are true.

  1. You have complex recommendation strategies built in Flow Builder.
  2. You need guardrails on what your Agentforce agents can recommend to your users or customers.
  3. You want to guarantee that your Agentforce agents will make the right recommendation 100% of the time.

Next Best Action Setup page

Configuration

How do you configure Next Best Action end to end? There are four steps.

1. Create recommendation records for a certain object (for example, Account, Contact, Lead, Opportunity).

Tip: If you anticipate building a lot of recommendations, you might want to add custom “category” and “ranking” fields to the Recommendation object, just like you would add any custom field, to help with sorting and ordering your recommendations.

2. Create autolaunched or screen flows that run when recommendations are accepted or rejected.

3. Create a recommendation strategy flow in Flow Builder to determine which recommendations are surfaced on the record page of your chosen object.

Tip: An example recommendation strategy flow is shown below. To recommend the next best action to take on a lead, the flow splits into three paths based on the size of the lead’s company, retrieving different recommendations targeted to each use case.

Example of a recommendation strategy flow

4. Add the Einstein Next Best Action component to the record page of your chosen object to see the recommendations you created, along with buttons to accept or reject the recommendations.

Starting with Winter ’25, you can also add a Next Best Action component to an Experience Cloud site or even create an Agent Action from your recommendation strategy flow (more details below). 

How to use Agentforce with Next Best Action

1. Create a custom Agent Action from your recommendation strategy flow. Make sure to specify to the agent what the recordId input is, which is the Record ID field of the record you’re surfacing recommendations for (for example, Account, Opportunity, etc.), and what the outputRecommendations output is, which is a collection of recommendation records you’re displaying to the user. Also, be sure to checkmark the ‘Require input’ field on the input and the ‘Show in conversation’ field on the output. For more information on creating Agent Actions, check out this Help doc.

The Create an Agent Action screen, with fields for Reference Action Type, Reference Action, Agent Action Label, and Agent Action API Name.

Tip: To streamline your business processes even further, you can create custom Agent Actions that run when your recommendations are accepted or rejected, allowing your users to take action on recommendations simply by asking their agent. 

2. On either an existing agent or a new one, create a new topic for your Next Best Action. For more specific instructions on creating a topic, check out the Help documentation on Agent Topics. Once you create your topic, add the Recommendation Strategy Agent Action, plus any other custom actions you created, to your Next Best Action topic.

The Create a Topic screen, with fields for Topic Label, Classification Description, and Scope.

Recommended, not required: Add the standard Agent Action ‘Identify Record by Name’ to your Next Best Action topic if you want your users to be able to ask for recommendations for a record by name, not ID. You can also browse through the library of standard Agent Actions available and add any more actions to your topic that are relevant for your use case. 

3. Add as many instructions to your Next Best Action topic as you want. You can specify how to display recommendations to the user, how to retrieve the recommendations, when to use each action, what order to perform the actions in, if you need additional user input for certain actions, etc. You can also add Example User Inputs to help your agent determine what types of requests should be routed to this topic. For more guidance, there’s a handy Help doc on best practices for writing topic instructions.

Adding instructions to a Next Best Action topic.

4. Test your agent by chatting with the Conversation Preview in Agent Builder. In this view, you can try out sample prompts and watch your agent select a topic, select actions, and then return recommendations. To improve your agent’s accuracy and performance, continually adjust and refine your topic classification description, scope, instructions, and example user inputs.

The Conversation Preview feature in Agent Builder.

5. Click Activate to activate your agent! Now, from any Salesforce app, you can ask your agent questions and get recommendations back. For example, in the screenshot below, you can see our agent recommending an NVIDIA GPU that we can sell to Salesforce.

An agent making a recommendation, with questions and replies on the right.

Then you’re done! Have fun using the Next Best Action framework to improve the accuracy and relevancy of recommendations from your Agentforce Agents, whether that’s a Service Agent recommending a solution to a customer or a Custom Agent recommending what steps to take next to convert a lead for your sales reps. 

Note: To use Agentforce, Salesforce users must have the Einstein Copilot User for Salesforce permission set group assigned to them.

How can you get Next Best Action?

You can get access to Next Best Action through either the Service Cloud Einstein License or the Additional Next Best Action Requests License. 

If you have the correct licenses, you can start using Next Best Action in Setup (it comes enabled by default). If you don’t see it, make sure you have the Manage Next Best Action Strategies user permission enabled. 

For more information, check out this Help doc on entitlements.

Moving away from Strategy Builder

Next Best Action originally launched with the ability to create strategies through Strategy Builder, a tool with robust capabilities for creating strategies but not much else. Since then, we’ve completely matched the capabilities of Strategy Builder with Recommendation Strategy Flows in Flow Builder*.

Furthermore, since Strategy Builder was built back when Next Best Action was originally released, it hasn’t had access to any of the countless enhancements that have come to Flow Builder since. If you use Flow Builder instead of Strategy Builder, you immediately get access to:

  • Our full library of 450+ Standard Invocable Actions, ranging from Approve a Deal to Send Slack Message to Summarize Customer Engagement
  • Connectors to external systems like Jira, Quickbooks, Netsuite, or other Salesforce orgs
  • Full Agentforce integration for recommendation strategy flows
  • Subflow elements to clean up more complicated recommendation strategies
  • Create flows using generative AI with Einstein for Flow
  • Visual debugging
  • Custom property editors in Actions and Screen components
  • Reusable formulas
  • Versioning
  •  Packaging support
  •  Accessibility features

Because of this, Strategy Builder has become a legacy tool that has fallen far behind the capabilities of Flow Builder. For those of you who already have recommendation strategies built in Strategy Builder, here’s a guide on how to recreate your strategies in Flow Builder.

*The only remaining feature available in Strategy Builder and not in Flow Builder is the Einstein Load Node, which retrieves recommendations from Einstein Recommendation Builder. However, both Einstein Recommendation Builder and Strategy Builder will be sunset in the near future, so we advise moving to Flow Builder as soon as possible.

Final thoughts

We’ve covered a lot here—from setting up and configuring Next Best Action to supercharging your strategies with Agentforce and Flow Builder. With these tools in hand, you’re ready to deliver the right recommendations to the right users at just the right time. Plus, moving to Flow Builder means you’ve got even more flexibility and control, with access to all those amazing connectors and actions to make your strategies shine.

And if Agentforce sounds like it could give your team that extra boost, Next Best Action brings both precision and AI power to the table, so your recommendations are spot-on every time. Use these tips to keep building those winning strategies—your team (and your users) will thank you for it!

Resources

Get Started With Agentforce: Custom Actions

Get Started with Agentforce: Custom Actions

Editor’s note: This post was updated on November 15, 2024, with the latest information and resources. As Salesforce continues to revolutionize how users interact with the Einstein 1 Platform, Agentforce is poised to provide a new and exciting layer of artificial intelligence (AI)-powered conversations for your users. Agentforce is your trusted AI assistant for CRM […]

READ MORE
Boost your study routine with flows and email-to-text gateways

Boost Your Salesforce Certification Study Routine with Flows & Email-to-Text Gateways | Automate This!

Welcome to another “Automate This!” In this live-streamed video series, we cover all things automation, from use cases and best practices to showcasing solutions built by Awesome Admin Trailblazers like you. With automation, you can remove manual tasks, drive efficiency, and eliminate friction and redundancy. In this episode, let’s see how Bradley Condon built the […]

READ MORE
Modular Flows + Agentforce for Smarter Automation

Embrace Modular Flows to Build Smarter Automation for Agentforce

Automation is one of our superpowers as Salesforce Admins, and modular flows make that power even stronger. If you’ve noticed, flows are everywhere! Your flow-building expertise is key to preparing your company for Agentforce by creating custom flow actions for agents. However, as we shift toward building autonomous agents, we must rethink our approach from […]

READ MORE