This repository contains the AWS Durable Execution SDK for Python and its companion packages, used to author AWS Lambda durable functions.
Do not rely on this file for method signatures, configuration objects, or code examples. The canonical reference is the AWS Durable Execution SDK Developer Guide, which is maintained alongside SDK releases and covers TypeScript, Python, and Java. Key sections:
For Lambda service topics such as deployment, infrastructure as code, invocation, IAM permissions, and quotas, see the Lambda durable functions guide.
Durable functions use checkpoint and replay. After a wait, failure, or resume, code re-runs from the beginning. Completed steps return their checkpointed results without re-executing, and code outside steps runs again on every replay. This implies four rules:
- Code outside steps must be deterministic. Wrap timestamps, random values, UUID generation, API calls, and any other non-deterministic work in a step.
- Never call durable operations inside a step. Use a child context to group operations.
- Closure mutations inside steps are lost on replay. Return values from steps instead of mutating enclosing scope.
- Side effects outside steps repeat on every replay. Put side effects
in steps.
context.loggeris the exception: it is replay-aware and safe anywhere.
See Determinism and Replay for worked examples.
- Packages live under
packages/: the core SDK (aws-durable-execution-sdk-python), the testing library (aws-durable-execution-sdk-python-testing), the OpenTelemetry plugin (aws-durable-execution-sdk-python-otel), and examples (aws-durable-execution-sdk-python-examples). - Read CONTRIBUTING.md before making changes. Use
hatchfor all tests, type checks, and formatting (for examplehatch run dev-core:test,hatch run dev-core:typecheck, andhatch fmt --checkfrom a package directory). - When the developer guide and the installed SDK source disagree, trust the source in this repository and report the discrepancy.