On non responsive or in queue

  • Messaging

Through Automatic Messages, you can create functions triggered based on selected events. A payload is sent to a function containing metadata related to the specific conversation and based on the selected event during the invocation.

Enable the automatic messages feature and Create a new function using the 'Messaging conversation stuck queue idle' messaging events. 

You can select one of the available templates for the chosen event. Currently, you can create only one function per template type for these conversational events. A deployed function on a specific messaging event can be invoked on multiple conversation events. 

Automatic Messages can trigger different conversation events, these events can be triggered by skills and can be managed by FaaS functions to customize the experience of the bot based on the event triggered.

Set Events Configuration

To access the Automatic Messages settings, you should select the Engage icon and select Campaign Builder section.

Screenshot 2024-02-20 at 4.41.10 PM.png

Click Engage > Campaign Builder. The Campaign Builder page appears.

Screenshot 2024-02-20 at 5.42.10 PM.png

Click Automatic Messages. The Automatic Messaging Library page appears.

Screenshot 2024-02-20 at 6.08.19 PM.png

Click Messaging. The Messaging tab appears.

Screenshot 2024-02-20 at 6.13.54 PM.png

The events that can be triggered on the conversation idle are:

  • Agent non-responsive message
  • Consumer non-responsive message
  • Waiting in queue message

Customize event settings by selecting desired skills, defining languages, activating or deactivating events, and setting message content and timing.

Screenshot 2024-02-20 at 6.34.50 PM.png

Provide the required information:

  1. Skill trigger: Specify triggering skills; if none are added, the event activates for all available skills.
  2. Language: Customize messages for different languages.
  3. Message: Customize a message for the customer post-event, with further customization possible using a FaaS function.
  4. Repeat Message: Edit the number in the field to define the number of times the message can be repeated.
  5. Active/In-Active: This indicates if the event is Active or not. Gray indicates not active. Yellow indicates active.
  6. Time Delay: Set the time delay for event triggering.
  7. Override: Activate to override with the expected response time if it's longer.

Click Save. The settings are saved.

Navigate to the "Functions" section in LivePerson Conversational Builder. 

Screenshot 2024-02-19 at 1.42.04 PM.png

Click Automate > Functions. The Functions page appears.

Screenshot 2024-02-19 at 1.51.53 PM.png

Click Confirm to agree to the Terms of Use and GDPR Agreement.

Screenshot 2024-02-19 at 1.54.26 PM.png

Click the icon to open the LivePerson Functions page.

Screenshot 2024-02-19 at 1.57.45 PM.png

Click Create a Function. The Create a new function wizard appears.

Screenshot 2024-02-20 at 7.11.42 PM.png

Provide the following information:

  1. Runtime: Select your runtime.
  2. Event: Select the event that the FaaS function will track, in this case idle conversation events. Select an event to see its available templates. 
  3. Skill trigger: Select skills which trigger to which this function reacts. It is not necessary to select any skill, since this option was managed on the Automatic Messages section.
  4. Greeting Template: Select a template to start your implementation. Select the code template that the FaaS function will have, which can vary depending on the event you selected.
  5. Access to external domains required: Enable this option if you plan to call external APIs, including the API's domain. Disable it if no external API calls are required.
  6. Code: Displays the code for the template selected.
  • Select the event for FaaS tracking: Idle conversation events -
    1. Messaging Conversation Agent Idle: This event will track all conversations where the agent is idle.
    2. Messaging Conversation Consumer Idle: This event will track all conversations where the consumer is idle.
    3. Messaging Conversation Idle: This event will track all conversations where the agent/consumer is idle.
  • Choose triggering skills, which can be managed in Automatic Messages.
  • Select the code template for the FaaS function based on the event.
  • Enable external API access if required; include the API domain.

Click Continue. The next page appears.

Screenshot 2024-02-20 at 1.18.26 PM.png

By default, access to external domains is blocked. Adding domains to the allowlist allows functions to send requests to them. If required, add domains to the field and click Continue. The next page appears.

Screenshot 2024-02-19 at 2.08.41 PM.png

Provide the function name and description in the fields. 

Screenshot 2024-02-19 at 2.08.41 PM.png

Click Create function the function is added. Once the function is open you can edit the code to implement any logic needed.

Screenshot 2024-02-20 at 7.26.03 PM.png
  1. Send a message. The default automatic message can be overwritten with.
  2. Transfer Conversation to a different Agent.
  3. Close conversation, noting potential race conditions. For instance, combining "Message" and "Close" commands may result in closure before the message is sent. Similarly, duplicate commands (e.g., two transfers) execute only the first.
Screenshot 2024-02-20 at 7.29.39 PM.png

The input.payload variable contains real-time conversation data usable within the function code.

This data contains:

1. level2. level3. leveldescriptiontypeexample
endcloseReason
which role closed conversationSTRINGAGENT/CONSUMER/SYSTEM
generalcbotEventType
Original conversation event typeSTRINGCONSUMER_OPEN_NEW_CONVERSATION_FIRST_TIME_OFF_HOURS
generaltype
notification typeSTRINGUPSERT
generalconvId
ID of conversationSTRINGc840e51e-5f65-4ad4-8d34-5c82b99a2200
generaldialogId
ID of dialogSTRINGc840e51e-5f65-4ad4-8d34-5c82b99a2200
generalsessionId
ID of sessionNUMBER1528463744580
generalstartTs
conversation start time as timestampNUMBER1528463744663
generaleffectiveTTR
timestamp when agent should be availableNUMBER1528464044687
generaloldConvState
previous state of the dialogSTRINGCLOSE
generalnewConvState
current state of the dialogSTRINGOPEN
generalcontexttype
type of cotextSTRINGSharkContext
generalcampaignInfoidID of campaignNUMBER2327699812
generalcampaignInfoengangementIdID of engangementNUMBER2327699912
generalclientLanguage
language of the client deviceSTRINGen-US
generalclientFeatures
list of supported client featuresARRAY["AUTO_MESSAGES", "MULTI_DIALOG"]
generalinOffHours
shift-status of the contact centerBOOLEANTRUE/FALSE
generalvisitorId
ID of visitorNUMBER1528463744580
generaloriginatorId
ID of originatorNUMBER37607275.23
generaloriginatorPid
Pid of originatorSTRINGf39fbc5f-da77-5417-8bc7-7584efdd1a5e
generaloriginatorMetadataidPid of originator of metadata changeSTRINGf39fbc5f-da77-5417-8bc7-7584efdd1a5e
generaloriginatorMetadataroleRole of originator of metadata changeSTRINGCONTROLLER
generalserverTimestamp
timestamp of the serverNUMBER1528463781807
generalclientIpAdress
IP Address of clientSTRING172.26.138.38
generalmanualETTR
time to response manually updated by agentSTRING1541152938069
generallastMessageComposer
the role of the last composerSTRINGCONSUMER
generallastMessageTs
timestamp of last messageNUMBER1541152938069
generallastAgentMsgTs
timestamp of last agent messageNUMBER1541152938069
generalbackToQueueTs
timestamp when the conversation was returned to queueNUMBER1541152938069
idlelastConsumerMsgTs
timestamp of last consumer messageNUMBER1541152938069
idleagentNonResponsivetimetime that should pass after consumer's last message in order the agent to be non-responsiveNUMBER30
idleagentNonResponsivetimeUnitstime units in which agent non-responsive time should be calculatedSTRINGminutes
idleconsumserNonResponsivetimetime that should pass after agent's last message in order the consumer to be non-responsiveNUMBER30
idleconsumserNonResponsivetimeUnitstime units in which consumer non-responsive time should be calculatedSTRINGminutes
idleconvNotTakenTimetimetime units in which conversation idle time should be calculatedSTRINGminutes
idleconvNotTakenTimetimeUnitshow long should the conversation stay in queue in order to be idleNUMBER30
midopenedInOffHours
indicator if the conversation was opened in off hoursBOOLEANTRUE/FALSE
participantChangeoldParticipants
array of the participants of the previous stateARRAY[{"id": "f9d58c57-c489-45f5-bae4-c5ebd52b3972","role": "ASSIGNED_AGENT"}]
participantChangenewParticipants
array of the participants of the current stateARRAY[{"id": "f9d58c57-c489-45f5-bae4-c5ebd52b3972","role": "ASSIGNED_AGENT"}, {"id": "f9d58c57-c489-45f5-bae4-c5ebd52b3972","role": "AGENT"}]
routingoldSkillId
previous skillId of conversationSTRING563268
routingnewSkillId
current skillId of conversationSTRING563267
startfirstConversation
if this is the first conversation of the consumer everBOOLEANTRUE/ FALSE
ttroldTtrttrTypetype of ttr of the previous stateSTRINGNORMAL
ttroldTtrvaluevalue of ttr of the previous stateNUMBER600
ttrnewTtrttrTypetype of ttr of the new stateSTRINGURGENT
ttrnewTtrvaluevalue of ttr of the new state (after change for example to URGENT)NUMBER300

