Skip to content

AWS Durable Execution SDK for Python

BuildPyPI - VersionPyPI - Python VersionOpenSSF ScorecardLicense


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.logger for structured, de-duplicated logs
  • Local and cloud testing - Validate workflows with the testing SDK

📦 Packages

PackageDescriptionVersion
aws-durable-execution-sdk-pythonExecution SDK for Lambda durable functionsPyPI - Version
aws-durable-execution-sdk-python-testingLocal/cloud test runner and pytest helpersPyPI - Version

🚀 Quick Start

Install the execution SDK:

pip install aws-durable-execution-sdk-python

Create a durable Lambda handler:

fromaws_durable_execution_sdk_pythonimport (
DurableContext,
StepContext,
durable_execution,
durable_step,
)
fromaws_durable_execution_sdk_python.configimportDuration@durable_stepdefvalidate_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_executiondefhandler(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")
ifnotvalidation["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

The complete documentation for the AWS Durable Execution SDK for Python lives on the AWS Documentation site:

💬 Feedback & Support

📄 License

See the LICENSE file for our project's licensing.

About

Lambda durable functions SDK

Resources

Code of conduct

Contributing

Security policy

Stars

52 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages