What is AWS Lambda durable functions?
AWS Lambda durable functions is a capability of AWS Lambda for resilient, multi-step applications and AI workflows that run for up to one year while maintaining reliable progress despite interruptions. Such a run is called a durable execution: Lambda tracks progress through checkpoints and automatically recovers from failures through replay. During replay, your code runs from the beginning but skips completed checkpoints and uses the stored results instead. This keeps long-running executions consistent without re-executing completed work.
Durable functions solve a common challenge in serverless architectures: maintaining state and reliability across many steps and long time spans without building your own state machines, retry logic, and recovery mechanisms. Using the AWS Durable Execution SDK, you write the workflow as normal sequential code in familiar languages and use two durable operations: steps wrap business logic with built-in retries and checkpointing, waits suspend execution without incurring compute charges. AWS positions AWS Lambda durable functions as a code-native alternative to AWS Step Functions: the workflows live directly in Lambda and stay tightly coupled to your business logic.
Key features
- Durable execution up to one year: Multi-step workflows run reliably from seconds up to one year. Checkpoints persist progress and enable automatic recovery after interruptions.
- Steps and waits via the SDK: Steps run business logic with built-in retries and progress checkpointing. Waits suspend execution without incurring compute charges and suit human-in-the-loop, polling, and long waits on external dependencies.
- Checkpoint-and-replay: The mechanism tracks progress and automatically recovers from failures by re-running from the start and skipping completed steps. State management runs behind the scenes, keeping application code clean and readable.
- Code-native in familiar languages: The AWS Durable Execution SDK supports JavaScript, TypeScript, Python, and Java. You wrap the Lambda event handler with a DurableContext that gives access to the durable operations.
Typical use cases
Order fulfillment: Coordinate orders across inventory, payment, shipping, and notification. Durable functions preserve order state through interruptions, handle partial failures automatically, and wait efficiently for external events without consuming compute.
Resilient payment flows: Coordinate multi-step authorization, fraud checks, and settlement across payment providers. Transaction state is preserved through failures, retries run automatically, and every step stays auditable.
Multi-step AI workflows: Chain model calls, incorporate human feedback, and handle long-running tasks deterministically during failures. Execution resumes automatically after suspension, and you pay only for active processing time.
Benefits
- Resilient code in familiar programming languages, without building your own state machines, retry logic, or recovery mechanisms.
- No compute charges during wait time: for long-running workflows you pay only for actual processing time.
- Serverless operating model with automatic scaling including scale-to-zero, without managing infrastructure.
Integration with innFactory
As an AWS Reseller, innFactory supports you with the adoption and operation of this service.
Typical Use Cases
Frequently Asked Questions
What is AWS Lambda durable functions?
AWS Lambda durable functions is a capability of AWS Lambda for stateful, multi-step workflows that run reliably from seconds up to one year. A checkpoint-and-replay mechanism tracks progress and automatically recovers from failures by re-running from the start while skipping completed work. You write the workflow as normal sequential code in familiar programming languages.
When should I use AWS Lambda durable functions?
Durable functions fit multi-step processes that are stateful and must survive failures: order fulfillment across inventory, payment, and shipping, resilient payment and settlement flows, multi-step AI workflows with human feedback, and long-running business processes such as employee onboarding or approval workflows that span days or weeks and wait for external events.
How much does AWS Lambda durable functions cost?
Billing follows the standard Lambda model: per request and by GB-seconds of compute time. During wait operations the function suspends and incurs no compute charges. For long-running workflows that wait hours or days, you pay only for actual processing time, not idle waiting.
How do durable functions differ from AWS Step Functions?
Both provide workflow orchestration with automatic state management. Durable functions run within Lambda, use standard programming languages, and are tightly coupled with business logic. Step Functions is a standalone service with a graph-based DSL or visual designer and native integrations to 220+ AWS services. Durable functions suit application development in Lambda, Step Functions suits cross-service orchestration.