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
- flowr docs — hosted documentation
- Flow Definition Specification — authoritative YAML format reference (fields, conditions, subflows, validation rules)
- System Overview — architecture, domain model, module structure, and API
- Product Definition — product boundaries, users, and scope
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.2.20260427
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 |
|---|---|---|---|---|
| flowr-0.2.20260427.tar.gz | 7.2 kB | With provenance | Details for flowr-0.2.20260427.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flowr-0.2.20260427-py3-none-any.whl | Python 3 | none | any | Details for flowr-0.2.20260427-py3-none-any.whl |
Total release size: 14.4 kB
Release files / flowr-0.2.20260427.tar.gz
| Download URL | flowr-0.2.20260427.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b428b2e71251a19f093ad1636e64244af5393d28d39bac08c3527502732294aa
|
|
BLAKE2b-256 checksum How to use checksums |
88606ee04c6eaceeed5039c2908cc789f85e0cdf5760d00eed9971a7c0150f50
|
| 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 logRelease files / flowr-0.2.20260427-py3-none-any.whl
| Download URL | flowr-0.2.20260427-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ff9c34cb76791d2af543a58490c7be022aaa7f95ff9850ff0560bbadb9a98f8
|
|
BLAKE2b-256 checksum How to use checksums |
7a7d444be3d023acd665787efd24607a466c472149f6876836efbe60f41e857d
|
| 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 logSecurity for flowr 0.2.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.
Attestation for flowr-0.2.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 logA 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.