How to Build, Train, and Test a Salesforce Agentforce Bot | Ep 002
Learning how to build Salesforce AI bots takes more than spinning up a chatbot. It requires understanding how to design, test, and refine agents that truly work.
In Episode 002 of AI in Action, you’ll learn the essentials of building Salesforce Agentforce agents. The episode explains what makes a strong AI prompt, why context matters in prompt engineering, and how Agentforce interprets scope and instructions. You’ll also see how Agentforce actions connect to Apex, Flows, and other automations.
Real client examples, like AI-powered insurance policy lookups, show how Salesforce AI bots deliver value in practice. Plus, you’ll find out how to test and improve agents with Salesforce’s latest tools and where to access training through the Agentblazer community.
If you’ve been asking how to build Salesforce Agentforce agents that actually work, this episode gives you the roadmap.
Listen On:
In This Episode, You’ll Learn:
- 00:00 – Intro & AI in SMBs
- 00:38 – Introducing Salesforce Agentforce
- 01:35 – What Is Agentforce?
- 02:55 – Internal vs. Customer-Facing Use Cases
- 04:10 – Upskilling on AI and Agentforce
- 05:10 – Agentblazer & Trailhead Resources
- 06:00 – Accessing Developer Orgs
- 06:45 – Free Agentforce Certification
- 07:10 – Understanding Prompts
- 08:30 – Importance of Context in Prompts
- 09:20 – Prompting as Intern Training Analogy
- 10:00 – Agentforce Prompt Structure
- 11:00 – Defining Classifications, Scope, and Instructions
- 12:45 – Writing Effective Instructions
- 13:30 – Differentiating Topics vs. Actions
- 14:00 – Example Use Case: Insurance Policy Agent
- 15:00 – Action Sequence: Identity Verification
- 16:00 – Retrieving and Restricting CRM Data
- 17:00 – Managing Agent Permissions Intentionally
- 17:40 – Managing & Testing Agents
- 18:45 – Automated Testing with Agentforce
- 19:40 – Continuous Iteration & Refinement
- 20:20 – Agentforce Community & Support Channels
Additional Resources
[EBOOK] – AI in Action: 50 Ways to Apply AI in Your Business
Einstein Flow Generation: How AI Is Changing Salesforce Automation
Getting Started With Salesforce Agentforce and AI
About Fast Slow Motion
Fast Slow Motion is a team of expert consultants that have helped hundreds of growing businesses build scalable systems on the HubSpot and Salesforce platforms. Ready to take your business to the next level?
Let’s Talk →
"*" indicates required fields
Transcript
Hey, welcome back to AI in Action. I’m Eric Housh, joined by Zack Terry, our Director of AI here at Fast Slow Motion. We’re talking about AI for SMBs, but Zack, there’s a lot of noise out there, a lot of stuff going on. I was at an executive networking session this week. We talked about AI ⁓ extensively. Everybody’s still just kind of dipping their toe in the water. There’s a lot of tools coming out, a lot of use cases emerging from deep research to legal to, of course, content.
⁓ But this show, right now we’re talking about Agentforce. We’re a Salesforce shop, a Salesforce and HubSpot consultancy. Both of these platforms really innovating in the AI space. Salesforce’s internal platform called Agentforce so that’s what we wanna talk about today. So we talked about this last time in the first episode, Zack, but give us a quick recap. What is Salesforce Agentforce?
Absolutely at its simplest Agentforce is just Salesforces ability to layer generative AI into the Salesforce platform so it can take multiple forms but the most obvious form is a chat bot so that can be an internal chat bot where you’re working within Salesforce and you’re asking an AI chat bot questions about records you’re asking you to do things for you you can customize those actions so that it can do more in depth things inside that platform but it can also be customer facing you can.
it on a website, can deploy it to SMS or WhatsApp, and it’s able to answer questions for customers and take actions for those customers that may have formerly required a human to go and take those actions. But now maybe an agent can go in and take those actions instead. So at its shortest, it’s just the ability for Salesforce to layer LLM and generative AI capabilities directly inside.
which is huge because it allows companies to leverage their own data to ground that LLM in the data that’s specific.
Exactly yes it makes for more reliable responses it makes for responses that are going to be specific to your business as opposed to more generic or something that’s just open to the entire web. It really gives you the ability to craft responses and abilities that are specific to your business process.
Zack, to me, this seems like a huge opportunity for people maybe new to the Salesforce ecosystem, maybe wanting to get into the Salesforce ecosystem or wanting to upscale. ⁓ How would somebody go about, like what tutorials, resources, whatnot are out there if somebody wanted to upscale on Agentforce?
say there’s a couple different approaches you can take. One is just AI in general, and then the other is Agent 4 specifically. If you want to just get up to speed on AI in general, there’s a ton of information out there. It can frankly be pretty hard to sort through and understand what is reality today versus what is the expectation of the capabilities tomorrow. So some of the best things to do to stay up to speed with AI in general is just to follow the right people on LinkedIn, to brush up on just
latest releases from some of the frontier models. So staying up to date with what open AI is putting out, what Anthropic is putting out with Claude, what Google is putting out with Gemini, all these sort of frontier models. And then of course, there’s a ton of other models that are getting built, small language models. It’s a lot to keep up with, right? I would say there’s a, there’s a great book out there by a guy named Ethan Malik. It’s called Co-Intelligence and it’s just sort of a primer on AI in general. It’s a couple of years old at this point, but it’s really helpful just for
understanding the context of what this technology is and more or less how it works. So it’s a good primer. Now, if we’re talking about Agentforce specifically, I’ve never seen Salesforce put so much energy and effort and resources into a product as Agentforce. So they have a ton of resources available on trailhead these days. They’ve created a whole program around it now called agent blazer status. course, everything with Salesforce is a blazer of some
a trailblazer, service blazer, sales blazer, an agent blazer, a data blazer, right? So same thing here is agent blazer, but there are sort of these tiered statuses that you can earn and it starts with the basics and it gets more advanced and they still have more content that they have yet to release. So if you’re on trailhead, if you’re a part of that Salesforce ecosystem already, you can go on a trailhead. It’ll be immediately on that sort of home screen splash page where you can get started running through those trails.
and they are very helpful. You can also go and sign up for a dedicated Agentforce and Data Cloud Developer Org, which was previously not available until TDX this year in March. So that’s an exciting update where you can go in. You don’t have to be a partner. You can just go and sign up for this org. gives you access to Agentforce and Data Cloud and your own Developer Org where you can play around with it to your heart’s content, build some agents, just sort of test how it works.
Those are kind of the two things that I would would highly recommend getting involved in. And then, of course, there is a agent for specialist certification. If you’re interested in getting certified on what Agentforce is and how to apply those concepts. And that is free through the end of this year. So if you do want to get up to speed and get certified, you can take that test for free until the end of twenty twenty five.
Zack, you mentioned step one, getting familiar with AI, right? And I think 101, right, the first step there is learning how to prompt. Tell it to us about prompts. What is a prompt? What makes a good prompt?
Yeah, prompt is essentially just what you are typing in to that agent or to that AI. So it is how you are crafting the wording to get the response that you want. And this is going to take different forms depending on A, what it is you’re trying to get, but B also which tool you’re trying to use. So with Agentforce, there’s a lot of pieces that can go into a prompt. It can be as simple as just asking an agent what to do, but because of how these agents are built on the backend,
prompt isn’t just what you’re typing into the chat window. It’s also everything that’s going on behind the scenes, the topics, the instructions that are layered into the agent that the user doesn’t see that all combines with what the user is typing in to create the prompt to give the agent the context for what it is supposed to do. It is then going to interpret what utterances and try to determine, what’s the most appropriate course of action that I can take. So
With Agent 4 specifically, think there’s a lot of different pieces that can go into it. And of course, we can chat about that. But in general, the prompt is just what you’re feeding the LLM and what it’s using to determine what it’s going to go and retrieve and what it’s going to do for you.
And we’ve done a lot of this internally. We obviously are on the forefront of leveraging AI tools of how we can streamline our business. And we found that, yeah, the more specific you can get with that prompt, the more detail you can put into it ⁓ down to ⁓ the level of, reference the brand voice on our website. ⁓ It’s almost like an iterative process. You just have to learn how the AI thinks and how to help it and coach it to get the… ⁓
response that you’re looking for.
Context really is everything. So the more contextual information that you can provide, generally speaking, the better your response is going to be. some things to keep in mind is the AI doesn’t know who you are necessarily. It’s not going to know industry terms or acronyms or technical jargon. And so you either have to provide that to the AI and the instructions are somewhere on the back end, or you have to craft that within your prompt if you’re going to.
the agent understand what’s going on, right? So generally, yeah, I think that the best advice is add as much context as possible. Now there is a line there like you can definitely add more than is necessary. So the other piece of that is be concise. So be as concise as you can be while providing all of the necessary context that that agent would need to understand what you’re asking of it. One way I think about it, and you know, this may be a little bit controversial, people are going to think about it in different ways, but
I think about an agent as sort of a new intern that we just hired at the company and we’re trying to get them up to speed on not only what their job is, but who we are as well. So transferring some of the knowledge of what we do as a business, how we think about things. If the agent we’re building is going to be sales focused, then let’s make sure the agent understands our sales processes and our stages and our emotions and what that looks like. What are the services that we offer and why do we offer them? Who do we offer?
to who are our typical customers. So providing all of that context and then layering your sort of question or your prompt on top of that is going to tend to lead to a better result than just asking a question with none of that context.
So context obviously
is huge, learning the nuances of how much context to include in a prompt. What else have you seen just in our early days of working with Agentforce? What other things kind of trip people up as they’re working and figuring out how to write prompts?
structure of Agentforce is a little bit unique. So when you go to create an agent, there’s several text boxes that are going to pop up that you have to fill out. And they’re all important to fill out correctly. So you’re going to have what’s called a classification. You’re going to have scope. You’re going to have instructions within your topics. And those are important to get right. The classification is essentially a description of what the topic is. And so that could be something like manages
customer inquiries about the order status and return requests. And I’m taking this directly from the Salesforce help as well. So this is this is in their best practices, right? ⁓ But finding that classification, getting that description correctly, that sort of provides the context for the agent of what the purpose of that topic is. And then the scope actually describes the job that the agent is supposed to perform. So whereas the classification may be you’re managing orders.
The scope could be you’re going to handle rescinding reservation confirmations, but you’re not going to create new reservations. You if you were, know, managing reservations for a hotel or something like that, right? So you start with what, what is this, right? What is this topic about? What is your job? If you discover that the user is discussing this particular topic, and then you have the actual instructions and that is going to be the prescriptive. Hey, follow this process and.
That can take several different iterations. ⁓ That’s another big thing is taking time to refine and test and iterate on on what you build out. It’s not a one time thing where you’re just going to go in and you’re going to write a bunch of instructions and that’s it. Unlikely, you’re going to get it right the first time. I can tell you that from experience. Takes quite a bit of time to go in there and get just the right wording and have the agent actually do the thing that you want it to do. So going in and making sure to write the.
instructions really clearly in a way that the agent can understand. Do I need to do something in a particular order or do I just need to generally understand how to handle this? And if you need to do it in a particular order, there’s a better way to write it than if the order doesn’t matter. You can have multiple text boxes for individual instructions. And if you need the agent to follow a specific order, it’s important that you put all of that into one text box as opposed to breaking it out into multiple.
because it may not interpret those multiple boxes in the right order. So there’s a lot of different components there. Excuse me, I think I’m about to sneeze.
Sorry. So there’s a lot of different components in terms of even just getting the topics and instructions correct. Then beyond that, there’s the actions that the agent can take. And so those can be things like apex flow, the things that Salesforce is actually going to go and handle to retrieve information. And those have its own set of descriptions and instructions as well. And so it’s important to not only be descriptive and write good descriptions for
those but also to differentiate between what gets put in an agent topic versus what gets put in an action because you want to essentially split that out. You don’t want to repeat yourself. You don’t want to write an instruction that is the same as the description of the action when the action has enough context for the agent to read and understand that. That way you can be more concise in your instructions concise and.
your action description and the agent is then able to interpret the appropriate action based on that.
That’s a lot to unpack there. It seems like for each one of those ⁓ topics, we could probably spend an entire episode just kind of talking about best practices, what to look out for, how it’s evolving. ⁓ Let’s stay on actions just for a minute because I think that’s the one that’s probably the most complex piece of this. ⁓ Give us an example. Like how can actions be used to solve like specific problems or improve workflows or things like
I’ll give you an example from a project that we implemented for a customer as a service agent. This particular customer works in the insurance industry. provide, well, they’re essentially a broker for employer health insurance plans. So for them, what they needed is for an agent to be able to answer questions about insurance policies for those customers. Instead of calling them or sending them an email, they can just ask this agent, the agent can then go and retrieve that policy information directly from within their CRM.
Now the complexity here is it’s a specific record or set of records in that CRM. So it’s not general knowledge. So A, we needed an action to verify who the customer is. So that action, when I start conversing with that agent, the first thing it’s going to do is going to ask for my email address. And then it’s going to call an action on the backend, which in this case is a flow. And that flow has two components to it. It has a custom invocable apex.
that is going to generate a random six digit code. And then the next component of that flow is an email, which is going to take the generated code and actually send that email to the customer. So that would be the action in that case. The action there is to generate and send the verification code. What actually happens is it’s calling a flow with Apex to go and send that email. So that’s that action, right? And once that customer goes and provides the code back,
and the agent verifies that code that was provided matched the generated code, then I’m allowed to ask questions about my policies. So the next action is actually it’s a combination of actions. There’s one action to go and retrieve the customer record. So I have an email address. It’s going to correspond to contact and Salesforce. So I’m going to identify that customer by email. That’s a flow. I’m going to go and get that contact record from the CRM. And as a part of that, I’m also going to pull down
The account so I understand what business this person works for right so that means fast slow motion. We’ve got the fast slow motion account inside of our CRM and then I’m going to start asking questions about my policies and that would be another action which is OK now that I know who they are and what account they work for. Let’s go and find those policy records in the system and that’s going to go and pull down information about say it’s my deductible or it’s my contract renewal date. If I have multiple policies maybe I want to.
some questions and aggregate well what’s my total amount of deductibles that I’m going to pay this year across you know my individual and my family policy whatever that could be. ⁓ The main thing there is all of those things are actions that are configured right these agents can’t just do anything out of the gate and that’s intentional we want to be really frankly intentional not to use the same word again but we want to be intentional about what we allow that agent to do so that it isn’t able to leak information we would
to be disseminating out to just anyone asking questions on the internet, right? And so we’re able to build specific capabilities for an agent to call. And the agent is essentially acting as an orchestrator here. So it’s interpreting what somebody is asking, saying, what is my best course of action based on the capabilities that I’ve been given? If I go and I call a topic based on what I’ve been discussing in that ⁓ chat component, right?
Then it’s going to say, all well, what actions do I have available to me? So if that topic is policy management, what can I do with those policies? Well, I can retrieve the records and specifically I can retrieve these three fields. I can’t retrieve any other information on the record. And that way I can only providing the information that I’ve been explicitly granted access to provide. So it was probably an over explanation of what actions are, but, in short, it’s just the agent can’t do what you haven’t given it the ability to do. And we’re just building.
those using standard Salesforce tools like flow and apex to go and retrieve information or do things in the system like update records in the CRM or you.
Yeah, so it’s striking me, know, obviously building an agent is a lot more complex than I originally thought it was just because we have to think through these nuances and we have to kind of take these steps with the classifications, the scope, the instructions, the actions. ⁓ You mentioned earlier that it’s not a set it and forget it thing. You’ve got to manage these agents until you’re convinced that they’re doing the job properly. Talk to me about how you manage an agent.
The biggest thing is testing. So making sure that you are asking a number of different questions worded in different ways to determine how that agent is going to respond. Now obviously that is pretty difficult to do at scale. So there are tools built in to Salesforce and built into Agentforce that can allow you to use AI to generate test scenarios. So if you want to generate a thousand test utterances,
You can do that with AI and it’ll spit out a spreadsheet that you can then feed to Agentforce Testing Center and it will run through all those 1000 utterances and say, all right, based on this question, I called this topic and I called this action. And then you can say, you’re basically telling it, well, when I asked this question, you should call this topic and you should call this action. So then it compares that basically what it actually did versus what you expected it to do. And it spits out a pass fail.
And so you can go through and you can say, well, I noticed when I asked variations of this question, it doesn’t tend to call the topic that I expect. And what that can tell me is maybe I need to go in and write some better instructions or I need to reword how I have written those instructions so that the agent can better understand what it is I’m asking for, what topic it should classify the question in, and therefore which actions it should be calling within that topic. So testing is huge.
And just going into it with the understanding that it is going to be something that will be refined over and over and over again, really like anything in Salesforce and in technology. Almost nothing is just set it and forget it. It’s a game of maintenance. It’s a game of constant refinement. It’s also a game of just staying on top of the latest technology and releases. So AI is really no different there. The difference is you’re using plain language.
a lot of cases to provide those instructions as opposed to writing code. And so ⁓ it’s just a little bit different in terms of how you think about it. Instead of going and doing a code review, you’re really reading the instructions and you’re saying, it doing what I expect based on what I’ve written? And then you’re rewriting it to see if it can interpret it in the way that you expect.
So Zack, clearly a lot to learn. We’re encouraging everybody out there, get on ⁓ Agent Blazer, get out there, start learning the tools, get the development org, start playing around with it. ⁓ What about community? Like, is there a spot people can go as they’re starting to get their hands dirty with this, starting to learn Agentforce, the ins and outs, and how to speak? ⁓ Where can people go kind of for help and support?
There is absolutely a community. there is an agent blazer community on the Salesforce Trailhead community that you can join. But beyond that, there’s also a dedicated slack channel. So ⁓ Salesforce has provided a dedicated space on slack where essentially the whole community that’s building agents and working with Agentforce can hop in and help solve problems with each other.
So it’s a great resource. People are posting questions. You can go in there and you can claim a question if you’ve run into that problem before and work through that answer together. If you’re running into a problem that you don’t know how to solve, you can post a question there. So I think the Slack community is great. I think you tend to get quicker responses than posting just on a community forum, but I love the Trailblazer community. I’m an active member of it and that’s a great place to go and ask questions as well. definitely two really great options if you’re looking for a community.
people building agents on Agentforce.
Awesome, Zack. Always good to catch up with you. Until next time, my friend.
All right, thanks Eric, appreciate it.







