AWS Contact Center
Real-time data export of Amazon Connect Customer Profiles to Salesforce using Amazon Kinesis
Introduction
Amazon Connect Customer Profiles helps companies deliver faster and personalized customer service in contact centers. This is achieved by providing agents and automated experiences (e.g., IVR) instant access to customer information without the latency and costs of integrating data from multiple systems (SaaS apps, databases, etc). Companies can bring data from over eighty application connectors to create profiles, use entity resolution to remove duplicate profiles, and get low latency access to their unified profiles. With a complete view of relevant customer information in a single place, companies can provide more personalized customer service, deliver more relevant campaigns, and improve customer satisfaction
With every interaction before and during on-going customer support, companies need the most up to date information across applications and business users. Companies can now keep their source system’s (e.g. CRMs and automation tools) data up-to-date with latest information from Amazon Connect Customer Profiles. For example, when a customer calls the contact center to update their address, an agent can make this change, and the updated profile information is sent to an Amazon Kinesis Data Stream in real-time. Companies can enable data streaming and automatically receive data for new profiles and updates to existing profiles into their Kinesis Data Stream. In this blog post, we will demonstrate how a company can export customer profile data into Salesforce and Amazon Simple Storage Service (Amazon S3) in real-time. By doing this, the company ensures that data gathered and updated in the contact center matches their source system data.
Solution Overview
Figure 1: Solution architecture
- Agent create/update customer profile data via Amazon Connect Agent Workspace
- Amazon Connect instance sends create/update events into Amazon Connect Customer Profiles
- Customer Profiles create/update events are streamed through Amazon Kinesis Data Streams
- Amazon Kinesis Data Streams writes create/update events into Amazon Kinesis Data Firehose
- Amazon Kinesis Data Firehose exports Customer Profiles event data to Amazon S3
- AWS Lambda is triggered by the create/update events from Amazon Kinesis Data Stream
- AWS Lambda invokes Salesforce API to update Customer Profiles event data to Salesforce
Prerequisites
For this walk through, it is assumed you have the following prerequisites:
- An AWS account.
- An Amazon Connect instance.
- Amazon Connect Customer Profiles is enabled in the Amazon Connect instance.
- A Salesforce instance with customer data.
- A data source integration already created between Salesforce and Amazon Connect using Amazon AppFlow, with Salesforce contact as the specific object.
- Setup the code in your local Linux setup:
- Clone the code using following command: git clone https://github.com/aws-samples/customer-profiles-export-demo.
- Run the following makeZip.sh script to download dependencies: ./makeZip.sh
- On successful execution, you should see 2 files: lambda.zip and template.yaml in the root folder of the local repository, which would be used in later steps.
Walkthrough
- Sign in to the AWS Management Console.
- Search for Amazon S3 on the AWS Console services search bar and click on S3.
- Create a new S3 bucket in the same region you have your Amazon Connect instance. Make a note of the S3 bucket name.
- Upload the lambda.zip and template.yaml created in the pre-requisites to the home folder in the S3 bucket created in the previous step. Make a note of the Object URL for template.yaml
- Search for CloudFormation on the AWS Console services search bar and click on CloudFormation.
- Click on Create Stack. With new resources (standard).
- Click on Template is ready in Prerequisite section and choose Amazon S3 URL as template. source. In the Amazon S3 URL, put the Object URL of template.yaml noted in Step 4. Click on Next.
- Enter the AWS CloudFormation Stack Name.
- Enter the Parameters for the CloudFormation template as follows:
- Enter the S3 Bucket Name created in Step 3 in the CPDemoDeployBucketName parameter.
- Enter the AmazonConnectInstanceARN for your existing Amazon Connect Instance.
- To identify all the resources created by this template, enter the prefix of your choice.
- Enter the S3 bucket name used to store all audit logs in the field. CPDemoAuditBucketName. Refer to S3 bucket naming rules here.
-
- Enter the Salesforce username in the SFUsername field.
- Enter the Salesforce user password in the SFPassword field.
- Enter the Salesforce Access token in the SFAccessToken field.
- Enter the Salesforce hostname in the SFHost field.
- Enter the Salesforce version in the SFVersion field, this current demo is built on v57.0.
- Enter whether the Salesforce instance is a production instance or not in the SFProduction field, valid values are “true” for production or “false” for non-production environment.
- Enter the Salesforce consumer key in the SFConsumerKey field.
- Enter the Salesforce consumer secret in the SFConsumerSecret field.
- Click on Next in the with the default selected options in the Configure stack options page.
- Select all the “I acknowledge …” statements check box at the last step, and then chose “Submit”.
- When the CloudFormation Stack status is “CREATE_COMPLETE”, click on the Resources tab and note the name of the Kinesis Stream created.
- Search for Amazon Connect on the AWS Console services search bar and click on Amazon Connect.
- On the Amazon Connect Instances page, click on the Instance alias which you mentioned in Step 9.b. of Walkthrough.
- On the left pane, click on Customer Profiles.
- Scroll down on the Customer Profiles page. In the lower section, click on Data export & Enable data streaming.
- Click on the checkbox for Enable data stream, in the dropdown for Kinesis data stream, select the data stream created by CloudFormation template and noted down in Step 12. Click on Enable data streaming button.
Security Disclaimer
Please note that this solution is meant to serve as an example for how you can get started building a solution. We recommend performing additional code review, functional testing, and IT validation before releasing this solution in a production environment. Always make sure to thoroughly test your solution and follow AWS Security Best Practices.
Salesforce Validation
- Login to the Salesforce instance and click on Contacts.
- Review the details of the contact you wish to update; in this case we will be updating the Phone Number of the contact John Doe which is currently set to +15555567890 as seen in the previous image.
- Login to Amazon Connect Agent Workspace in a new tab.
- Select Customer Profile tab, you will be able to view the same user John Doe with similar detail such as Phone Number on the Agent app since Salesforce has been added as data source integration using Amazon AppFlow.
- Click on the Customer profile which you wish to edit, in this case we will edit the Phone number of John Doe. Click on Edit.
- Scroll down to the Phone Numbers section, edit the number. In this case, we have updated the number to +15555512345. Click on Save.
- Go back to the tab which has Salesforce instance logged in, refresh the page and review the Phone Number of the specific user, it should be updated to the new Phone Number.
- (Optional) You may also edit the Customer Profile using the UpdateProfile API.
S3 Validation
- Search for Amazon S3 on the AWS Console services search bar and click on S3.
- Search the name of S3 bucket which you created using the AWS CloudFormation template in Step 5.c. of walkthrough.
- Click on the bucket name, it has further sub directories based on year, month and date. You would be able to view new S3 objects created for all actions performed by you in Amazon Connect customer profile such as creation, updation or deletion.
- Download a file and you would be able to see the details of the event in the following format:
Clean Up
- Search for S3 in the AWS Console search bar. Click on S3.
- In S3, search the name of S3 bucket which you created using the AWS CloudFormation template in Step 5.c. of walkthrough.
- Select the radio button before the bucket name in the list and click “Empty” and follow the instructions in to delete all objects from the S3 bucket.
- Search for CloudFormation in the AWS Console search bar. Click on CloudFormation.
- In the CloudFormation stack search bar, search for the stack name mentioned by you in Step 4 of the Walkthrough. Click on the stack name.
- In the stack overview, click on the Delete.
- Chose Delete on confirmation pop up.
Conclusion
In this blog, we leveraged Amazon Kinesis and Amazon Connect Customer Profiles to perform real-time export of Amazon Connect Customer Profiles updates to Salesforce and Amazon S3. We demonstrated how Amazon Connect customers can maintain their source systems (e.g., CRMs and marketing systems) data up-to-date with latest updates from Amazon Connect Customer Profiles, whether its via agents updating a phone number or Customer Profiles identifying duplicates and merging profiles.
To learn more about Amazon Connect Customer Profiles, you can read how to build unified customer profiles with Amazon Connect or watch how Choice Hotels has used Customer Profiles to build unified traveler profiles. For information about pricing see Amazon Connect Customer Profiles Pricing Page and Amazon AppFlow Pricing Page.
Author bio
Nimish Amlathe is a Senior Product Manager on the Amazon Connect team based in Seattle, Washington. Outside of work, you are likely to see him at a local comedy club. |
|
Abhishek Pandey is a Senior Solutions Architect with Amazon Web Services based in Houston, TX. Abhishek is passionate about diving deep with customers to architect creative solutions that support business innovation across different industries. Outside of work, he loves to hang out with family and friends. | |
Jackysh Bangera is an Enterprise Solutions Architect with Amazon Web Services team in Mumbai. He enjoys listening to Classic Rock and you may run into him at one of the Biriyani eateries in the city. | |
Attila is Senior Amazon Connect Consultant with Amazon Web Services Professional Services group. Besides contact center experience, he has also had software development and enterprise networking background. Attila enjoys snowboarding and loves to explore the World with his family. | |
Baswaraj Thota is a Solution Architect with Amazon Web Services. With more than 15 years of IT experience, Baswaraj has helped many organizations to implement sophisticated, scalable, and secure solutions across many different industries. Outside of work, he loves to play cricket, jog and traveling. |