Sub topic 10
Writing descriptions that steer the choice
This chapter assumes you know what topics and actions are, and that the reasoning engine picks a topic and then an action from the text you configure. Here you will learn how to write that text so the agent picks correctly.
Why descriptions matter
The agent cannot see your Flow logic or Apex code. It sees names, labels, and descriptions. When two actions look alike in that text, the model guesses. Most "the agent chose the wrong action" problems are description problems, not model problems.
Descriptions appear in four places, and each one steers a different decision:
| Where | What it steers |
|---|---|
| Topic classification description | Whether a request enters this topic |
| Topic scope | What the agent should and should not do inside the topic |
| Action label and description | Whether the action is called |
| Input and output descriptions | What value is passed in and how the result is read |
Describe the situation, not the implementation
A good description says when to use the item and what it returns. A weak one says how it works.
- Weak: "Runs the OrderStatus flow."
- Better: "Looks up the current status of an existing order by order number. Use when the customer asks where an order is or when it will arrive."
Include the trigger phrases a customer would use, in the customer's words rather than your object names.
State boundaries
Neighboring topics and actions compete, so say what each one does not do. The Order Support topic from earlier chapters does this in its scope line: "Does not process returns, refunds, or changes to an order." That sentence keeps a refund request from landing in the wrong topic.
Classification description: Handles customer questions about the status of an existing order, such as where it is or when it will arrive.
Scope: Look up order status and explain it. Does not process returns, refunds, or changes to an order.Write input descriptions the model can fill in
The model fills action inputs from the conversation. A clear description tells it which value to extract. In the Apex example, the variable description does this work.
@InvocableVariable(label='Order Number' description='The order number the customer provided' required=true)
public String orderNumber;If the input is required=true and the customer has not given it, the agent should ask. Pair this with an instruction such as "Ask for the order number if the customer has not given one."
Compare a weak and a strong pair
Suppose a topic has two actions with these descriptions:
- Get Order: "Gets an order."
- Get Case: "Gets a case."
For "Where is my package?", nothing tells the model which one fits. Rewrite them:
- Get Order Status: "Looks up the shipping status of an order by order number. Use for questions about delivery or tracking."
- Get Case Status: "Looks up the progress of a support case by case number. Use for questions about an open support request."
Now the request's words ("package", "delivery") match one description.
Common errors
- Overlapping descriptions across actions or topics, which makes the choice a coin flip.
- Vague labels such as "Process Request" or "Helper".
- Internal jargon that customers never say.
- Instructions that contradict the scope.
- Very long descriptions that bury the key condition. Put the main purpose first.
Practice
Exercise
A topic has two actions: "Update Record" (description: "Updates a record") and "Update Shipping Address" (description: "Changes the delivery address on an open order. Use when the customer wants to ship to a different address. Does not change items or payment."). A customer says, "Please send it to my new apartment." Which action is the agent more likely to choose, and how would you improve the other description?
Show answer
It will most likely choose Update Shipping Address, because its description matches the customer's intent and wording. Improve "Update Record" by stating which record and which fields it updates and when to use it, for example "Updates the contact phone number or email on a customer's profile. Use when the customer wants to change contact details. Does not change orders." Clear boundaries keep the two from overlapping.
Exercise
Rewrite this description so it steers action selection better: "Calls the RefundFlow."
Show answer
For example: "Submits a refund request for a delivered order, given the order number and the reason. Use when the customer asks for their money back. Does not check order status or change the order." It says what the action does, when to use it, what it needs, and what it does not do.