AWS Lambda Durable Execution with Java SDK

Client AWS CLI → AWS Lambda Durable function → Amazon CloudWatch Logs

Build a resilient, multi-step order processing workflow using the AWS Lambda Durable Execution SDK for Java with automatic checkpointing and failure recovery.

This pattern deploys a Lambda durable function written in Java that orchestrates a multi-step order processing workflow. The function uses the Durable Execution SDK for Java to automatically checkpoint progress at each step.
The workflow: (1) validates the order, (2) reserves inventory, (3) processes payment, (4) waits for warehouse processing (no compute charges), (5) confirms shipment. Each step is checkpointed, so if the function is interrupted, it resumes from the last completed step.
The Java SDK provides DurableHandler<I,O> and DurableContext, supporting steps, waits, callbacks, invoke, map, and parallel operations.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-durable-order-workflow/java/cdk

Deploy

cd src && mvn clean package -qcd .. && cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk destroy.

Created by:

Nithin Chandran R

Nithin Chandran R

Technical Account Manager at AWS