Asynchronous AWS Lambda execution

Asynchronous AWS Lambda execution

Published:
This blog contains links to re-create the AWS Lambda and contact flows in your own AWS account

If you have been using Amazon Connect for external API calls, you will have no doubt come across the fact that not all APIs are built equal. Some APIs return an immediate response whilst others need some time to process the request.

With Amazon Connect "Invoke AWS Lambda" action blocks are IO blocking.

What does this mean? Well whilst you're waiting for the response you cannot interact with your customer. If they are on the telephone this can feel like a lifetime. As result Aamzon Connect limited AWS Lamnda blocks to 8 seconds. If you wanted longer you had to create an async process yourself and call your datastore every x seconds to see if the result was ready to be used. But no more!

In July 2025 AWS dropped a new feature called "Parallel AWS Lambda execution in flows" What this provides is the ability to now trigger the AWS Lambda block and then do something else whilst that process completes (Hence Parallel) The technology is Asynchronous Lambda execution. But you can trigger more than 1!

The official documentation is here.

With this change comes a change to the AWS Lambda block as seen here:

The updated AWS Lambda block
The updated AWS Lambda block

Along with a tweak to the Wait block to support an improved customer experience:

The updated Wait block
The updated Wait block

Getting hands on

Reading the docs is one thing, testing it out is much better. You will find the AsyncExecution lambda and contact flow in the GitHub repo for the blog.

  • Deploy the AWS Lambda
  • Enable Amazon Connect to invoke the AWS Lambda
  • Deploy the contact flow and connect up a phone number
  • Test and enjoy

Async Execution provided contact flow
Async Execution provided contact flow

Learnings

  • It works! and its a much better customer experience. As soon as the lambda returns the contact is sent down the Continue branch from the Wait block. Think about using this for:
    • IVR Payments
    • CRM updates
    • Application processes
  • With Async you can trigger 1 or more lambdas at a time. When using more than one you need to use Lambda Invocation JSON path. If you're just doing one this is much simplier and requires no special state management.
  • Async lambdas still have a limit, 60s. Therefore set your AWS Lambda timeout and the contact flow appropriately to handle timeouts.
  • Wait blocks are not required but provide for a better UX. Use the blocks according to your use case.

Enjoy!

If you need help with the sample AWS Lambda see this post: