- Instructions resolve top to bottom. Logic lines run. Prompt lines become English.
- The model never sees your script. It sees only the finished prompt your logic built.
- Shorter reasoning instructions produce more accurate agents. Verbosity is not thoroughness.
├─ 2.1 Anatomy of one turn
├─ 2.2 How the prompt gets built
└─ 2.3 Why shorter instructions win
Anatomy of One Turn
- Every request begins at
start_agent, including the very first one. - The router classifies the message to exactly one subagent, and can also set starting variable values.
before_reasoningthen runs, on every request. It is deterministic setup — run actions, set variables, or transition away entirely.reasoning.instructionsresolve top to bottom. Logic lines execute; prompt lines accumulate; conditions gate what gets included.- The finished prompt goes to the model, which starts reasoning only at that point.
- The model may call tools from
reasoning.actions, and those results feed back into the loop. after_reasoningruns when reasoning completes, on every request. Guards, escalation, logging.- The reply goes out and a trace records the whole path.
- One rule with teeth: if a subagent transitions away partway through, its own
after_reasoningdoes not run.
Rule: know the seven steps in order. Every Agentforce design question resolves to one of them.
Gain: you can place any behaviour on the timeline and say exactly why it happened.
Price: none. This is the model, not a feature with a cost.
Limits: 60-second action timeout. Apex limits apply inside the turn, and the ReAct loop can call one action several times.
Mirror — treating the agent as a black box: you end up tuning prompts by trial and error with no theory of the failure.
Later: this sequence is also your debugging order. Read the trace in the same order the turn ran.
At volume: long reasoning chains cost credits and add latency. On voice, latency is dead air.
Core Q&A
A: Take it in order, because the order is the whole point.
- Every request starts at the agent router, which classifies the message to exactly one subagent and can set initial variables.
- That subagent's
before-reasoningblock runs next — deterministic setup, on every request. - Then the
reasoning instructionsresolve top to bottom. Logic lines execute actions and set variables; prompt lines build up English; conditions decide what gets included. - The finished prompt goes to the model. It starts reasoning only at that moment, and it sees nothing but that prompt.
- It may call tools from the reasoning actions list, and results loop back.
after-reasoningthen runs any final guards, and the reply goes out with a trace recorded.- The catch worth naming: if the subagent transitions away partway through, its own
after-reasoningnever runs.