Agentforce Configuration: Topics, Actions, and Agent Script
Topics do the routing
A topic is defined by a name, a description the planner reads to decide whether a request belongs here, instructions that constrain tone and behavior inside the scope, and the actions it may use. Routing quality is a description problem, not a code problem - vague or overlapping topic descriptions are the number-one cause of an agent answering in the wrong scope or refusing.
Actions do the work
An action exposes an input/output contract to the planner. Flows must be autolaunched (no screens); Apex must expose an invocable method with invocable variables; prompt templates must be grounded in a record or retrieved source. Every input and output needs a clear description and a sensible type, because the planner fills inputs from conversation and reads outputs back to the user. Mark outputs as displayable or internal deliberately.
Agent Script
Agent Script is the text-based representation of the same agent definition - variables, instructions, topics, and action wiring expressed as code. It matters for version control, review, and promoting an agent between orgs. Know the trap: script and canvas are two views of one definition, so edits made in one place can overwrite the other if you are not deliberate about which is the source of truth.
Traps
- An action that exists in the org but was never assigned to a topic will never fire.
- Correct action, unhelpful answer: usually a thin output description, not a model problem.
- Confirmation and escalation are configuration choices, not automatic behavior.
- Do not assume an action available in a commercial org is deployable in every government environment.
Rule of thumb
No action fires → check topic assignment. The wrong action fires → rewrite action descriptions. The action fires but the reply is empty → fix output descriptions and types.