Wed, Apr 16, 2025
Read in 1 minutes
Original post on dev.to: https://dev.to/jjrawlins/slackbot-timeouts-getting-you-down-2lic
Slack APIs have a 3-second timeout, so if the Lambda doesn’t respond, you’ll receive a timeout message in the Slack channel before the response is ever issued.
Here are some reasons for these timeouts:
However, by using an API gateway, you now have plenty of time to process the data because Slack will get the response immediately.
By first going through the API Gateway, you can respond immediately to Slack while sending a copy to SQS, triggering the Lambda with the SQS message. This gives your lambda plenty of time to process data, look up information, make requests, or do whatever it needs to do to provide a response back to the originating channel or perhaps another Slack channel.
No timeouts, just a nice workflow that you could wire in any logic.