These days, chatbots are used pretty much everywhere. From getting quotes to resetting password, their use cases are endless. They also elevate the customer experience, as now customers don’t need to call during your helpdesk’s manned hours, instead they can call anytime that is convenient to them. One of the biggest business benefits is that of lessening the load on their support staff.
A good practice to adhere by, when deploying chatbots is to make them channel agnostic. This means that your chatbots are available via the internet and also via a phone call, and they provide the same customer experience. This enables your customers to choose whichever channel suits them best, without any loss of customer experience.
In this blog, I will demonstrate how you can use Amazon Connect and Amazon Lex, to create an omnichannel chatbot.
I will be extending one of my previous blogs, so if you haven’t read it already, I would highly recommend that you do so, prior to continuing. Here is the link to the blog https://nivleshc.wordpress.com/2020/04/08/create-a-web-chatbot-for-generating-life-insurance-quotes-using-amazon-lex/).
High Level Architecture Diagram
Below is the high-level architecture diagram for the solution. We will build the section inside the blue box.
For steps 1 – 5 please refer to https://nivleshc.wordpress.com/2020/04/08/create-a-web-chatbot-for-generating-life-insurance-quotes-using-amazon-lex/
For steps 6 – 8 please refer to https://nivleshc.wordpress.com/2020/05/24/publish-a-web-chatbot-frontend-using-aws-amplify-console/
Steps 9 – 12 will be created in this blog and are described below:
9. The customer calls the phone number for the chatbot. This is attached to a contact flow in Amazon Connect
10. Amazon Connect proxies the customer to the Amazon Lex chatbot (this is the web chatbot created in https://nivleshc.wordpress.com/2020/04/08/create-a-web-chatbot-for-generating-life-insurance-quotes-using-amazon-lex/ )
11. The output from the Amazon Lex chatbot is sent back to Amazon Connect.
12. Amazon Connect converts the output from the Amazon Lex chatbot into audio and then plays it to the customer.
This blog assumes the following:
- you already have an Amazon Connect instance deployed and configured.
- you have a working Amazon Lex web chatbot
You can refer to the following blogs, if you need to deploy either of the above prerequisites
Let’s get started.
- Login to your AWS Management Console, open the Amazon Connect console and change to the respective AWS region.
- Within the Amazon Connect console, choose the instance that will be used and click its Instance Alias.
- In the next screen, from the left-hand side menu, click Contact flows. Then, in the right-hand side screen, under Amazon Lex select the Region where the Amazon Lex bot resides. From the Bot drop-down list, select the name of the Amazon Lex bot. Once done, click +Add Lex Bot.
- Click Overview from the left-hand side menu, and then click Login URL to open the Amazon Connect administration portal. Enter your administrator credentials (currently only the following internet browsers are supported – latest three versions of Google Chrome, Mozilla Firefox ESR, Mozilla Firefox).
- Once logged in, from the left hand-side menu, click Routing and then Contact flows.
- Click Create contact flow (located on the top-right). You will now see the contact flow designer.
- Enter a name for the contact flow (top left where it says Enter a name)
- From the left-hand side menu, expand Interact and drag Get customer input to the right-hand side screen.
- Click on the circle to the right of Start in the Entry point block and drag the arrow to the Get customer input block. This will connect the two blocks.
- Click on the title of the Get customer input block to open its configuration.
- Select Text-to-speech or chat text. Click Enter text and in the textbox underneath, type the message you want to play to the customer when they call the chatbot.
- Click Amazon Lex and then under Lex bot Name select the Amazon Lex bot that you had created earlier (if the bot doesn’t show, ensure you had carried out step 3 above). Under Intents type the Amazon Lex bot intent that should be invoked. Click Save.
13. From the left-hand side menu, expand Interact and drag two Play prompt blocks to the right-hand side screen.
14. The first Play prompt block will be used to play a goodbye message, after the Amazon Lex bot has finished execution. Click on the title of this block to open its configuration. Click Text-to-speech or chat text and then click Enter text. Enter a message to be played before the call is ended. Click Save.
16. From the left-hand side menu, expand Terminate / Transfer and drag the Disconnect / hang up block to the right-hand side screen.
17. In the designer (right-hand side screen), in the Get customer input block, click the circle beside startConversation (this is the name of your Amazon Lex bot intent) and drag the arrow to the first Play prompt block.
18. Repeat step 17 for the circle beside Default in the Get customer input block.
19. In the Get customer input block, click the circle beside Error and drag it to the second Play prompt block.
20. Inside both the Play prompt blocks, click the circle beside Okay and drag the arrow to the Disconnect / hang up block.
21. From the top-right, click Save. This will save the work you have done.
22. From the top-right, click Publish. You will get a prompt Are you sure you want to publish this content flow? Click Publish.
24. Next, we need to ensure that whenever someone calls, the newly created contact flow is invoked. To do this, from the left-hand side menu, click Routing and then click Phone numbers.
Give it a few minutes for the settings to take effect. Now, call the phone number that was assigned to the contact flow above. You should be greeted by the welcome message you had created above. The phone chatbot experience would be the same as what you experienced when interacting with the chatbot over the internet!
Congratulations! You just created your first omnichannel chatbot! How easy was that?
Till the next time, Enjoy!