This SDK provides a Python interface for building workflows that leverage the Durable Execution Engine. The SDK is designed to help you build reliable, fault-tolerant workflows that can recover from failures and ensure consistent results.
- The SDK acts as a client that communicates with the Durable Execution Engine via HTTP API calls.
- When you execute workflow actions using the SDK, it logs action states (started, completed, failed) to the engine.
- The engine manages retries, result caching, and ensures that each action is executed exactly once, even in the face of failures or restarts.
- The SDK requires the
DURABLE_ENGINE_BASE_URLenvironment variable to be set to the engine's API endpoint so it can send these logs and receive execution instructions.
For more details about the engine, see the Durable Execution Engine repository.
Full documentation and usage slides: SDK & Engine Documentation Slides
- Download from: https://www.python.org/downloads/
- During installation, check the box that says "Add Python to PATH".
If you missed the "Add to PATH" step, add these folders to your user PATH:
- Example paths (adjust for your version/username):
C:\Users\<YourUser>\AppData\Local\Programs\Python\Python310\C:\Users\<YourUser>\AppData\Local\Programs\Python\Python310\Scripts\
How to add:
- Open Start Menu → search "Environment Variables" → Edit environment variables for your account.
- Edit the
Pathvariable and add the above folders.
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.
- Make sure Python is installed and the correct folders are in your
PATH(see above). - You may need to disable the Microsoft Store Python alias in Windows settings.
- Open PowerShell and run:
or
py -m pip install poetry(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
- Official docs: https://python-poetry.org/docs/#system-requirements
If poetry is not recognized, add its Scripts folder to your PATH:
Option A: One-time append to user PATH
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";C:\Users\<YourUser>\AppData\Roaming\Python\Scripts", "User")Replace <YourUser> with your Windows username.
Option B: Always append in PowerShell profile
echo 'if (-not (Get-Command poetry -ErrorAction Ignore)) { $env:Path += ";C:\Users\<YourUser>\AppData\Roaming\Python\Scripts" }' | Out-File -Append $PROFILE- In your project directory, run:
poetry install
This example demonstrates how to use the SDK in practice, showcasing integration with an existing system (Food Delivery System, ...). Follow these steps to run the example with an existing engine instance:
Note: The Durable Execution Engine must be running and accessible at the URL you set in
DURABLE_ENGINE_BASE_URLbefore running the example.
-
Set the DURABLE_ENGINE_BASE_URL environment variable
This variable must be set or the project will not run.
In PowerShell (Windows):
$env:DURABLE_ENGINE_BASE_URL="http://localhost:8080/api/v1"
Adjust the URL if your engine is running elsewhere.
-
Navigate to the example folder:
cd example
-
Run the example:
poetry run python main.py
- Make sure the durable execution engine is running and accessible at the URL you set in
DURABLE_ENGINE_BASE_URL. - If you are running the engine in Docker, you may need to adjust the URL (see Docker networking documentation).
- The project will not function without the
DURABLE_ENGINE_BASE_URLenvironment variable set.