Agent Script vs Subagents and Actions: When to Make an Agentforce Agent Deterministic
Every Agentforce project reaches the same argument, usually in week three. Someone demonstrates the agent doing something correct and impressive. Someone else asks what happens when it decides not to. And the room discovers that "the agent usually calls the eligibility check first" is not a sentence a compliance officer will sign.
Agent Script exists for that moment. This post is about where the line goes — which parts of an agent should be configured as subagents with actions the model may choose, and which parts should be script the model cannot route around.
Last verified against Salesforce Developer documentation on 13 September 2026.
First, the vocabulary, because it moved
- Topics → subagents. From April 2026, what the docs called agent topics are called subagents. Same concept: a bounded area of responsibility with its own instructions, scope and actions. You will still see "topic" in older material and in parts of the UI.
- Actions are executable tasks — run a Flow, call Apex, invoke a prompt template, hand off to another subagent.
- Agent Script is a compiled, declarative, block-based language (indentation-sensitive, YAML-like) that compiles to an Agent Graph, which the Atlas Reasoning Engine executes.
- Hybrid reasoning is the point of the language: deterministic instructions and generative instructions in the same block, with the deterministic ones outside the model's reach.
The two lists that decide everything
In Agent Script, actions live in one of two places, and the difference is not stylistic:
topic Refunds:
actions: # DETERMINISTIC — the script calls these
- verify_customer_identity
- check_refund_eligibility
reasoning:
actions: # GENERATIVE — offered to the LLM, called if it judges it should
- summarise_order_history
- draft_goodwill_message
topic.actions run because your logic said so. topic.reasoning.actions are a menu the model may order from.
Conditional expressions let the script branch on current context deterministically — which action to take, which prompt fragment to include — before the model is ever consulted. That is the mechanism. The skill is deciding what goes where.