If you’ve ever called a bank’s helpline and navigated through a phone menu — “Press 1 for account balance, Press 2 for card services” — you’ve already experienced an IVR (Interactive Voice Response) system. Amazon Connect is AWS’s cloud-based contact center service that lets you build these kinds of systems without managing any telephony infrastructure.
In this post I’ll walk you through the core concepts and show you how to build your first real contact flow from scratch.
Amazon Connect is a self-service, omnichannel cloud contact center. At its core it provides:
A contact flow is the brain of your IVR. Think of it as a flowchart where each box is a block. Blocks can play audio, get input, invoke a Lambda, transfer to a queue, or disconnect. Connect has several flow types:
A queue holds contacts waiting for an agent. A routing profile maps queues to agents, with priority and delay settings so you can control which queue an agent picks up from first.
Attributes are key-value pairs that travel with the contact throughout its lifecycle. You set them using the Set contact attributes block and read them anywhere downstream — in Lambda functions, in whisper flows, or in reporting.
We’ll build a flow that:
In the AWS Console, open Amazon Connect and click Create instance. Choose Store users in Amazon Connect, set an access URL (e.g., mybank.my.connect.aws), skip data storage customisation for now, and finish the wizard.
In your Connect instance dashboard go to Channels → Phone numbers → Claim a number. Pick a DID number in your country. Leave the contact flow as Default inbound flow for now — we’ll change it after we build ours.
Our flow will call a Lambda to retrieve a balance. Create a Python Lambda with this handler:
import json
def lambda_handler(event, context):
# event['Details']['ContactData']['CustomerEndpoint']['Address'] gives the caller's phone number
caller = event['Details']['ContactData']['CustomerEndpoint']['Address']
return {
"balance": "2,450.00",
"currency": "USD",
"caller": caller
}
After deploying, go to your Connect instance in the console → Flows → AWS Lambda and add the function ARN so Connect is allowed to invoke it.
Open Routing → Contact flows → Create contact flow. You’ll see a canvas with just an Entry point block.
1 and 2.balance in a contact attribute called AccountBalance.Wire all the blocks together, connect the Timeout and Error branches to a friendly error prompt followed by disconnect, and click Save & Publish.
Go back to Channels → Phone numbers, edit your claimed number, and change Contact flow / IVR to your new flow. Call the number — you should hear your greeting!
<say-as interpret-as="cardinal">2450</say-as>.Once you’re comfortable with basic flows, the natural next step is adding conversational AI with Amazon Lex so callers can say “What’s my balance?” instead of pressing keys. I cover that in depth in the next post.