Skip to main content

AWS Durable Execution SDK for Python

Project description

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

🚀 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

New to durable functions?

Core operations:

Advanced topics:

Architecture:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws_durable_execution_sdk_python-1.3.0.tar.gz (278.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file aws_durable_execution_sdk_python-1.3.0.tar.gz.

File metadata

File hashes

Hashes for aws_durable_execution_sdk_python-1.3.0.tar.gz
Algorithm Hash digest
SHA256 eb94b47b2fdea05e4d54902609d38d8bb5fe90ef18a516f447ac8405cf69c588
MD5 9a08e085cc1f44e9b5fd9484f8283906
BLAKE2b-256 fbe0acc32abf16a89f6985a94ccb6d6f7dd6d557aad5180c9433f80ca598a2d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for aws_durable_execution_sdk_python-1.3.0.tar.gz:

Publisher: pypi-publish.yml on aws/aws-durable-execution-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aws_durable_execution_sdk_python-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_durable_execution_sdk_python-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ec7e85b24dc58715b00ffd523ef0baebf9450b48f3e83283e99ccb585dbc645
MD5 80bd36a0bb0b686821c1a2a20fe93ef2
BLAKE2b-256 9f636ff52c9a2944f1647510ea57870d089d1e32cdb3a8f12149ae8a609c2e62

See more details on using hashes here.

Provenance

The following attestation bundles were made for aws_durable_execution_sdk_python-1.3.0-py3-none-any.whl:

Publisher: pypi-publish.yml on aws/aws-durable-execution-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page