Workflow to Enable a Live Agent

Enable a Live Agent by setting up the Contact Live Agent Intent and other related Intents/Flows.

You can use the Contact Live Agent Intent as the identifier whether your application or bot is setup with Live Agent or not.

There are 3 options for the Fulfillments of this Contact Live Agent Intent.

  • Set up a flow

    • This flow will only get invoked when a user directly types a query that triggers intent Contact Live Agent , for example, I want to talk to a live agent

    • This flow will NOT get invoked when a user starts handing off to live agent from Escalation Feedback flow.

    • In the Contact Live Agent Flow, the flow builder can ask user to confirm contact live agent or collect any necessary information if needed.

    • After the execution of this flow, if the next step to really to contact an agent in the external system, please output a variable handleOffToLiveAgent as True, as the example showed in the next section. Please don’t misuse the sub-flow by calling Feedback Escalation flow or Preprocess Live Agent flow as sub-flows.

  • Set up a customized message

    • This customized message will be presented to users rather than handing off to the external Live Agent system

  • Leave fulfillment empty

2. Import Preprocess Live Agent skill (Optional)

If there is any preparation needs to do before starting a session with external Live Agent, then Preprocess Live Agent skill should get imported. For example,

  • Get Conversation History

  • Create a ticket before handing off to Live Agent

  • Authorize the user (OAuth)

Note:

In order to hand off to external Live Agent, there are two required skill/flow outputs. (If they are missing, please manually add them.

  1. initMsg - the intial message sent to the agent

  2. handleOffToLiveAgent - boolean choice

    1. True: Continue to hand off to live agent

    2. False: Stop handing off to live agent

Use Case Example 1

When you only need to get the conversation history and then send the history to the agent as initial messages.

Use Case Example 2

Before handing off to a live agent, you need to Authorize Users, Create a Ticket, and Send the Ticket URL as the initial message.

3. Import Message Enrichment skill (Optional)

When receiving a message from external Live Agent, it is possible to enrich the message and send it to the user. For example, receive a URL, that represents a ticket, from Live Agent, the Message Enrichment Intent is able to customize and convert it to a ticket card and send it to the user.

Note: if the Message Enrichment is not imported, or, Message Enrichment is not able to enrich a message, this message will be presented to user as it is.

Example: Parse the Ticket URL into a Ticket card

Example: Make the URL link clickable.

var Pattern = Java.type('java.util.regex.Pattern');
var Matcher = Java.type('java.util.regex.Matcher');
var StringBuffer = Java.type('java.lang.StringBuffer');
var urlRegex = "((https?:\\/\\/|www\\.)"
      + "(([\\w\\-]+\\.){1,}?([\\w\\-.~]+\\/?)*"
      + "[\\p{Alnum}.,%_=?&#\\-+()\\[\\]\\*$~@!:/{};']*))";
var pattern = Pattern.compile(urlRegex, Pattern.CASE_INSENSITIVE);
var urlMatcher = pattern.matcher(message);
var sb = new StringBuffer();
while(urlMatcher.find()) {
      var found =urlMatcher.group(0);
      if (!found.toLowerCase().startsWith("http") && ! found.toLowerCase().startsWith("ftp")) {
        urlMatcher.appendReplacement(sb, "<a href='http://" + found + "'>" + found + "</a>");
      } else {
        urlMatcher.appendReplacement(sb, "<a href='" + found + "'>" + found + "</a>");
      }
}
urlMatcher.appendTail(sb);
message = sb.toString();
return message;

4. Import Fallback skill (Optional)

The Fallback Intent is used in the exception cases before the agent picks up the user’s request, when we handoff the user to the agent.

Live Agent Connection Timeout

There could be a delay, after we handoff a user to live agent and before an agent picks up the user’s request. So, the user has to wait until an agent picks up the request.

If the delay (the user’s waiting time) is longer than the pre-configured live agent connection timeout setting (in minutes), then, AISERA shall automatically end the un-picked live agent conversation.

When the connection to Live Agent timeouts, a conversation message with key live_agent_connection_timeout

For example,

If Fallback skill is imported to the bot, then, this skill will be considered as the fallback option for live agent and used in the live agent connection timeout case.

When the live agent connection timeouts, then, apart from the live agent connection timeout message showing up, a button (button label is configured through conversation message with key live_agent_connection_timeout_fallback_button_label) will also show up in the webchat.

When clicking the button, Fallback skill will be triggered, with the fallback type = LiveAgentTimeout. In the Fallback skill flow, the customer can config the expected behavior, including Create Ticket.

2. No Agent: fallback option

For some external Live Agent system, for example, Salesforce Live Agent, if there is no agent available, instead of returning failure when we start a live agent conversation, Salesforce Server will fail the request.

Live Agent Systems that apply to : Salesforce, Servicenow and Genesys

So, if the external live agent system fails the request due to no available agent, we shall use Fallback skill with a new branchfallbackType = NoLiveAgent to provide other options for the user.

5. Deflect initial Live Agent request (Optional)

When the user types contact live agent, instead of directly handing off to the live agent, the admin can try to deflect this request by asking user to clarify the question, eg, Would you please clarify your question?

If the user continues to say contact live agent, AISERA will hand the user off to the live agent. Otherwise, AISERA will serve based on the user’s clarified question.

Go to Settings => Deflect Escalate Intents => Deflect Initial Live Agent Request

You shall see this after user says Contact Live Agent

Under app Conversation messages, search for “live_agent_pre_fulfillment_msg” for tuning this message.

Last updated