Skip to main content

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_params is always a list, not a tuple.
  • Cap.PROJECT_BRANCH: --branch is forwarded to every step subprocess.
  • Cap.CONFIG_EXPR: METAFLOW_FLOW_CONFIG_VALUE is 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metaflow_windmill-0.1.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

metaflow_windmill-0.1.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

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

Hashes for metaflow_windmill-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6dbbdac7c9f03404e13b1f7a78edcf233a6925d10cb44ff3c6903209e1787e52
MD5 0c8a45a785c17d9d1e4f414baea1b058
BLAKE2b-256 7249ba6e0886eb50b4ce80ade5c4691cdfc9eb94fb9ff6c0f97cf42a362dec6b

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on npow/metaflow-windmill

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

File details

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

File metadata

File hashes

Hashes for metaflow_windmill-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0888a00d35ac94f325db64c6583ad21da601464f06b9d579d34c12f6a952a0f1
MD5 423bf837f0e9a8c51538eba75e6d62d0
BLAKE2b-256 c4ba1bdc110852c3bca2dbad172cc3cb1d6e797717e7a823ff0ec5428dd6d450

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on npow/metaflow-windmill

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