Get Started with Agentforce: Custom Actions

Get Started with Agentforce: Custom Actions

By

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 — built into the flow of work for any application, employee, and department. With Agentforce, Salesforce Admins will empower users with AI in the flow of work, configuring and deploying agents to increase productivity. Once the agent is activated, users can engage their agent with questions and instructions, which are sent to the large language model (LLM) to identify and execute the most relevant business actions. Out-of-the-box actions, such as summarizing records and answering questions with Knowledge, help to complete business tasks faster and generate trusted, natural language responses grounded in your CRM data. Out of the box, Agentforce can:

  • Summarize Salesforce records, such as opportunities, contacts, accounts, leads, and cases
  • Draft or revise sales emails
  • Find Salesforce records
  • Aggregate Salesforce data
  • Answer questions with information from your Knowledge base

In the upcoming months, Salesforce and our partners will continue to deliver more actions, so that Trailblazers can quickly embrace this new technology and realize a rapid return on their investment.

As admins, you’ll be able to not only utilize the standard actions provided by Salesforce but also create custom ones. Agent custom actions allow users to tailor the AI assistant’s capabilities to their unique business needs, enhancing its effectiveness and usability. From updating multiple fields on records to calling external systems to retrieve information, custom actions can significantly enhance business productivity and efficiency.

As admins remain at the forefront of new features, including AI, understanding how they work and how to best implement them for your users continues to be important. By enabling features like Agentforce and Prompt Builder for your users, you can lead AI transformations at your company. This post provides an overview of how to utilize Agentforce to best suit your organization’s needs.

Typical use cases for Agentforce

As the technology behind Agentforce evolves and customers continue to explore its capabilities, we can expect a plethora of use cases to emerge. Currently, the use cases it covers best include:

  1. Research and Information Retrieval: Agents can retrieve Salesforce records and provide concise summaries to answer questions based on a given context.
  2. Content Creation: Agentforce is a valuable tool in the creation of high-quality text for various purposes, from drafting professional emails to creating engaging marketing materials.
  3. Text Mining and Sentiment Analysis: Agentforce is capable of extracting valuable information from various Salesforce fields and gauge text sentiment.

What you should generally not use Agentforce to do

While Agentforce is a powerful tool designed to enhance productivity, it’s important to understand the scenarios where it may not be the best fit.

Agentforce accesses and processes data to provide intelligent assistance. However, if your organization deals with highly sensitive or regulated data, there might be concerns about data privacy and security. It’s crucial to ensure that data handling complies with all relevant laws and regulations.

The real-time accuracy and response time of AI-powered agents may not meet the stringent requirements of performance-critical tasks. In scenarios where every millisecond counts, such as real-time control systems, Agentforce might not be the best fit.

Tasks requiring advanced scientific computing or highly specialized analytical capabilities might be beyond the scope of Agentforce. The precision, accuracy, or specialized computational capabilities required for such tasks may not be within Agentforce’s capabilities.

While Agentforce offers some level of data interaction and analysis, it might not be suited for complex data analytics tasks that require sophisticated statistical analysis or predictive modeling. For these tasks, specialized analytics platforms like Tableau are more appropriate.

What powers an agent custom action?

The true power of Agentforce is in agent custom actions, as Trailblazers can adapt the agent to work with autolaunched flows, invocable actions, and custom prompt templates. This unlocks an infinite number of use cases for you to explore at your company, ranging from updating multiple fields on records to calling external systems to retrieve information.

Agentforce does the heavy lifting of giving access to an LLM on the Einstein 1 Platform. There are three ways that you can build agent custom actions: flows, prompts, and Apex. You can begin customizing by utilizing the automation skills you’ve learned by building out flows. Agentforce has a revolutionary means of interacting with an autolaunched flow that allows users to use natural language to kick off the process.

Agent custom actions can also be paired with prompt templates created via Prompt Builder to generate results, meaning the new talents of prompt engineering will have an all-new angle to it. Prompt Builder allows our customers to create prompts that are grounded with CRM data residing inside Salesforce or brought from external sources using Data Cloud. This grounding means that more context will automatically be added to the prompt when sent to the LLM which will directly lead to an improvement in response quality and accuracy.

Finally, developers can use Apex to provide functionality not included in Flow or Prompt Builder. Indeed, agent custom actions can launch invocable actions which can be extremely powerful in terms of use case coverage.

Creating a custom action is very simple. In Salesforce Setup, navigate to Agent Actions, click Create A New Action, and simply select which flow, Apex, or prompt template you would like to use. Focus particularly on accurately describing the action, along with its inputs and outputs. Ultimately, this will become the most intricate aspect of developing a custom action, as the language model will depend on these descriptions to determine when to initiate and carry out the action.

The role of descriptive instructions in agent custom actions

So, why is it essential to accurately describe a custom action, as well as its inputs and outputs? Because the LLM that powers Agentforce, such as OpenAI GPT-4, uses text to understand context, generate output, and execute actions. So, the more structured and precise your instructions, the better the LLM performs.

