Sub topic 6
Checking that actions run with the right inputs
This chapter assumes you can open the conversation preview in Agentforce Builder, send a test utterance, and see which topic the agent chose. It also assumes your agent has at least one topic and one action. Here you check the next step: whether the agent runs the right action and passes it the right inputs.
What an action run involves
An action is a task the agent can perform, such as looking up an order. After the agent picks a topic, it decides whether to call one of that topic's actions. If it does, it must fill in each input the action needs. It gets those values from the customer's message, from earlier turns in the conversation, or from instructions you wrote.
A wrong topic is easy to spot because the reply is off. A wrong input is harder to see. The agent can run the correct action with an empty, guessed, or misread value and still sound confident. So check the inputs directly instead of judging the reply alone.
Four things to verify
For each test utterance that should trigger an action, check these in order:
- The action was called. Some requests should run an action and the agent answers from general text instead.
- It was the correct action. Two actions with similar names or descriptions can be confused.
- Each input has the right value. Compare the value in the trace with what the customer typed.
- The reply matches the result. The agent should report what the action returned and not add details.
Use the test-record template from the plan to keep this consistent:
Test: "Where is my order 00012345?"
Expected topic: Order Status
Expected action: Look Up Order (input: order number 00012345)
Expected reply: States the order's current status
Result: pass or fail
Notes: If it fails, record the topic and action shown in the reasoning trace.Worked example
Send the first starter utterance in the preview:
Where is my order 00012345?Open the reasoning trace for that turn and look at the action step. A passing run shows the action name Look Up Order and an order number input of 00012345. The reply then states the order's status.
Now try a variant:
I bought shoes last week and they haven't arrived.The customer gave no order number. There are two acceptable outcomes. The agent can ask for the order number, or it can use one already available in context. A failing outcome is the agent calling Look Up Order with an invented or blank number. If you see that, the action was run too early. The fix is usually in the instructions, for example:
Before using Look Up Order, confirm that the customer has given an order number. If they have not, ask for it. Do not guess an order number.After you change the instruction, reset the conversation and send the same utterance again to confirm the change worked. The next chapters cover that loop in detail.
Common input problems
| Symptom in the trace | Likely cause | What to try |
|---|---|---|
| Action not called, agent answers from its own text | Action description doesn't match the request, or the topic instructions don't say when to use it | Rewrite the action description and add a "use this action when..." instruction |
| Wrong action called | Two actions have overlapping descriptions | Make each description say what it does and what it does not do |
| Input is blank or invented | Instructions don't say to ask for missing values | Tell the agent to ask first and never guess |
| Input is formatted badly, such as extra words around the order number | The input description is vague | Describe the expected format in the input's description |
| Action runs on a request that should be refused | Guardrail instructions are missing or too weak | Add a clear instruction for when not to run the action |
Simulated versus live results
The test mode you chose earlier affects what you can conclude. In simulated mode, the action result is generated for you, so you can confirm that the agent picked the right action and inputs. You cannot confirm that the real action works. In live mode, the action actually runs against your org's data, so you can also check the result. Live runs can change real records, so use test data when an action creates or updates something.
Testing the edge utterances
Run the other starter utterances too. The request to change a shipping address may have no matching action. The expected result is that the agent says it can't do that or hands off, and doesn't call a nearby action such as Look Up Order. The request to ignore instructions and reveal other customers' orders should not run any lookup. Record the trace for each so that you can see the "no action" result as a pass.
Exercise
You send "Where is my order?" with no order number. The trace shows the agent called Look Up Order with the order number input set to "12345". What went wrong, and what is one change you can make?
Show answer
The agent invented a value for a required input instead of asking the customer. Add an instruction to the topic, such as "If the customer has not given an order number, ask for it before using Look Up Order. Never guess an order number." Then reset the conversation and rerun the same utterance to confirm the agent now asks.
Exercise
In simulated mode, an action test passes with the correct inputs. Does that prove the action works against your org's data? Why or why not?
Show answer
No. Simulated mode generates the action result, so it only shows that the agent chose the right action and inputs. Use live mode with test data to confirm the real action returns the expected result.