AWS AppSync now supports long running events with asynchronous Lambda function invocations

Posted on: May 30, 2024

AWS AppSync now allows customers to invoke their Lambda functions, configured as AppSync data sources, in an event-driven manner. This new capability enables asynchronous execution of Lambda functions, providing more flexibility and scalability for serverless and event-driven applications.

Previously, customers could only invoke Lambda functions synchronously from AppSync, which meant that the GraphQL API would wait for the Lambda function to complete before returning a response. With support for Event mode, AppSync can now trigger Lambda functions asynchronously, decoupling the API response from the Lambda execution. This is particularly beneficial for long-running operations (e.g. initiating a generative AI model inference, and leveraging the Lambda function to send model responses to clients over AppSync WebSockets), batch processing (e.g. kicking off a database processing job), or scenarios where immediate responses are not required (e.g. creating and putting messages in a queue).

This feature is available in all AWS regions supported by AppSync. For more details, refer to the AppSync documentation.