Building an Automated AI Experience with Amazon Connect and Salesforce Service Cloud
Last year we announced the first release of the Amazon Connect Computer Telephony Integration (CTI) Adapter for Salesforce. We have seen a number of Enterprise customers leveraging this integration to build innovative customer experiences. Based on customer feedback, we have released version 2 of the CTI Adapter with the following additional functionality:
- Improved Salesforce screen pop: support for passing contact attributes from your Amazon Connect contact flow in addition to caller ID.
- Salesforce Omni-channel support: Enable your Amazon Connect voice channel to work in conjunction with Salesforce chat, email and SMS channels.
- Call Logging and Recording support: automatically log calls from Amazon Connect and expose call recordings in Salesforce.
- Lambda Data Dips: Easily deploy pre-built AWS Lambda functions that you can configure in Amazon Connect to bring Salesforce customer data into your customer experience.
- SSO / SAML Support: Enable seamless Single Sign-On with Amazon Connect and Salesforce
If you’re new to setting up Amazon Connect, see our getting started guide. The CTI Adapter install guide walks through setting up the CTI Adapter from the Salesforce AppExchange. In this blog post, we’re going to assume that you have a Salesforce instance setup with the CTI Adapter configured against an Amazon Connect instance you have provisioned. In addition, that you have familiarized yourself with setting up some basic Amazon Lex bots.
Building an automated AI customer experience with CRM agent routing
Let’s assume you’re responsible for the contact center of a small renewable energy company. In that contact center, your agents take both sales and service calls. Since they take both types of calls, it is important that your agents know why the customer is calling, and that any key information like their case or contact information, is included in the screen pop.
In our Amazon Connect instance, we’re going to setup a simple call flow that leverages an Amazon Lex bot to inquire on why the customer is calling, which we’ll define as intents in the Amazon Lex bot. Depending on what the caller says, Amazon Lex will match the customers utterance to one of the intents we defined. Once we determine whether it’s a sales or service call, we’ll ask the caller for their case number and capture as a slot value. Once the bot collects the data, it passes the information to Amazon Connect, which displays it to the agent and screen pop, including any of the customer’s known information.
The first step is to setup two Amazon Lex bots: GetCustomerCallReason and GetCaseNumber. GetCustomerCallReason will have two intents: SalesCall and SupportCall. For each of these intents, you’ll want to populate them with utterances that reflect the reason for each type of call. Here are screenshots of both intents to give you some ideas:
Please be sure to use the same bot, and intent names as above as you will use these in the contact flow later. Next, build and publish the GetCustomerCallReason Amazon Lex bot. I used an alias called prod.
The next Amazon Lex bot, GetCaseNumber, is used to ask the customer for their Case number. The GetCaseNumber Amazon Lex bot has two intents: CaptureCaseNumber and UnknownCase. The CaptureCaseNumber intent captures a CaseNumber slot value. The UnknownCase intent is used to capture if the customer does not know their case number. You’ll see later how we can provide guidance on the utterance a customer can say to match the intent.
Here are screenshots of the two intents:
Again, build and publish the GetCaseNumber Amazon Lex bot. I used an alias called prod. Next, add these bots to your Amazon Connect instance configuration under Contact Flows.
Our next step is to create the Amazon Connect contact flow. Here is a high level view of the flow:
To create the contact flow
- Log in to your Amazon Connect instance.
- Choose Routing, Contact flows.
- Choose Create contact flow.
- Enter a name for the contact flow.
- Add the blocks to your contact flow as shown in the image.
First, we’ll configure the first Get customer input block. In this block, we’ll get input from the customer by invoking the GetCustomerCallReason bot we created. In the block, update the following settings
- Text to speech (ad hoc) – Enter Text: Hello, welcome to Cirrus Energy, how can I help you?
- Amazon Lex: Select the bot GetCustomerCallReason from the list.
- Alias: Prod
- Choose Add an intent, then add the 2 intents we created for the bot: SupportCall, ServiceCall
Your block should look similar to the following:
Amazon Connect utilizes Amazon Polly to convert Text to speech and “speak” the text to the customer. We’ll add both intents from the bot to the block. Each intent added creates an output branch in the block, letting you route contacts based on the intent the customer specifies when interacting with the Amazon Lex bot.
Once we get back the intent from Amazon Lex, we’ll store the intent as a contact attribute so that we can reference it later in the contact flow. In the Set contact attributes block, Use Text with a destination key of CallReason with the value of $.Lex.IntentName.
The next step is configure our contact flow to use the second Amazon Lex bot, which we do in the second Get customer input block. Similar to the first block, configure the second block to use our GetCaseNumber Amazon Lex bot by configuring the following settings:
- Text to speech (ad hoc) – Enter Text: If you know your case number, please say it now. Otherwise say I don’t know.
- Amazon Lex: Select the GetCaseNumber bot from the list.
- Alias: Prod
- Intents – Choose Add an intent, then add the 2 intents we added to the bot: CaptureCaseNumber, UnknownCase
Note how we’re prompting the customer to state “I don’t know” if they do not know their case number. As a best practice, always think about how you can guide your customers to interact with the bots in a prescriptive way. If the customer responds with a case number, we’re going to store the results of the case number in two attributes. In the Set contact attributes block, Use Text with a destination key of ACCaseNumber with the value of $.Lex.Slots.CaseNumber. Add a second attribute in the same block as Use Text with a destination key of acsf-screenpop-search with the value of $.Lex.Slots.CaseNumber. There are two key things important to note here:
- We would add more validation in the GetCaseNumber Lex bot by leveraging our Salesforce Lambda Package. They could data dip into Salesforce and validate the case and re-prompt the customer if necessary. We’re keeping it simple for the purpose of this blog.
- The acsf-screenpop-search sets the Case number as an attribute to screen pop in Salesforce when it reaches the agent. This is one of the key features of the CTI Adapter that makes it easy to pass data from Amazon Connect to Salesforce.
For the times when the customer does not know the case number, we add another Set contact attributes block with Use Text with a destination key of ACCaseNumber with the value of Unknown.
Once we capture the case number, we play it back to the customer with the Play prompt block:
Text to speech (ad hoc) – Enter Text: <speak>Thanks – your case number is <prosody rate=”x-slow”><say-as interpret-as=”digits”>$.Attributes.ACCaseNumber</say-as></prosody></speak>
Interpret as: SSML
We’re using SSML tags in Polly to properly interpret the case number as digits and slowly speak them back to the customer.
Finally, we set blocks for Set working queue to BasicQueue, Transfer to queue and disconnect / hang up. At this point, the call will be routed to the next available agent assigned to the routing profile that contains the skillset of basic queue. Remember to save and publish your contact flow and assign it to a phone number to test.
Setup agent experience in Salesforce Lightning.
As mentioned earlier, you should follow the CTI Adapter setup guide to properly set it up within your Salesforce environment. The preceding image shows an Amazon Connect Contact Control Panel (CCP) embedded within Lightning Service Console. Salesforce Omni-channel is also enabled and configured for this agent.
One of the new features in the CTI Adapter is the ability to present attributes in the CCP to present the agent with important caller information. For this demo, we’re going to pass in the type of Sales or Service call identified within Amazon Connect and the Case number (including when it’s unknown). First we need to configure those attributes in Salesforce.
In setup, go to Custom Metadata Types and click on Manage Records:
In the Call Attributes Configuration, click New to create AC Case Number and Call Reason:
You can see how this is mapping the attributes we set in the Amazon Connect contact flow to what will be displayed on the CCP when the inbound call arrives.
One final detail is to make sure your Softphone Layouts under Call Centers includes the data you want to screen pop against. The acsf-screenpop-search attribute we set in the call flow will search against the Salesforce objects you’ve configured. In my configuration, it will search Contact, Case, Account and Lead objects.
Testing it End to End
Now that we’ve got everything configured, we’re ready to test the experience end to end. When you call into Amazon Connect, the Lex bot determines the reason that the customer is calling for and captures the case information. The type of call and case number are passed to the agent, and gives them the full context about the reason the customer is calling within Salesforce. If the customer did not provide a case number, the next piece of information it uses, automatically, is the caller’s ID for the screenpop. Once the call is complete, the agent is automatically prompted to fill out the call disposition of the call activity.
That’s it! You’ve created an automated AI customer voice experience that determines their intent and provides that context to an agent. The goal of this blog post was to give you an introduction on how quickly you can integrate both Amazon Connect and Salesforce. There are many other features you could start to expand and explore:
- Leverage call logging and play back recordings of customer and agent conversations.
- Enable multi-channel interactions (voice, chat, email and sms) with your customers and agents by leveraging omni-channel, Lex and Einstein.
- Enable Lex to data dip into Salesforce Knowledgebase and provide more self-service. This reduces the need to route calls to agents.
- Leverage Single Sign-on so your agents have a seamless login experience across Amazon Connect and Salesforce.
More features will be coming soon such as integrated reporting and voice transcription support. Please try out the Amazon Connect CTI Adapter and open a case with your feedback. We value your input as it continues to help us define our next set of features.