Skip to main content

Async Lambda Durable Execution SDK for Python

Project description

Async Durable Execution SDK for Python

License


Build AWS Lambda Durable Functions With Async Python

✨ 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

🚀 Quick Start

Install the execution SDK:

pip install async-durable-execution

Create a durable Lambda handler:

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:
    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 = await 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)
    await context.wait(duration=Duration.from_seconds(5), name="await_confirmation")

    return {"status": "approved", "order_id": order_id}

📚 Documentation

💬 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

async_durable_execution-0.1.0.tar.gz (180.0 kB view details)

Uploaded Source

Built Distribution

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

async_durable_execution-0.1.0-py3-none-any.whl (84.6 kB view details)

Uploaded Python 3

File details

Details for the file async_durable_execution-0.1.0.tar.gz.

File metadata

  • Download URL: async_durable_execution-0.1.0.tar.gz
  • Upload date:
  • Size: 180.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for async_durable_execution-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0cd70391a90ed65302dc3f3f8ab9b8820528cdee1abe21c1df7e1706b0964e92
MD5 2a97f9c58115c31894239a5747a1e0e3
BLAKE2b-256 9767bde4a79ca04b4ae7cf8e4a1db3b37e3562471bdb757527431783a65a56b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for async_durable_execution-0.1.0.tar.gz:

Publisher: pypi.yml on zhongkechen/async-durable-execution

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

File details

Details for the file async_durable_execution-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for async_durable_execution-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81812fccc5f14a07cd1f3b3b1c5b645c59f431ba3f6d83418f1bbd216b45823a
MD5 924e15d33d4eed43998226b148d7962c
BLAKE2b-256 ed4278c7a87067d9a386435be96327cfba72438a3eb71ea955558a9d15d0aa20

See more details on using hashes here.

Provenance

The following attestation bundles were made for async_durable_execution-0.1.0-py3-none-any.whl:

Publisher: pypi.yml on zhongkechen/async-durable-execution

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