How flow blocks use Lex session attributes - Amazon Connect

How flow blocks use Lex session attributes

When a customer starts a conversation with your bot, Amazon Lex creates a session. With session attributes, also known as Lex attributes, you can pass information between the bot and Amazon Connect during the session. For a list of Amazon Lex attributes that you can use, see Amazon Lex contact attributes.

Life cycle of session attributes

Each conversation contains one set of session attributes. In cases where an AWS Lambda function is invoked to do some processing, Amazon Lex runs the attributes in the following order:

  • Service defaults: These attributes are only used if no attributes are defined.

  • Session attributes provided by Amazon Connect: These attributes are defined in the Get customer input block.

  • Session attributes provided by Lambda override everything prior: When an AWS Lambda function is invoked and it does some processing, it overrides any session attributes set in the Get customer input block.

Let's say a customer utters that they want a car. That's the first session attribute to go through processing. When asked what kind of car, they say luxury car. This second utterance overrides any Lambda processing that took place on the first utterance.

For an example of how to create a Lambda function that processes session attributes, see Step 1: Create a Lambda Function in the Amazon Lex Developer Guide. For information about Amazon Lex V2, see Setting session attributes.

For the structure of the event data that Amazon Lex provides to a Lambda function, see Lambda Function Input Event and Response Format in the Amazon Lex Developer Guide. For information about Amazon Lex V2, see Interpreting the input event format.

Flow blocks that support Lex session attributes

You can use Lex session attributes in the following flow blocks when a Lex bot is called:

More information

For more information about using Amazon Lex session attributes, see Managing Conversation Context in the Amazon Amazon Lex V1 Developer Guide.