Skip to main content

Scenario: agentforce is handling a claim, asks the user upload a picture through a screen flow (sends a URL to the screenflow that references the created record through an agent action)  The challenge: the user has to come back to the agent and tell them "I have uploaded the picture"  The expectation: the agent should "know" the picture has been uploaded automatically  The attempt: I built an apex trigger on "contentDocumentLink" that ticks a box on the messagingSession. I added an instruction to the agent saying "monitor context variable checkbox "picture uploaded" and automatically acknowledge picture upload" but agentforce doesn't seem to be monitoring the changes to the checkbox. Does the agent even have access to context variables that are added after the chat has started?    Note: there's a paper clip on the chat window, but as soon as I add a file to it via the paperclip icon, the agent escalates to a human.    Please, let me know if there are any ways to "inject" a message based on a trigger to the agentforce agent to let them know a user has done something or if I can somehow modify the paperclip behavior.   

9 answers
  1. Feb 3, 2025, 10:40 AM

    Hi @Piotr Breda 

     

    I understand your concern, and I appreciate your patience. My goal is to provide helpful responses based on available Salesforce resources and best practices. Also my intend is not to provide the generic content from the AI tools. I am helping to people to resolve the issue based on my experience and I can simply ignore your question. But, I am keep trying to respond and trying to solve your issue.   

     

    To answer you Initial Issue :   

     

    To clarify, based on my research, there isn't a direct Apex method to send a message internally to a MessagingSession without an external callout. If you’ve already explored the Messaging API, it seems that using an HTTP callout remains the recommended approach. 

     

    If you’re looking for a 100% internal solution, I’d be happy to dig deeper or check with the community for alternative approaches. Let me know how you'd like to proceed. 

     

     

     

    Thanks, 

    A. Gobinath