Introduction
If you're managing a call center with Amazon Connect, integrating it with your CRM system can dramatically improve efficiency and agent performance. This step-by-step guide will show you how to trigger an AWS Lambda function during an incoming call, which queries your CRM (like SoftyCRM) for lead data or creates a new lead automatically.
This tutorial is designed for:
-
Amazon Connect administrators
-
IT teams implementing AWS workflows
-
CX managers improving call center systems
By the end, you'll have a working Lambda function that:
-
Receives the caller's number
-
Sends it to your CRM API
-
Finds or creates a lead
-
Opens a case in real-time for the agent to view
What is Amazon Connect?
Amazon Connect is a cloud-based contact center service from AWS. It allows businesses to set up inbound and outbound call routing with logic-based flows, integrations, and AI support.
Why CRM Integration Matters
Integrating your CRM allows your agents to:
-
Instantly access caller information
-
View call history or previous cases
-
Automatically log call interactions
-
Avoid asking the same questions repeatedly
This improves both agent productivity and customer experience.
Pre-Requisites
To follow along, you'll need:
-
✅ An Amazon Connect instance
-
✅ Access to AWS Lambda (and permission to create functions)
-
✅ A CRM with an API, like SoftyCRM (placeholder link)
-
✅ Basic knowledge of AWS Console and JSON
Architecture Overview
Integration Flow:
Call → Amazon Connect → Lambda → SoftyCRM API → CRM UI shows lead/case
When a call comes in:
-
Amazon Connect triggers a Lambda function
-
Lambda gets the caller's phone number
-
Lambda checks SoftyCRM via API
-
SoftyCRM returns lead info or creates a new lead and opens a case
-
CRM shows this case to the agent in real time
[Insert architecture diagram here]
Step-by-Step Walkthrough
1. Set Up the Amazon Connect Contact Flow
-
Go to your Amazon Connect instance
-
Click Routing → Contact Flows
-
Create a new Inbound Flow
-
Add a Invoke AWS Lambda Function block
-
Select the Lambda you will create below
-
Pass the caller's number (from
Customer Number
)
2. Create the AWS Lambda Function
Go to AWS Lambda and create a function:
-
Runtime: Node.js or Python (we'll use Python)
-
Permissions: Allow
AmazonConnect
,Logs
, and optionallySecretsManager
import json
import requests
def lambda_handler(event, context):
phone_number = event['Details']['ContactData']['CustomerEndpoint']['Address']
payload = {
"phone": phone_number
}
# Replace with your actual SoftyCRM endpoint
response = requests.post("https://your-crm.com/api/incoming-call", json=payload)
if response.status_code == 200:
return {
'statusCode': 200,
'body': json.dumps('Lead processed')
}
else:
return {
'statusCode': 500,
'body': json.dumps('Failed to contact CRM')
}
3. Set Up CRM API Endpoint (SoftyCRM Example)
Your CRM should expose an endpoint like:
POST /api/incoming-call
Content-Type: application/json
{
"phone": "+15551234567"
}
Expected Response:
{
"lead_id": 789,
"case_id": 345,
"status": "created"
}
The CRM opens a new case, assigns it to the team, and shows it in the dashboard.
How to Test and Deploy
-
Test from Amazon Connect's Test Contact Flow interface
-
Add logging inside Lambda using
print()
orCloudWatch Logs
-
Confirm CRM receives the request
-
Ensure CRM UI refreshes or uses WebSockets/Pusher to display the new case
Troubleshooting
Common Errors
-
❌
AccessDenied
— Check Lambda IAM role permissions -
❌
Timeout
— Ensure CRM endpoint is accessible and quick -
❌
500
— Review CRM logs for validation or server errors
Debugging Tips
-
Use CloudWatch Logs to debug Lambda outputs
-
Add
print(event)
in Lambda to inspect incoming data -
Test CRM API with curl/Postman independently
Conclusion
By integrating Amazon Connect with your CRM like SoftyCRM, you:
-
Streamline agent workflows
-
Improve first-call resolution
-
Reduce manual data entry
This setup can be adapted for any CRM with an API, but SoftyCRM Amazon Connect integration is especially fast to implement.
➡️ Try SoftyCRM now – zero setup required
Need help? Contact us for guided integration or onboarding support.