Sub topic 1
What a Topic Is and the Fields You Write
Prerequisites
This chapter assumes you have:
- Basic familiarity with Salesforce and Setup.
- A working idea of what an AI agent and a large language model (LLM) are.
- A basic idea of Agentforce agents, topics, and actions.
- Access to Agentforce Builder, so you can open an agent and preview a conversation.
You don't need to write code. The examples are plain text, because a topic is written mostly in natural language.
What a topic is
An Agentforce agent handles many kinds of requests, such as order questions, return requests, and product questions. A topic is one bundle of behavior for one kind of request. It groups three things:
- A description that tells the agent what requests belong to the topic.
- A statement of what the topic will and will not do.
- Instructions and actions that tell the agent how to respond once the topic is chosen.
The agent reads your wording as the basis for two separate decisions. First it decides which topic a request belongs to. Then, inside that topic, it decides what to say and which action to run. Most topic problems come from mixing these two jobs. A description that tries to coach behavior routes badly. Instructions that try to attract requests are never read at the right moment.
Everything you write in a topic is guidance given to an LLM. The model follows it with good reliability, but it does not execute it like code. Keep this in mind for the rest of the tutorial. Later chapters cover which rules should leave the instructions and become a Flow or Apex action.
The fields you write
Agentforce Builder shows a topic as a set of fields. Labels can differ slightly between releases, so match the purpose of each field rather than the exact label.
| Field | Question it answers | Used for |
|---|---|---|
| Name | What do people call this topic? | Identification by you and by the agent |
| Classification description | What requests belong here? | Choosing the topic |
| Scope | What does this topic do and not do? | Setting the topic's limits |
| Instructions | How should the agent behave here? | Shaping the response after the topic is chosen |
| Actions | What can the agent run here? | Doing work such as looking up a record |
The sections below take each field in turn.
Name
The name is a short label, such as "Order Status". It is easy to treat it as decoration, but the agent can see it, so a name that contradicts the description confuses routing. Use a specific noun phrase that matches the customer intent, and avoid catch-alls such as "General" or "Other".
Classification description
The classification description tells the agent which requests this topic handles. It is the field the agent consults when it picks among topics. Write it as a statement of customer intent: what the customer is trying to find out or get done.
Here is a description that works:
Handles customer questions about where an existing order is, when it will arrive, or whether it has shipped.It names the customer, the object (an existing order), and three concrete intents. A reader can tell what falls inside it and what falls outside it. Chapter 3 covers this field in detail. For now, remember that it is written for routing and should read like a definition of the requests it matches.
Scope
The scope says what the topic does and what it deliberately leaves alone. It is a boundary statement. In the Order Status example it reads:
Look up the status of an existing order and explain shipping and delivery information. Does not cancel, change, or refund orders, and does not answer product questions.The second sentence matters as much as the first. Naming what the topic will not do gives the agent a clear signal when a request is close to the topic but not in it. A request to cancel an order sounds related to Order Status, but the scope says this topic does not cancel orders.
Scope and classification description overlap in subject but differ in purpose. The description helps the agent pick the topic. The scope states the topic's limits once the topic is picked, and it helps you and your team see where one topic ends and the next begins.
Instructions
Instructions tell the agent how to behave after the topic is selected. They cover what to ask, what to check first, how to phrase an answer, and when to use an action. The agent reads them as a set of rules for the conversation in this topic.
Compare two versions of the same guidance:
Weak:
Be helpful with orders and don't make mistakes.
Stronger:
1. Ask the customer for their order number if they have not provided one.
2. Use the order number to look up the order before describing its status.
3. Give the current status and the expected delivery date in one or two sentences.
4. If the order cannot be found, say so and ask the customer to check the number. Do not guess a status.The weak version states a goal but gives nothing to check. The stronger version names observable behavior in order. In a test conversation you can verify each step: did the agent ask for the number, did it look the order up first, did it avoid guessing when the lookup failed? Instructions you can test are instructions you can fix.
Actions
Actions are the things the agent can run, such as a Flow, an Apex method, or a prompt template. They are assigned to the topic, and the agent can use only actions available in the selected topic. Your instructions decide when an assigned action runs. Chapter 7 covers how to reference actions and state their conditions. Two conditions with one expected behavior each look like this:
If the customer asks for the status of an order, use the Get Order Status action with the order number.
If the customer asks to return an item, tell them you can't process returns in this topic and offer to transfer them to a human agent."Get Order Status" is a hypothetical name. In your own topic, use the exact name of an action assigned to that topic.
How the fields work together
The fields act at different moments in a conversation. The description and name come into play when the agent chooses a topic. The scope, instructions, and actions come into play after that.
This sequence has three consequences for how you write.
- Routing wording and behavior wording live in different fields. If you want requests to reach the topic, fix the classification description. If the topic is reached but the reply is wrong, fix the instructions.
- A topic that is never chosen never runs its instructions. Excellent instructions cannot rescue a vague description.
- An action is available only inside its topic. If an instruction refers to an action that is not assigned to the topic, the agent cannot run it.
A complete example
Putting the fields together for the Order Status topic gives this:
Topic name: Order Status
Classification description:
Handles customer questions about where an existing order is, when it will arrive, or whether it has shipped.
Scope:
Look up the status of an existing order and explain shipping and delivery information. Does not cancel, change, or refund orders, and does not answer product questions.
Instructions:
1. Ask the customer for their order number if they have not provided one.
2. Use the Get Order Status action with the order number before describing the status.
3. Give the current status and the expected delivery date in one or two sentences.
4. If the order cannot be found, say so and ask the customer to check the number. Do not guess a status.
5. If the customer asks to cancel, change, or return an order, say this topic cannot do that and offer to transfer them to a human agent.
Actions:
Get Order StatusNotice what each field leaves out. The description doesn't say how to phrase replies. The instructions don't re-argue which requests belong here. The scope doesn't list steps. Each field keeps to its job.
Common errors
These are the mistakes people make most often when they first fill in these fields.
- Writing a description as a mission statement. "Helps customers with anything about orders" matches too many requests and competes with neighboring topics. Name the intent.
- Putting routing hints in the instructions. Text such as "Use this topic when the customer mentions shipping" belongs in the classification description. By the time the agent reads instructions, it has already chosen the topic.
- Leaving the scope empty or copying the description into it. The scope should state limits, including what the topic does not do.
- Writing goals instead of steps. "Be accurate" cannot be tested. "Look up the order before describing its status" can.
- Referring to an action by a loose name. If the instruction says "check the order" but the assigned action is named Get Order Status, you invite the agent to guess. Use the exact name.
- Giving two topics near-identical descriptions. The agent has no basis to prefer one, so requests land in either.
The last error is the one most worth seeing side by side:
Overlapping:
Topic A description: Answers questions about orders.
Topic B description: Helps customers with order problems.
Distinct:
Topic A description: Looks up the status and delivery date of an existing order.
Topic B description: Starts a return or refund for an order the customer says arrived damaged or incorrect.In the overlapping pair, a message like "my order is wrong" fits both. In the distinct pair, each description names a different customer intent, so the agent can send each request to one topic.
Checking your work
You can review a topic by asking one question per field.
- Could someone read only the classification description and tell whether a given request belongs here?
- Does the scope name at least one thing the topic does not do?
- Is every instruction a step or a condition you can verify in a preview conversation?
- Does every action named in the instructions exist, by exact name, in the topic's action list?
- Does the description differ clearly from every neighboring topic's description?
If you answer no to any of these, the fix is usually in one field, and the answer tells you which one.
Exercise
A customer types "Where is my package?" The agent chooses the correct Order Status topic, but its reply guesses a delivery date without looking anything up. Which field do you edit first, and what kind of change do you make?
Show answer
Edit the instructions. The topic was chosen correctly, so the classification description is working. Replace vague wording with an ordered, testable step such as "Use the Get Order Status action with the order number before describing the status," and add a rule such as "If the order cannot be found, say so. Do not guess a status."
Exercise
A teammate writes this classification description for a new topic: "Use this topic when the customer is upset. Always apologize first and offer a discount." What is wrong with it, and where should each part go?
Show answer
It mixes routing and behavior. "When the customer is upset" is an attempt to describe which requests match, but it names a mood instead of an intent, so it will overlap with other topics. "Apologize first and offer a discount" is behavior and belongs in the instructions, after a topic is chosen. The description should name the customer's intent, such as reporting an order that arrived damaged. The discount rule probably needs a Flow or Apex check as well, which later chapters cover.
Exercise
Why does the Order Status scope include the sentence "Does not cancel, change, or refund orders"?
Show answer
A request to cancel an order sounds close to Order Status. Stating what the topic will not do sets a clear limit, so the agent does not treat nearby requests as in scope. It also tells the team where a neighboring topic is needed.