Sub topic 6
Writing descriptions the agent can act on
This chapter assumes you know Flow Builder basics (variables, resources, elements) and have already marked variables as available for input and output. If not, read the previous chapter on defining input and output variables first.
Why descriptions matter
The agent's language model does not run your flow's logic. It reads text about the flow and decides whether to call it and what to pass in. That text comes from three places:
- The flow's own description.
- The name of each input and output variable.
- The description of each input and output variable.
If these are vague, the agent picks the wrong action, asks the user for the wrong value, or passes a value in the wrong format. The flow itself can be correct and still fail in practice.
Describe the variables
Here are the two variables from the case lookup flow, as they appear in flow metadata.
<variables>
<name>caseNumber</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
<description>The Case Number of the case to look up, for example 00001026.</description>
</variables>
<variables>
<name>caseStatus</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>true</isOutput>
<description>The current Status of the case, or a short message if no case was found.</description>
</variables>Each description does a specific job:
caseNumbernames the business concept (Case Number), not the technical one (a string). It also gives an example, so the agent knows the expected format.caseStatussays what the value means and covers the empty case. The agent will know to expect a message instead of a status when nothing matches.
What a good description contains
- What the value is, in the words a customer or user would use.
- The format, with one example when the format is not obvious (dates, IDs, codes).
- Allowed values, if the field is limited to a set. List them.
- What happens in edge cases, mainly for outputs: no record found, an error, a blank field.
Compare these two descriptions for the same input.
| Weak | Better |
|---|---|
| `Case` | `The Case Number of the case to look up, for example 00001026.` |
| `Date` | `The date the customer wants to be contacted, in YYYY-MM-DD format.` |
| `Status` | `The current Status of the case, or a short message if no case was found.` |
The weak versions force the model to guess. It might send a case record ID (a long Salesforce ID) where you wanted the Case Number.
Name variables for humans too
The model reads variable API names, so use clear ones. caseNumber is better than var1 or inputText. Avoid names that look alike, such as status and caseStatus in the same flow, because the agent may confuse their roles.
Describe the flow itself
The flow's description tells the agent what the whole action does. Write it as one or two sentences that state the task and the outcome. For example: "Looks up an existing case by Case Number and returns its current status." Leave out implementation details like which elements it uses. The agent does not need them.
Description versus action instructions
Descriptions live in the flow and travel with it. Action instructions are set later, when you register the flow in Agent Builder, and they are specific to one agent topic. The next chapters cover registration and instructions. The split works like this:
- The description says what the thing is.
- The instructions say when and how this agent should use it.
Keep each in its own place so you can reuse the flow in another agent without rewriting it.
Common errors
- Leaving descriptions blank. Blank is the default, and the agent then relies on the name alone.
- Describing the build, not the meaning. "Text variable used in Get Records" tells the agent nothing useful.
- Contradicting the data type. Do not describe a Boolean as "Yes or No" if the flow expects
trueorfalse. - Overlong descriptions. A paragraph per variable adds noise. One or two sentences is enough.
Exercise
A flow has an input variable named d with the description "Date". The agent often sends dates like "next Tuesday". The flow expects a calendar date. Rewrite the name and description so the agent sends a usable value.
Show answer
Rename the variable to something meaningful, such as appointmentDate, and describe it with the format and its purpose, for example: "The date of the appointment, in YYYY-MM-DD format, for example 2026-12-15." The format and example let the agent convert "next Tuesday" into a calendar date before calling the flow.