Skip to main content
flowr — non-deterministic state machine specification to knead workflows

flowr

⚠️ Beta — do not install. This project is under active development with breaking changes in progress. The API, package structure, and configuration may change without notice until the first stable release.

Non-deterministic state machine specification to knead workflows.

flowr is a Python library and CLI for defining, validating, and visualising workflow state machines in YAML. Define your flows in a declarative format, validate them against the specification, query states and transitions, and export Mermaid diagrams — all from the terminal or programmatically.

Install

pip install flowr

Requires Python 3.13+.

Quick Start

Create a flow definition YAML file:

flow: deploy
version: 1.0.0
exits: [deployed, failed]

states:
  - id: prepare
    next:
      ready: execute

  - id: execute
    next:
      success: deployed
      error: failed

  - id: review
    next:
      approve:
        to: deployed
        when: { score: ">=80" }
      reject: failed

Validate it:

$ flowr validate deploy.yaml
valid: True

Query states and transitions:

$ flowr states deploy.yaml
prepare
execute
review

$ flowr next deploy.yaml review
state: review
next: approve (guarded)
next: reject

$ flowr transition deploy.yaml review approve --evidence score=85
from: review
trigger: approve
to: deployed

Export as Mermaid:

$ flowr mermaid deploy.yaml
stateDiagram-v2
    state "prepare" as prepare
    state "execute" as execute
    state "review" as review
    ...

CLI Reference

Command Description
flowr validate <file> Validate a flow definition
flowr states <file> List all state ids
flowr check <file> <state> [<target>] Show state details or transition conditions
flowr next <file> <state> [--evidence K=V] Show valid next transitions
flowr transition <file> <state> <trigger> [--evidence K=V] Compute next state
flowr mermaid <file> Export as Mermaid state diagram

All commands accept --json for machine-readable output.

Evidence can be passed with --evidence key=value (repeatable) or --evidence-json '{"key": "value"}'.

Documentation

Development

# Install with dev dependencies
uv sync --all-extras

# Run tests
uv run task test

# Fast tests (skip slow)
uv run task test-fast

# Full test suite with coverage
uv run task test-build

# Lint and format
uv run task lint

# Type checking
uv run task static-check

License

MIT

Metadata

Release files for flowr 0.3.20260427

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flowr 0.3.20260427
File Size Uploaded Provenance Actions
flowr-0.3.20260427.tar.gz 13.6 kB With provenance Details for flowr-0.3.20260427.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flowr 0.3.20260427
File Interpreter ABI Platform Actions
flowr-0.3.20260427-py3-none-any.whl Python 3 none any Details for flowr-0.3.20260427-py3-none-any.whl

Total release size: 27.4 kB

Release files / flowr-0.3.20260427.tar.gz

Download URL flowr-0.3.20260427.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5f98acfa1ff9494a2a6af6a84f7863c0b1285eb35d6471f4fc5aba2537ccdf39
BLAKE2b-256 checksum
How to use checksums
38e16e1050ef5b7eaeb390d7c1500c6930b91e5a389ef5be357e0f56002f8ca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Release files / flowr-0.3.20260427-py3-none-any.whl

Download URL flowr-0.3.20260427-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a88bbf230e3492fc314108cb967dbd490313e8f4805150e83c017914378410e2
BLAKE2b-256 checksum
How to use checksums
f46e1912d7364694209829838a62d44d4ab02517ef11d8e1db39e41b37938dd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Security for flowr 0.3.20260427

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flowr-0.3.20260427.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page