The cbotEventType property within the invocation payload distinguishes the conversation event type. Below is a table mapping these event types to messaging events in functions:

Event TypeMapped to
CONV_AWAITING_IN_QUEUEMessaging conversation idle, Messaging conversation stuck idle
AGENT_NON_RESPONSIVEMessaging conversation idle, Messaging agent idle
CONSUMER_NON_RESPONSIVEMessaging conversation idle, Messaging consumer idle

Deploy the Function

Click the 3 dot menu on the created function.

Screenshot 2024-02-19 at 2.15.53 PM.png

Click Deploy function. The Create a deployment page appears.

Screenshot 2024-02-20 at 7.34.51 PM.png

Click Approve & Deploy. The function is deployed.

Screenshot 2024-02-19 at 2.20.18 PM.png

Your function is now deployed and ready for use. 

For more information on Automatic Messaging see, here.

javascript:
function lambda(input, callback) { // Set conversation data. let conversation = input.payload; let skillId = conversation.routing.newSkillId; let conversationId = conversation.general.convId; let lastMessageFrom = conversation.general.lastMessageComposer; const wmBot = process.env.wmBot; // Ensure you set the variable on the Environment Variables section const smsBot = process.env.smsBot; // Ensure you set the variable on the Environment Variables section console.info(`${conversationId} - Conversation Idle`); console.info(`${conversationId} - Last message is from ${lastMessageFrom}`); const wmService = process.env.wmService; // Ensure you set the variable on the Environment Variables section const smsService = process.env.smsService; // Ensure you set the variable on the Environment Variables section const generalService = process.env.generalService; // Ensure you set the variable on the Environment Variables section const botSkillArray = [wmBot, smsBot]; let transferSkill; if (skillId == wmBot) { transferSkill = wmService; } else if (skillId == smsBot) { transferSkill = smsService; } else { transferSkill = generalService; } let result = [ { type: "systemMessage", // Returns a system message into the conversation. text: "Something went wrong with the chatbot. I'm going to connect you with a live associate for more assistance." }, { type: "transfer", // Transfers the conversation. skillId: transferSkill, // Transfer to different skill. } ]; if (lastMessageFrom == "CONSUMER" && botSkillArray.includes(skillId)) { console.info(`${conversationId} - Bot is not responding, transfering to fallback skill - ${transferSkill}`); callback(null, result); } else { console.info(`${conversationId} - Customer is not responding`); callback(null, null); } }

The function above verifies if the bot has ceased responding to the customer (AGENT_NON_RESPONSIVE). Upon this event, the bot will display the message: "Something went wrong with the chatbot. I’m going to connect you with a live associate for more assistance" and then transfer the conversation to a designated service skill.

Screenshot 2024-02-20 at 8.44.45 PM.png