iwf-sdk
Python SDK for iWF workflow engine
pip install iwf-sdk==0.0.1
See samples for use case examples.
Requirements
- Python 3.9+
- iWF server
Concepts
To implement a workflow, the two most core interfaces are
-
Workflow interface defines the workflow definition
-
WorkflowState interface defines the workflow states for workflow definitions
A workflow can contain any number of WorkflowStates.
See more in https://github.com/superdurable/iwf#what-is-iwf
Development Plan
1.0 -- the basic and most frequently needed features
- Start workflow API
- Executing
wait_until/executeAPIs and completing workflow - Parallel execution of multiple states
- GetWorkflowResultsWithWait API
- StateOption: WaitUntil(optional)/Execute API timeout and retry policy
- Get workflow with wait API
- Timer command
- AnyCommandCompleted and AllCommandCompleted waitingType
- InternalChannel command
- DataAttribute
- Stop workflow API
- Improve workflow uncompleted error return(canceled, failed, timeout, terminated)
- Support execute API failure policy
- Support workflow RPC
- Signal command
- Reset workflow API
- Skip timer API for testing/operation
Running iwf-server locally
Option 1: use docker compose
See iwf README
Option 2: VSCode Dev Container
Dev Container is an easy way to get iwf-server running locally. Follow these steps to launch a dev container:
- Install Docker, VSCode, and VSCode Dev Container plugin.
- Open the project in VSCode.
cd iwf-python-sdk code .
- Launch the Remote-Containers: Reopen in Container command from Command Palette (Ctrl + Shift + P). You can also click in the bottom left corner to access the remote container menu.
- Once the dev container starts, iwf-server will be listening on port 8801.
How To Contribute
This project uses Poetry as a dependency manager. Check out Poetry's documentation on how to install it on your system before proceeding.
❗Note: If you use Conda or Pyenv as your environment / package manager, avoid dependency conflicts by doing the following first:
- Before installing Poetry, create and activate a new Conda env (e.g. conda create -n langchain python=3.9)
- Install Poetry (see above)
- Tell Poetry to use the virtualenv python environment (poetry config virtualenvs.prefer-active-python true)
- Continue with the following steps.
To install requirements:
poetry install
Update IDL
Edit OpenAPI specs in monorepo protos/ (iwf-sdk.yaml). No git submodule is used in this monorepo.
Generate API client from IDL
This project uses openapi-python-client to generate an API client from the IDL. To update the generated client:
poetry run openapi-python-client generate --path ../protos/iwf-sdk.yaml --config iwf/.openapi-python-client-config.yaml
cp -R iwf_api/iwf_api/* iwf/iwf_api && rm -R iwf_api/ && poetry update
The last command will:
- Fix the api package path
- Update the local path dependency.
Linting
To run linting for this project:
poetry run pre-commit run --show-diff-on-failure --color=always --all-files
Code of Conduct
This project is governed by the Contributor Covenant v 1.4.1. (Review the Code of Conduct and remove this sentence before publishing your project.)
Publishing to PyPI
- Bump
versioninpyproject.toml(and thepip installline above). - Create a GitHub Release with tag
sdk-python-vX.Y.Z(for examplesdk-python-v0.0.1), or run the Publish Python SDK to PyPI workflow manually. - CI runs
poetry publish --buildusing thePYPI_TOKENrepository secret.
See CONTRIBUTING.md for monorepo tag conventions.
License
This project uses the Apache 2.0 license. (Update this and the LICENSE file if your project uses a different license.)
Metadata
Release files for iwf-sdk 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iwf_sdk-0.0.1.tar.gz | 84.6 kB | Without provenance | Details for iwf_sdk-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iwf_sdk-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for iwf_sdk-0.0.1-py3-none-any.whl |
Total release size: 277.3 kB
Release files / iwf_sdk-0.0.1.tar.gz
| Download URL | iwf_sdk-0.0.1.tar.gz |
|---|---|
| Size | 84.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad0e5b3a29b8e25022428766561c33deaccd60f11d720c717c62dbcef3cafec4
|
|
BLAKE2b-256 checksum How to use checksums |
19711080b15ed0b25b2d9e26e5e736b0c1bb1b289fd33f7dae2fa4cc5d096384
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1020-azure
|
Release files / iwf_sdk-0.0.1-py3-none-any.whl
| Download URL | iwf_sdk-0.0.1-py3-none-any.whl |
|---|---|
| Size | 192.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d40206af8edcc4c7ea959f3f540cbbf5ae3354b248e648a09172dd6644f1c08
|
|
BLAKE2b-256 checksum How to use checksums |
b7cf371d8bdb07a8138e52af77b3ebb4051e68ac2d6d002b7f5cc6986470a83b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1020-azure
|
Security for iwf-sdk 0.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.