Run Metaflow flows as Windmill workflows
Project description
metaflow-windmill
Windmill scheduling and orchestration for Metaflow.
Windmill is an open-source workflow orchestrator that runs Python scripts as DAGs. This extension lets you deploy and trigger Metaflow flows as Windmill workflows.
Installation
pip install metaflow-windmill
Quick Start
Start Windmill locally:
docker compose up -d # use the docker-compose.yml from this repo's devtools/
Get your API token from the Windmill UI at http://localhost:8000.
Deploy and run your flow:
# Compile and deploy
python flow.py windmill create \
--windmill-host http://localhost:8000 \
--windmill-token <token> \
--windmill-workspace admins
# Trigger a run
python flow.py windmill trigger \
--windmill-host http://localhost:8000 \
--windmill-token <token> \
--windmill-workspace admins
# Or compile, deploy, and trigger in one step
python flow.py windmill run \
--windmill-host http://localhost:8000 \
--windmill-token <token>
Programmatic API
from metaflow import Deployer
with Deployer("flow.py") as d:
df = d.windmill().create(
windmill_host="http://localhost:8000",
windmill_token="my-token",
windmill_workspace="admins",
)
triggered = df.trigger()
print(triggered.run.successful)
Configuration
| CLI Option | Env Var | Default | Description |
|---|---|---|---|
--windmill-host |
WINDMILL_HOST |
http://localhost:8000 |
Windmill server URL |
--windmill-token |
WINDMILL_TOKEN |
— | API token |
--windmill-workspace |
WINDMILL_WORKSPACE |
admins |
Workspace name |
--max-workers |
— | 10 |
Max parallel ForEach workers |
--branch |
— | — | @project branch name |
--production |
— | false |
Deploy to production branch |
Supported Graph Patterns
- Linear flows (sequential steps)
- Branch/join (parallel branches)
- ForEach (single level of fan-out)
Not supported:
- Nested foreach (foreach inside foreach)
- Conditional splits (
@condition) @batch(Windmill runs steps as local processes)
How It Works
Each Metaflow step becomes a Windmill flow module that runs a bash script. The bash
script invokes python flow.py step <step_name> with the correct --run-id,
--task-id, and --retry-count arguments.
The retry count is derived from Windmill's native WM_FLOW_RETRY_COUNT environment
variable so that Metaflow's @retry decorator works correctly.
Implementation Contract
This extension satisfies all required capabilities:
- Cap.RUN_PARAMS:
run_paramsis always a list, not a tuple. - Cap.PROJECT_BRANCH:
--branchis forwarded to every step subprocess. - Cap.CONFIG_EXPR:
METAFLOW_FLOW_CONFIG_VALUEis injected into every step. - Cap.RETRY: retry count is derived from
WM_FLOW_RETRY_COUNT. - Cap.FROM_DEPLOYMENT: handles dotted identifiers (project.branch.FlowName).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaflow_windmill-0.1.0.tar.gz.
File metadata
- Download URL: metaflow_windmill-0.1.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dbbdac7c9f03404e13b1f7a78edcf233a6925d10cb44ff3c6903209e1787e52
|
|
| MD5 |
0c8a45a785c17d9d1e4f414baea1b058
|
|
| BLAKE2b-256 |
7249ba6e0886eb50b4ce80ade5c4691cdfc9eb94fb9ff6c0f97cf42a362dec6b
|
Provenance
The following attestation bundles were made for metaflow_windmill-0.1.0.tar.gz:
Publisher:
publish.yml on npow/metaflow-windmill
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaflow_windmill-0.1.0.tar.gz -
Subject digest:
6dbbdac7c9f03404e13b1f7a78edcf233a6925d10cb44ff3c6903209e1787e52 - Sigstore transparency entry: 1062803902
- Sigstore integration time:
-
Permalink:
npow/metaflow-windmill@a714dd8451b097ede65d4d1d970192987cdb6b00 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/npow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a714dd8451b097ede65d4d1d970192987cdb6b00 -
Trigger Event:
push
-
Statement type:
File details
Details for the file metaflow_windmill-0.1.0-py3-none-any.whl.
File metadata
- Download URL: metaflow_windmill-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0888a00d35ac94f325db64c6583ad21da601464f06b9d579d34c12f6a952a0f1
|
|
| MD5 |
423bf837f0e9a8c51538eba75e6d62d0
|
|
| BLAKE2b-256 |
c4ba1bdc110852c3bca2dbad172cc3cb1d6e797717e7a823ff0ec5428dd6d450
|
Provenance
The following attestation bundles were made for metaflow_windmill-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on npow/metaflow-windmill
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaflow_windmill-0.1.0-py3-none-any.whl -
Subject digest:
0888a00d35ac94f325db64c6583ad21da601464f06b9d579d34c12f6a952a0f1 - Sigstore transparency entry: 1062803963
- Sigstore integration time:
-
Permalink:
npow/metaflow-windmill@a714dd8451b097ede65d4d1d970192987cdb6b00 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/npow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a714dd8451b097ede65d4d1d970192987cdb6b00 -
Trigger Event:
push
-
Statement type: