Skip to main content

#AgenticAI8 人正在讨论

Hi everyone, 

 

I'm looking for a practical, tested solution (not a theoretical one) for this requirement: 

 

Requirement:

In an Agentforce Service Agent on Enhanced Chat v2 (MIAW), automatically transfer the conversation to a live human agent after N agent replies (e.g. 30), regardless of which subagent is currently handling the conversation. 

 

My setup:

  • I am using the classic/old Agentforce Builder (Subagents list with "Subagent Configuration" and "This Subagent's Actions" tabs). NOT the new Agent Script/Canvas builder.
  • Subagents: Escalation, General FAQ, and other subagents.
  • Escalation is already configured under Connections > Escalations with an Omni-Channel flow, and it works when the customer types something like "human" or "talk to agent".

 

What I built so far:

 

1. An autolaunched Flow "Increment Reply Counter" (input: currentCount, output: newCount = currentCount + 1). 

2. An agent action "Track Reply Count" based on this Flow. 

3. A custom conversation variable `ReplyCount` (Number). The action input uses "Assign a Variable" = ReplyCount and the output uses "Map to Variable" = ReplyCount. 

4. Added the action to each subagent, with an instruction to call it once before each reply. 

 

I confirmed in the Conversation Preview that ReplyCount increases correctly on every turn. 

 

What does NOT work :

 

I added this instruction to the subagents (threshold set to 3 for testing): 

"If {!ReplyCount} is greater than or equal to 3 and the customer still wants to continue, immediately escalate the conversation to a live human agent." 

 

The agent just keeps replying normally. No escalation happens. I also tried putting a similar instruction in the Escalation subagent, with the same result. 

 

My observations:

  • When I type "human" or "talk to a human", it transfers immediately with the message "You're being transferred to a support representative", but the trace shows no action launched ("Actions: 0"). It looks like a hidden, classifier-driven system escalation.
  • In the classic builder, when I search the action library (New > Actions) inside a subagent, I cannot find any standard "Escalate" action to add.
  • Topic classification seems to depend only on the customer's message, so an internal variable like ReplyCount can't route to the Escalation subagent.
  • In the new builder I see `@utils.escalate` can be added as an action inside any topic, but I cannot find an equivalent in the classic builder.

 

My questions:

 

1. In the classic builder, is there any way to trigger the built-in escalation from a variable condition (like ReplyCount >= N) instead of customer intent? 

2. Is there a hidden/standard escalation action I can attach to a regular subagent? 

3. If not possible, is there a different practical approach that works with the classic builder? For example a Flow or Apex triggered from the Messaging Session / conversation entries that counts messages and routes the session via Omni-Channel, or anything else you have actually implemented. 

4. If this is only possible in the new Agent Script builder, can someone confirm that, and is there any official documentation saying so? 

 

If you have actually implemented something like this in production, I would really appreciate hearing how you did it. Screenshots or a short outline of the approach are very welcome. 

 

Thanks in advance. 

 

#Agentforce  #AgentforceBuilder  #AgenticAI

3 个回答
0/9000

Hello Guys, 

 

I am using accApi and trying to open an agent from LWC but facing issue as the agent is not opening only the agentforce window is opening - after that as i select the agent -conversation starts. 

 

So basically in the lwc  : 

1. i am calling   --  import { open, execute, close } from 'lightning/accApi';  

2. and after getting the agent id from my apex class i doing below :  

 

           

await open(this.resolvedBotId); // i am getting the id from apex.

            console.log('Agent panel opened successfully.');

            const utterance = "Start";

            await execute(utterance, this.resolvedBotId);

            console.log('Agent successfully invoked with utterance:', utterance);

 

But i can open the agent window but proper agent is not selecting. 

 

#Agentforce  #LWC  #AgenticAI

8 个回答
  1. 9月11日 16:28

    @Manas Datta

     

     

    Thanks for testing that - a correct id still landing on the bare panel actually rules the id out and points to an enablement gap. open() drives the SAME native Agentforce side panel you'd get manually, and botId is only optional targeting - if that agent isn't the one wired to the panel for your running user, open() falls back to the default panel/picker no matter which id you pass. 

     

    Quick way to confirm: open the native Agentforce panel manually (the Agentforce icon, not your LWC). If it also drops you on a picker or the wrong agent, it's the setup, not your code - check the agent is Active, is the one enabled for the Agentforce panel in that org, and your running user has access to it (permission set + the agent's assigned users). Fix that and open(botId) will land on it. 

     

    If you need a specific agent guaranteed every time regardless of the panel, skip accApi and use the Agent API instead (Connect REST /einstein/ai-agent, or its Apex wrapper): you start a session against the exact agent id server-side and render the replies in your own LWC chat UI - no panel, no picker, fully deterministic.

0/9000

Excited to share that I’ve completed the Road to Dreamforce 2026 Quest

on Trailhead! 💙  

 

With 3,200+ points earned, this has been a fantastic learning journey — strengthening my Salesforce skills while exploring the evolving world of AI and the Agentic AI era

.  

 

The #DF26LearningQuest has been a great way to learn, build, and challenge myself while getting ready for #DF26

. 🚀  

 

A big thank you to Trailblazer Quests

for creating such an engaging and valuable learning experience. 🙌  

 

Looking forward to taking these learnings forward, building more, and continuing the journey toward Dreamforce 2026!

🌟  

 

#DF26 #DF26LearningQuest #Salesforce #Trailhead #Trailblazer #AgenticAI #AI #SalesforceAI #LearningJourney 

@WFD Partner Cohort: TDX2630DaysChallenge

 

@Salesforce Developer Group, Dubai, UAE

 

@Agentblazer Community Group

 

@* Salesforce Developers *

 

@Architect Trailblazers

 

@Admin Group, Dubai, UAE

 

@Trailblazer Community Cove

 

 

 

Excited to share that I’ve completed the Road to Dreamforce 2026 Quest on Trailhead! 💙 With 3,200+ points earned, this has been a fantastic learning journey — strengthening my Salesforce skills while

 

 

image.png

 

 

1 条评论
0/9000
3 个回答
0/9000
3 个回答
0/9000