I've created an Apex class to fetch Account records based on user input (e.g., "Any renewals available in May 2025", "Any records for renewal for next month"). Here's what I've done so far:
- Created the Apex class and verified it works correctly in Prompt Builder.
- Added this Apex class as a Prompt Builder action.
- In AgentForce, created a topic that calls this Prompt Builder action.
- Created a text variable called user_input and mapped it to the action input.
- Granted access to the Apex class for the Einstein Agent User profile.
However, when testing the AgentForce topic, the action does not get triggered. Instead, I receive a fallback message like: "It looks like I can't directly check for account renewals right now. You might want to check your Salesforce dashboard or contact your admin for this information. If you need help with anything else, feel free to ask!"
- The Apex class returns a response in Prompt Builder when tested manually.
- Variable mapping (user_input) is added in the Action Input.
Is there anything else required to ensure AgentForce executes the Prompt Builder action correctly?
Are there additional permissions, deployment steps, or AgentForce quirks I might be missing?
Any help would be appreciated!
#Agentforce
Hello @DEONA SHERINE
1. In Agentforce Builder -Topics -Account Record Display, ensure the instruction matches the input. Make it specific.
2.In the Prompt Builder, verify that the Apex action is active and user_Input is mapped correctly.
3. Confirm Einstein Agent User has "Run Apex" Account object access and "AgentForceAccess permission set.
4. Use Batch Test in Agentforce Builder. Check the debug logs for errors.
5. Rephrase vague input.Reactivate the agent if needed.