AWS Durable Execution SDK for Python
Project description
AWS Durable Execution SDK for Python
Build reliable, long-running AWS Lambda workflows with checkpointed steps, waits, callbacks, and parallel execution.
✨ Key Features
- 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
📦 Packages
| Package | Description | Version |
|---|---|---|
aws-durable-execution-sdk-python |
Execution SDK for Lambda durable functions | |
aws-durable-execution-sdk-python-testing |
Local/cloud test runner and pytest helpers |
🚀 Quick Start
Install the execution SDK:
pip install aws-durable-execution-sdk-python
Create 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}
📚 Documentation
- 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.
💬 Feedback & Support
📄 License
See the LICENSE file for our project's licensing.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aws_durable_execution_sdk_python-1.1.2.tar.gz.
File metadata
- Download URL: aws_durable_execution_sdk_python-1.1.2.tar.gz
- Upload date:
- Size: 275.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a46777ea95ea30480737078aea4cdf49f105459f955b2f3d65d7df31d2620a3
|
|
| MD5 |
f951a51a5047b04924a67e6a2290f1ce
|
|
| BLAKE2b-256 |
3eaa5f9fcaa6b980b121af260396f24719dca6d4817fe842ee3a509a09144705
|
Provenance
The following attestation bundles were made for aws_durable_execution_sdk_python-1.1.2.tar.gz:
Publisher:
pypi-publish.yml on aws/aws-durable-execution-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_durable_execution_sdk_python-1.1.2.tar.gz -
Subject digest:
6a46777ea95ea30480737078aea4cdf49f105459f955b2f3d65d7df31d2620a3 - Sigstore transparency entry: 864309241
- Sigstore integration time:
-
Permalink:
aws/aws-durable-execution-sdk-python@a609a45ed38b648bc3a8f819e0f110e2e79df2f5 -
Branch / Tag:
refs/tags/v1.1.2 - Owner: https://github.com/aws
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a609a45ed38b648bc3a8f819e0f110e2e79df2f5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aws_durable_execution_sdk_python-1.1.2-py3-none-any.whl.
File metadata
- Download URL: aws_durable_execution_sdk_python-1.1.2-py3-none-any.whl
- Upload date:
- Size: 86.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
900f9e71af3807bd7427a5014f25cf2fd9f853548d0246b5f5b4e27eca02225e
|
|
| MD5 |
682f2ecc383ed6b84e1002b5d25ccafb
|
|
| BLAKE2b-256 |
1d1fd93c42efaac152f6a4f0e45f67ed458985421d8834d9f2f826c714151550
|
Provenance
The following attestation bundles were made for aws_durable_execution_sdk_python-1.1.2-py3-none-any.whl:
Publisher:
pypi-publish.yml on aws/aws-durable-execution-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_durable_execution_sdk_python-1.1.2-py3-none-any.whl -
Subject digest:
900f9e71af3807bd7427a5014f25cf2fd9f853548d0246b5f5b4e27eca02225e - Sigstore transparency entry: 864309267
- Sigstore integration time:
-
Permalink:
aws/aws-durable-execution-sdk-python@a609a45ed38b648bc3a8f819e0f110e2e79df2f5 -
Branch / Tag:
refs/tags/v1.1.2 - Owner: https://github.com/aws
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a609a45ed38b648bc3a8f819e0f110e2e79df2f5 -
Trigger Event:
release
-
Statement type: