Sub topic 12
Aligning Actions with Topic Instructions
This chapter assumes you can write action names, labels, and descriptions, and that you have set required inputs and output visibility on an action. It also assumes you know that a topic groups related actions under natural-language instructions.
Two layers of guidance
The agent reads two kinds of text when it decides what to do.
- Action metadata describes one action alone: what it does, what each input means, and what each output contains.
- Topic instructions describe how the actions work together inside a topic: when to use each one, in what order, and how to talk about the results.
If the two layers disagree, the agent has to choose between them, and its behavior becomes hard to predict. Aligning them means each fact lives in one place, and the other layer refers to it without contradicting it.
| Guidance | Put it in | Example |
|---|---|---|
| What an input means and its format | Input description | "The order number the customer provided, for example 00000101." |
| What an output contains | Output description | "Empty if no order was found." |
| When to use an action, and in what order | Topic instruction | "Use Get Order Status when the customer asks where an order stands." |
| What to say after a result | Topic instruction | "If the message says no order was found, ask the customer to check the number." |
An aligned example
The Get Order Status action from the earlier Apex example asks for an order number and returns a status and a message. These topic instructions work with it:
You help customers with questions about existing orders.
When a customer asks where their order stands, use Get Order Status.
If the customer has not given an order number, ask for it before calling the action.
Report the Result Message to the customer in your own words.
If no order was found, tell the customer and ask them to check the number.
Do not give a status unless Get Order Status returned one.Each line lines up with the action definition:
- The instruction uses the action's label exactly,
Get Order Status. - The instruction to ask for the number matches the input description ("Ask the customer if it was not given") and the input being required.
- The instruction to use the Result Message matches an output described as a plain-language outcome that covers the not-found case.
Common mismatches
These are the errors that appear most often when the layers drift apart.
- Different names. The instruction says "look up the order" but the action is labeled
Get Order Status. Use the label verbatim. - Conflicting input rules. The instruction says "assume the most recent order" while the input description says "Do not guess." Pick one rule and state it in both places.
- Hidden outputs. The instruction tells the agent to quote a field that is not visible to the agent. Check output visibility settings against what the instruction needs.
- Duplicated detail. The instruction repeats the input format ("an eight-digit number") and the format later changes in the action. Keep format details in the input description only.
- Silent failure paths. The instruction covers only the success case, so the agent improvises when the action returns an empty result or an error. Add one line for each outcome your action can return.
Checking alignment
Read the instructions and the action metadata side by side. For each action named in the instructions, confirm the following:
- The label matches exactly.
- Every input the instruction says to collect exists, and its required setting agrees with the instruction.
- Every output the instruction refers to exists and is visible to the agent.
- Each result the action can return has a matching instruction, including the empty result.
Then test with real utterances, including a missing order number and a number that does not exist, and review which action the agent chose and what values it passed. The next chapter covers that testing loop.
Exercise
A topic instruction says "Look up the customer's order and read back the Status field." The action is labeled Get Order Status, its Order Number input says "Do not guess," and its Order Status output is not visible to the agent. List three problems with this setup and how to fix each.
Show answer
(1) The instruction does not use the action's label, so name Get Order Status explicitly. (2) The instruction does not say to ask for the order number when it is missing, so add a line to collect it, which matches the "Do not guess" input description. (3) The agent cannot see the Order Status output, so it cannot read the field back. Make the output visible to the agent, or have the instruction use an output the agent can see. You should also add a line for the not-found case.