When using Hyper-Classifier in an Agentforce agent, mandatory logic configured through state-based routing actions might not execute before the agent selects a topic.
The Hyper-Classifier runs as a pre-orchestration step. It evaluates the user's utterance and routes the request to the topic that is most semantically relevant. This routing decision occurs before the agent evaluates state-based routing conditions.
For example, an agent might have a User Verification topic with a condition such as:RunningUserValidated == False
If the user asks a business-related question, such as "Give me a summary of this account," Hyper-Classifier might select the relevant business topic instead of the User Verification topic because the User Verification topic is not semantically related to the request.
In this situation, the RunningUserValidated == False condition is evaluated later and does not force the User Verification topic to execute before the business topic. As a result, logic that was expected to run as a mandatory precondition might be skipped.
This behavior is expected platform behavior and is not specific to a particular agent. Hyper-Classifier routing and state-based routing conditions operate in separate execution phases.
Symptoms
When this issue occurs, the agent might intermittently fail to complete a request and display:
"I apologize, but I encountered an unexpected error."
You might also notice:
For logic that must execute unconditionally on every turn before topic selection, use the before_reasoning lifecycle hook.
Move mandatory logic, such as populating EndUserId and EndUserName, into the before_reasoning hook on agent_router.
The before_reasoning hook executes before Hyper-Classifier makes its routing decision. This ensures that mandatory logic runs before any topic or subagent is selected, regardless of which topic Hyper-Classifier chooses.
Recommended execution flow:before_reasoning → Mandatory initialization/pre-processing → Hyper-Classifier → Topic selection → Downstream reasoning
Important
before_reasoning for logic that must execute on every turn.
Example
If an agent must populate EndUserId and EndUserName before any downstream processing, place that logic in before_reasoning rather than in a state-gated routing action.
This ensures the required user variables are populated on every turn before Hyper-Classifier selects a topic.
Using before_reasoning for mandatory logic provides consistent execution regardless of which topic is selected for the user's request.
005390902

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.