Build PyPI - Version PyPI - Python Version OpenSSF Scorecard License
Build reliable, long-running AWS Lambda workflows with checkpointed steps, waits, callbacks, and parallel execution.
- Automatic checkpointing - Resume execution after Lambda pauses or restarts
- Durable steps - Run work with retry strategies and deterministic replay
- Waits and callbacks - Pause for time or external signals without blocking Lambda
- Parallel and map operations - Fan out work with configurable completion criteria
- Child contexts - Structure complex workflows into isolated subflows
- Replay-safe logging - Use
context.loggerfor structured, de-duplicated logs - Local and cloud testing - Validate workflows with the testing SDK
| Package | Description | Version |
|---|---|---|
aws-durable-execution-sdk-python |
Execution SDK for Lambda durable functions | PyPI - Version |
aws-durable-execution-sdk-python-testing |
Local/cloud test runner and pytest helpers | PyPI - Version |
Install the execution SDK:
pip install aws-durable-execution-sdk-pythonCreate a durable Lambda handler:
from aws_durable_execution_sdk_python import ( DurableContext, StepContext, durable_execution, durable_step, ) from aws_durable_execution_sdk_python.config import Duration @durable_step def validate_order(step_ctx: StepContext, order_id: str) -> dict: step_ctx.logger.info("Validating order", extra={"order_id": order_id}) return {"order_id": order_id, "valid": True} @durable_execution def handler(event: dict, context: DurableContext) -> dict: order_id = event["order_id"] context.logger.info("Starting workflow", extra={"order_id": order_id}) validation = context.step(validate_order(order_id), name="validate_order") if not validation["valid"]: return {"status": "rejected", "order_id": order_id} # simulate approval (real world: use wait_for_callback) context.wait(duration=Duration.from_seconds(5), name="await_confirmation") return {"status": "approved", "order_id": order_id}
- AWS Documentation - Official AWS Lambda durable functions guide
- Documentation index - SDK Overview and navigation
New to durable functions?
- Getting started guide - Build your first durable function
Core operations:
- Steps - Execute code with automatic checkpointing and retry support
- Wait operations - Pause execution without blocking Lambda resources
- Callbacks - Wait for external systems to respond
- Invoke operations - Call other durable functions and compose workflows
- Child contexts - Organize complex workflows into isolated units
- Parallel operations - Run multiple operations concurrently
- Map operations - Process collections in parallel with batching
- Logger integration - Add structured logging to track execution
Advanced topics:
- Error handling - Handle failures and implement retry strategies
- Testing modes - Run tests locally or against deployed Lambda functions
- Testing patterns - Practical testing examples
- Serialization - Customize how data is serialized in checkpoints
Architecture:
- Architecture diagrams - Class diagrams and concurrency flows
API reference:
- API reference docs are in progress. Use the core operation docs above for now.
See the LICENSE file for our project's licensing.