Sub topic 16
Best practices and common pitfalls
This chapter assumes you can add standard actions to a topic in Agentforce Builder, write topic instructions, and read the conversation preview. It collects the habits that keep agents reliable and the mistakes that most often break them.
Keep topics narrow
A topic should cover one job, such as account support. Each topic's classification description and instructions are what the agent uses to pick a topic. Broad or overlapping topics cause the agent to choose the wrong one.
- Give each topic a classification description that says what it handles and, where useful, what it does not.
- Attach only the actions that topic needs. A long action list makes the wrong choice more likely.
- Split a topic when its instructions grow long or start containing unrelated rules.
Write instructions that guide, not shout
Instructions work best as short, ordered, testable rules. Say when to use an action, in what order, and when to ask the user.
Topic: Account Support
Instructions:
1. When the user names an account, first find the account record, then use the result for any later step.
2. Before updating a record, restate the field and the new value and ask the user to confirm.
3. If you cannot find exactly one matching record, ask the user to clarify instead of guessing.Avoid vague rules such as "be careful with data". Name the action and the condition instead.
Name and describe actions clearly
The agent reads action names, descriptions, and input descriptions when it decides what to run. Clear text improves selection and slot filling. If you edit an action, describe what it returns and what each input means, in plain language.
Common pitfalls
| Pitfall | Effect | Fix |
|---|---|---|
| Updating a record without first finding it | The action gets no record ID, or the wrong one | Instruct the agent to look up the record first and reuse the result |
| No confirmation before a change | The agent writes values the user did not approve | Add a step to restate the change and ask |
| Too many similar actions in one topic | The agent picks the wrong action | Remove actions the topic does not need |
| Guessing when several records match | The agent acts on the wrong record | Tell the agent to ask for clarification |
| Testing only the happy path | Failures appear in production | Test ambiguous, missing, and out-of-scope requests |
| Testing as an admin only | Access problems stay hidden | Test with a user who has the real permissions |
Test and check access
Run each conversation in the preview and inspect which actions ran, in what order, and what they returned. Fix the instruction or action text, then rerun the same conversation.
Actions run on behalf of a user, so sharing rules and field-level security still apply. A result that looks empty may be an access limit, not an agent error. Confirm the user's permission sets before you change instructions.
Decide between standard and custom
Use a standard action when it already does the job. Move to a custom Flow, Apex, or prompt template action when you need logic the standard actions lack, such as a count of open cases. Keep custom actions small, with described inputs and outputs.
Exercise
A user asks the agent to change a contact's phone number. The agent updates the wrong contact because two contacts share a name. Which two instruction changes reduce the risk?
Show answer
First, tell the agent to look up the record and ask the user to clarify if it does not find exactly one match. Second, tell it to restate the field and new value and ask for confirmation before it updates anything.