Lambda Functions in Flows
Extend Amazon Connect flow functionality by accessing other AWS services or third-party APIs. Invoked using the Invoke AWS Lambda function block.
Invoke AWS Lambda Function Block
Flow block that passes input parameters to Lambda function. Lambda performs operations and returns data back to the flow.
Lambda Response Format
Lambda formats information into specific response format and sends back to flow. Data is used to improve experiences in Amazon Connect flows.
Lambda with DynamoDB Pattern
Lambda uses input parameters to query DynamoDB table. Formats results and returns to flow for improved customer experience.
Retrieving Customer Info Use Case
Lambda checks if caller has existing open case using phone number. Returns name and case details to route to specialist team immediately.
JSON Response Validation
Choose JSON option in response validation when expecting structured data from Lambda. Example: firstName
Check Contact Attribute Block
Flow block used to branch calls based on attributes returned from Lambda. Routes contacts differently based on Lambda response.
Self-Service Payments Use Case
Lambda integrates with external payment system to process transactions. Customers can make payments without relying on business hours.
Amazon Lex with Lambda
Lex bot captures payment details and passes to Lambda function. Lambda processes transaction and returns result as contact attribute.
Routing Enhancement Use Case
Lambda retrieves customer membership status and preferred language. Routes to appropriate queue with agents who speak customer’s language.
STRING_MAP Response Validation
Choose STRING_MAP option for flat object key-value pairs from Lambda. Example: membershipStatus and preferredLanguage attributes.
User-Defined Contact Attributes
Data returned from Lambda stored as user-defined contact attributes. Used in Play prompt blocks to read information back to customer.
Dynamic Prompts
Prompts that use contact attributes to personalize messages. Example: greeting customer by name and mentioning their case number.
Synchronous Lambda Invocation
Flow invokes Lambda function and waits for response before proceeding. Maximum timeout duration is 8 seconds.
Lambda Timeout Configuration
Configure timeout value less than 8 seconds in Invoke AWS Lambda function block settings. Function must return results fast to avoid negative contact experience.
Event Object
JSON object containing contact context that Amazon Connect sends to Lambda function. Lambda accesses and processes data received in this object.
Success vs Error Branch
Success branch runs if Lambda returns well-formatted response. Error branch runs if invocation error occurs or response format is wrong.
Details Property
Contains ContactData property and Parameters property. Part of the event object sent to Lambda function.
ContactData Property
Includes current contact interaction details like communication channel
Parameters Property
Contains function input parameters configured in the Invoke AWS Lambda function block. Passes additional information from flow to Lambda.
Function Input Parameters
Additional information passed to Lambda using key-value pairs in block configuration. Example: operation key with checkBalance value.
ContactId
Unique identifier for the contact. Included in ContactData as additional information.
STRING_MAP Response Format
Lambda returns flat object of key-value pairs. Used for simple responses without nested objects.
JSON Response Format
Accommodates complex responses that include nested JSON objects. More flexible than STRING_MAP for structured data.