Community-maintained durable execution SDK for AWS Lambda in Python
Project description
Async Durable Execution for Python
Build reliable, long-running AWS Lambda workflows with checkpointed steps, waits, callbacks, and parallel execution.
This package is distributed from a community-maintained fork of the original Apache-2.0 licensed AWS project and continues under Apache License 2.0 with upstream notices preserved.
This fork is specifically focused on making async Python work naturally with durable functions. The public API remains synchronous at the durable operation boundary, but the examples, helpers, and package direction here prioritize async def handlers, steps, child contexts, callback submitters, and condition checks.
✨ Key Features
- Async-first fork - This fork prioritizes making
async defworkflows feel natural with durable functions - 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
- Async Python support - Use
async deffor handlers, steps, child contexts, callback submitters, and wait-for-condition checks
📦 Packages
🚀 Quick Start
This fork recommends writing new durable workflows with async callables by default.
Install the execution SDK:
pip install async-durable-execution
Create a durable Lambda handler:
import asyncio
from async_durable_execution import (
DurableContext,
StepContext,
durable_execution,
durable_step,
)
from async_durable_execution.config import Duration
@durable_step
async def validate_order(step_ctx: StepContext, order_id: str) -> dict:
await asyncio.sleep(0)
step_ctx.logger.info("Validating order", extra={"order_id": order_id})
return {"order_id": order_id, "valid": True}
@durable_execution
async 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}
Async callables are supported anywhere the SDK accepts user code, including map() item functions, parallel() branches, child contexts, callback submitters, and wait-for-condition checks. The public Durable APIs stay synchronous, so async work is awaited transparently for you:
import asyncio
from async_durable_execution import (
DurableContext,
StepContext,
durable_execution,
durable_step,
)
@durable_step
async def fetch_order(step_ctx: StepContext, order_id: str) -> dict:
await asyncio.sleep(0)
step_ctx.logger.info("Fetched order", extra={"order_id": order_id})
return {"order_id": order_id, "status": "ready"}
@durable_execution
async def handler(event: dict, context: DurableContext) -> dict:
order = context.step(fetch_order(event["order_id"]), name="fetch_order")
return {"order": order}
📚 Documentation
The complete documentation for the AWS Durable Execution SDK for Python lives on the AWS Documentation site:
- AWS Durable Execution Documentation - Concepts, getting started, core operations, advanced topics, and API reference
- AWS Lambda Durable Functions Guide - How durable functions work on Lambda
💬 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 async_durable_execution-2.0.0a1.tar.gz.
File metadata
- Download URL: async_durable_execution-2.0.0a1.tar.gz
- Upload date:
- Size: 215.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4fdc56323084ebd27b2f8abad31d40d1559e00f5c45ff1da14f34092d40a467
|
|
| MD5 |
cb613ae0305746d92fdb5bb9c7e739c6
|
|
| BLAKE2b-256 |
8df19d1941ca925d9a9f4bfec7b42aa2987a27de31fc9b865e85b3356bc3952d
|
Provenance
The following attestation bundles were made for async_durable_execution-2.0.0a1.tar.gz:
Publisher:
pypi-publish.yml on zhongkechen/async-durable-execution
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
async_durable_execution-2.0.0a1.tar.gz -
Subject digest:
f4fdc56323084ebd27b2f8abad31d40d1559e00f5c45ff1da14f34092d40a467 - Sigstore transparency entry: 1786497741
- Sigstore integration time:
-
Permalink:
zhongkechen/async-durable-execution@156e7413005a0ef29def592ee9cca54577bef8ce -
Branch / Tag:
refs/tags/v2.0.0a1 - Owner: https://github.com/zhongkechen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@156e7413005a0ef29def592ee9cca54577bef8ce -
Trigger Event:
release
-
Statement type:
File details
Details for the file async_durable_execution-2.0.0a1-py3-none-any.whl.
File metadata
- Download URL: async_durable_execution-2.0.0a1-py3-none-any.whl
- Upload date:
- Size: 98.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2694bc63266a144bcd3f8f36a2862f4c762993d2769821c7912af1554f84dc48
|
|
| MD5 |
f48aba09355630f7ab2b6e26a38e9313
|
|
| BLAKE2b-256 |
3f0a74ad7c75bf5e743329c71730b4d55d2ed384f1f19bb6142632ca84f7b536
|
Provenance
The following attestation bundles were made for async_durable_execution-2.0.0a1-py3-none-any.whl:
Publisher:
pypi-publish.yml on zhongkechen/async-durable-execution
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
async_durable_execution-2.0.0a1-py3-none-any.whl -
Subject digest:
2694bc63266a144bcd3f8f36a2862f4c762993d2769821c7912af1554f84dc48 - Sigstore transparency entry: 1786497868
- Sigstore integration time:
-
Permalink:
zhongkechen/async-durable-execution@156e7413005a0ef29def592ee9cca54577bef8ce -
Branch / Tag:
refs/tags/v2.0.0a1 - Owner: https://github.com/zhongkechen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@156e7413005a0ef29def592ee9cca54577bef8ce -
Trigger Event:
release
-
Statement type: