Timeout Issue with Lambda Fulfillment in Amazon Lex Despite Setting Timeout to 900 Seconds

0

Hello AWS Community,

I'm encountering a timeout issue with a Lambda function that serves as a code hook for fulfillment in an Amazon Lex V2 bot. Despite setting the bot fulfillment timeout to 900 seconds and configuring the start response with a delay of 1 second and periodic responses every 20 seconds, my bot invocation times out in just 30 seconds when attempting to call an external API that takes longer to respond.

Here are the details of my setup:

Lex Bot Configuration:

Fulfillment updates: Active Start response delay: 1 second Periodic response interval: 20 seconds Fulfillment timeout: 900 seconds Lambda Function Configuration:

Runtime: Python 3.10 Timeout: Set to match the Lex bot fulfillment timeout (15 minutes) The function is designed to call an external API that may take longer than 30 seconds to respond. Issue Description:

When testing the bot, the Lambda function is invoked for fulfillment as expected. However, the function times out in 30 seconds, which is much shorter than the configured 900-second timeout. If I modify the Lambda function to return dummy output with a lesser response time, it works fine without any timeout issues. I have confirmed that the Lambda function's timeout setting is correctly configured to handle longer processing times, and there are no apparent issues with the function's code that would cause it to exceed the expected timeout (I can find in logs generating required response from openai within 90 sec but during bot testing it reaches timeout in just 30 sec).

Has anyone faced a similar issue, or can someone provide insights into what might be causing this discrepancy between the configured timeout and the actual timeout behavior? Additionally, are there any best practices or additional configurations I should consider to ensure that my bot can handle longer processing times without timing out prematurely?

Thank you in advance for your assistance!

** EDITED**

Lambda General Configuration -

Lex - Lex -

Enter image description here

Enter image description here

  • Hello Omkar,

    Could you share screenshot of lambda general configuration and Lex Fulfilment updates - optional screens?

Omkar
asked 3 months ago136 views
1 Answer
0

The fulfilment updates are only available on streaming conversations [1]. It is not possible to have a longer timeout than 30 seconds on a non-streaming conversation (e.g. using the built in test console). If you are using a streaming conversation, are you getting any of in-progress messages before it times out?

[1] https://docs.aws.amazon.com/lexv2/latest/dg/streaming.html

AWS
Gillian
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions