Skip to main content

AWS Durable Execution SDK for Python

Build PyPI - Version PyPI - Python Version OpenSSF Scorecard License


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

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

Dynamic instrumentation plugins

Instrumentation plugins can be selected at Lambda cold start without importing them in the function artifact. Install a provider package in the function or a Lambda layer, then set an ordered allow-list:

DURABLE_EXECUTION_PLUGINS=otel-invocation,example_audit

The SDK resolves those names from the aws_durable_execution.plugins Python entry-point group when the decorated handler is initialized. An unset or blank variable preserves the existing behavior. The decorator's plugins argument remains supported; explicit plugins run first and take precedence when a dynamic provider creates the same concrete plugin type.

Provider packages expose a versioned factory:

from aws_durable_execution_sdk_python.plugin import (
    DurableInstrumentationPlugin,
    DurableInstrumentationPluginProvider,
)


class AuditPlugin(DurableInstrumentationPlugin):
    pass


AUDIT_PLUGIN_PROVIDER = DurableInstrumentationPluginProvider(
    plugin_type=AuditPlugin,
    factory=AuditPlugin,
    plugin_api_version=1,
)

Register the provider in the package's pyproject.toml:

[project.entry-points."aws_durable_execution.plugins"]
example_audit = "example_audit:AUDIT_PLUGIN_PROVIDER"

Set plugin_api_version to the literal API version the provider implements. Update it only after verifying the provider against that API version.

Provider names must be unique across installed distributions. Missing, ambiguous, incompatible, or invalid providers raise PluginLoadError during handler initialization with the provider and distribution details.

🚀 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

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.

Release files for aws-durable-execution-sdk-python 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-durable-execution-sdk-python 2.0.0
File Size Uploaded
aws_durable_execution_sdk_python-2.0.0.tar.gz 312.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aws-durable-execution-sdk-python 2.0.0
File Interpreter ABI Platform
aws_durable_execution_sdk_python-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 442.7 kB

Release files / aws_durable_execution_sdk_python-2.0.0.tar.gz

Download URL aws_durable_execution_sdk_python-2.0.0.tar.gz
Size 312.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ea95358142bfb596e81f4aa3542a84f745ce86578ed0dec5beed40a429a53adb
BLAKE2b-256 checksum
How to use checksums
581c5c028a904ce277bacbaee5805e0c6b47948231dadf3c18e465de0d789fe0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / aws_durable_execution_sdk_python-2.0.0-py3-none-any.whl

Download URL aws_durable_execution_sdk_python-2.0.0-py3-none-any.whl
Size 130.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36f5934d681e97da091c2fa8cdebf68fbffe4142a22c05b5ba4b4baa92bf25b3
BLAKE2b-256 checksum
How to use checksums
bddd8267a41bb2ea8f0addf5abf4b80216e0382c2826bd1159eb2194aa4504d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.1

2 release files

This release

2.0.0 This release

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page