Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Integrating an AWS Lambda function into your bot

Focus mode
Integrating an AWS Lambda function into your bot - Amazon Lex

With AWS Lambda functions, you can extend and better control the behavior of your Amazon Lex V2 bot through custom functions that you define. Amazon Lex V2 uses one Lambda function per bot alias per language instead of one Lambda function for each intent. Before you begin, determine which fields in the input event you want to draw information from and which fields in the response you want to manipulate and return from your Lambda function

To integrate a Lambda function with your Amazon Lex V2 bot, carry out the following steps:

  1. Create a function in AWS Lambda using your programming language of choice and write up your script.

  2. Make sure that the function returns a structure matching the response format.

  3. Deploy the Lambda function.

  4. Associate the Lambda function with a Amazon Lex V2 bot alias with the console or API operations.

  5. Select the conversation stages at which you want to invoke your Lambda function with the console or API operations.

  6. Build your Amazon Lex V2 bot and test that the Lambda function works as intended. Debug your function with the help of Amazon CloudWatch.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.