Configuring Agent Actions in Setup.

When writing your descriptions, keep these six things in mind:

  1. Clarity: Descriptive instructions convey your exact intent to the LLM, leading to more accurate and helpful responses.
  2. Context: Since LLMs lack an understanding of the context, providing descriptive information supplies the necessary context for more relevant responses.
  3. Efficiency: Detailed queries can save time by reducing the need for clarifying ambiguous requests.
  4. Information Retrieval: When tasks involve pulling in external information, being descriptive can aid the LLM in understanding exactly what information is needed.
  5. Disambiguation: Descriptive queries help in differentiating between similarly named objects or concepts, or even actions.
  6. Model Understanding: Descriptive instructions help in understanding the capabilities and limitations of the LLM, enabling you to gauge how well it comprehends and responds to complex queries.

Remember, it’s crucial to evaluate how Agentforce responds to various requests using the Agent Builder. Introducing a custom action enhances Agentforce’s capabilities and offers it more choices. Therefore, ensuring that Agentforce selects the appropriate actions after adding more custom actions is essential. If it doesn’t make the right choices, there’s no need for concern — simply refine your descriptions to modify its behavior. Generally, we advise our customers to evaluate Agentforce’s performance with approximately 30 utterances per action to determine whether it aligns with their business requirements.

Best practices for creating agent custom actions

Use agent standard actions before going custom

Before diving into creating agent custom actions, it’s advisable to use the Agent Standard Actions that Salesforce provides. These standard actions are built by Salesforce’s Platform team and will save you time on testing. They’re designed to cover a wide range of common tasks and may suit your needs without requiring customization.

Ask the right questions

Before creating a custom action, consider whether Agentforce would make for a better, faster, or simpler experience. Ask if the action fits in the Agentforce interface and if it’s best facilitated in a conversational interface. Also, consider whether the agent custom action requires turn-based interactions and how it would chain with other actions.

Be careful about entry points, inputs, outputs, and turn-taking

When designing your agent custom action, pay close attention to entry points, inputs, outputs, and turn-taking. Your entry points should consider both user utterances and additional entry points such as buttons on a page, where the user will be (record page, etc.). The inputs should clearly define what information is required for your agent custom action to run, while the outputs should specify what Agentforce will execute and display back to the user. If your agent custom action includes turn-taking interactions, document the steps carefully. You might even consider reusing the output of an agent custom action as an input for the same action, for instance, if you wish for Agentforce to further refine the output.

Prepare your utterances to test the action

Think about what a user might say to trigger your action and craft strong descriptions to help Agentforce’s services identify when to execute your action. This will drastically help you to test if your action is being picked up correctly by Agentforce. Again, it’s recommended to test with 30 diverse utterances, using different linguistic styles, alternating between formal and informal language, employing abbreviations, and varying date formats, among other tactics.

Seek quality over quantity

When it comes to creating custom actions, focus on quality over quantity. A well-designed and thought-out action is more valuable than numerous poorly designed ones.

Harnessing the power of agent custom actions

Agentforce is a conversational experience that lives inside the Salesforce user interface (UI). Agent custom actions can unlock its full potential and allow you to cover many of your uses cases by reusing powerful Salesforce automation technologies that you know and love (invocable actions, autolaunched flows, prompt templates, and more).

Agent custom actions give Trailblazers the flexibility to customize their Salesforce experience to suit their unique needs. By following the best practices outlined in this post, you can unlock the full potential of this innovative feature and drive efficiency in your operations — and truly make Agentforce yours.

We encourage you to explore these features in your own businesses. For further inquiries or a demo request, contact us and meet us at our various events. Harness the power of Salesforce Agent Custom Actions today and take your business to the next level.

Discover more resources to get started with Agentforce

Product Announcements You Might Have Missed in 2023.

Product Announcements You Might Have Missed in 2023

In the Spring ’23, Summer ’23, and Winter ’24 Salesforce Releases, Salesforce launched hundreds of new features. Make sure you’re up to date on the latest and greatest features for admins by reading about the new features admins were most excited about this year.  Lightning Experience enhancements From new Dynamic Forms enhancements to the Prompt […]

READ MORE
Governance strategies for your first AI project

AI and Agentforce: Governance Strategies for Your First AI Project

There is a lot of excitement around artificial intelligence (AI) right now. New uses and new models are changing the way we think about how AI can support and improve the ways we work.  At Dreamforce ’24 one of the big announcements was Agentforce, a powerful companion to help Salesforce users resolve cases, answer questions, […]

READ MORE
Prepare for the AI Specialist Exam and Agentforce

Prepare for the Salesforce AI Specialist Exam and Agentforce

As Salesforce Admins, we have clear core responsibilities that define our day-to-day roles. We manage users, data, and product, provide actionable analytics, and oversee security. But we’re currently in the third wave of the artificial intelligence (AI) revolution: contextual and generative AI, characterized by prompt-based generative AI, real-time AI applications, and autonomous agents.  This means […]

READ MORE