Skip to content

Add Python samples for durabletask-python v1.4.0 features#243

Open
andystaples wants to merge 1 commit intoAzure-Samples:mainfrom
andystaples:andystaples/add-python-new-feature-samples
Open

Add Python samples for durabletask-python v1.4.0 features#243
andystaples wants to merge 1 commit intoAzure-Samples:mainfrom
andystaples:andystaples/add-python-new-feature-samples

Conversation

@andystaples
Copy link
Copy Markdown

Summary

Adds 4 new Python sample directories and updates 1 existing sample to cover the major features added in durabletask-python v1.4.0.

New Samples

large-payload/

Demonstrates automatic externalization of oversized orchestration payloads to Azure Blob Storage using BlobPayloadStore. Shows both small (inline) and large (externalized) payloads transparently handled by the SDK. Includes a docker-compose.yml to start the DTS emulator and Azurite together.

work-item-filtering/

Demonstrates running multiple specialized workers (worker_a.py, worker_b.py) where each only processes specific orchestrations/activities using use_work_item_filters(). Shows auto-generated filter mode.

testing/

Demonstrates unit testing orchestrations and activities without Docker or an emulator using InMemoryOrchestrationBackend from durabletask.testing. Includes pytest-based tests with happy path and failure path coverage.

orchestration-management/

Demonstrates client-side lifecycle management operations: restart_orchestration() (same ID and new ID), purge_orchestrations_by() for batch cleanup, and get_all_orchestration_states() for querying.

Updated Sample

async-http-api/

Replaced the synchronous DurableTaskSchedulerClient with AsyncDurableTaskSchedulerClient for native async/await support. Uses azure.identity.aio.DefaultAzureCredential, FastAPI lifespan for client lifecycle, and async context manager pattern. Added documentation section to README.

Conventions

All new samples follow existing conventions:

  • Kebab-case folder names
  • worker.py / client.py split
  • Standard env var handling (TASKHUB, ENDPOINT)
  • READMEs following SAMPLE_TEMPLATE.md structure
  • requirements.txt with minimal dependencies

Verification

  • All .py files pass python -m py_compile syntax validation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant