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:

  1. Amazon Connect triggers a Lambda function

  2. Lambda gets the caller's phone number

  3. Lambda checks SoftyCRM via API

  4. SoftyCRM returns lead info or creates a new lead and opens a case

  5. 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

  1. Go to your Amazon Connect instance

  2. Click Routing → Contact Flows

  3. Create a new Inbound Flow

  4. Add a Invoke AWS Lambda Function block

  5. Select the Lambda you will create below

  6. 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 optionally SecretsManager

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() or CloudWatch 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.