Agent Script Reference: After Reasoning
Agentforce runs a topic's after_reasoning block after the reasoning block, on every request. The after_reasoning block can contain logic, actions, transitions, or other directives, but can't contain the | (pipe) command. Typical use cases are to set customer-entered information into a variable, transition to a different topic, or run an action.
For example, this after_reasoning block sets the appointment duration based on the urgency level.
To see how Agentforce creates an LLM prompt from a topic that contains an after_reasoning block, see Example: How Agentforce Creates a Prompt from a Topic.
Agentscript also supports a before_reasoning block with the same capability and syntax as the after_reasoning block. The before_reasoning block is functionally equivalent to adding logic to the beginning of a topic's instructions.
If a topic transitions to a new topic partway through execution, the original topic's after_reasoning block isn't run. When calling transitions in after reasoning, use transition to rather than @utils.transition to. For example: