non-deterministic state machine specification to knead workflows
Project description
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
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 flowr-0.2.20260427.tar.gz.
File metadata
- Download URL: flowr-0.2.20260427.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b428b2e71251a19f093ad1636e64244af5393d28d39bac08c3527502732294aa
|
|
| MD5 |
b73bd3b6f10d9064a7b67a014aa3e70d
|
|
| BLAKE2b-256 |
88606ee04c6eaceeed5039c2908cc789f85e0cdf5760d00eed9971a7c0150f50
|
Provenance
The following attestation bundles were made for flowr-0.2.20260427.tar.gz:
Publisher:
pypi-publish.yml on nullhack/flowr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flowr-0.2.20260427.tar.gz -
Subject digest:
b428b2e71251a19f093ad1636e64244af5393d28d39bac08c3527502732294aa - Sigstore transparency entry: 1392625294
- Sigstore integration time:
-
Permalink:
nullhack/flowr@ed6b935c137d6d74bd0e75baf7b12536d39ffc58 -
Branch / Tag:
refs/tags/v0.2.20260427 - Owner: https://github.com/nullhack
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@ed6b935c137d6d74bd0e75baf7b12536d39ffc58 -
Trigger Event:
push
-
Statement type:
File details
Details for the file flowr-0.2.20260427-py3-none-any.whl.
File metadata
- Download URL: flowr-0.2.20260427-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ff9c34cb76791d2af543a58490c7be022aaa7f95ff9850ff0560bbadb9a98f8
|
|
| MD5 |
447367691ee3fe6dc2f1023c4b0bc0c5
|
|
| BLAKE2b-256 |
7a7d444be3d023acd665787efd24607a466c472149f6876836efbe60f41e857d
|
Provenance
The following attestation bundles were made for flowr-0.2.20260427-py3-none-any.whl:
Publisher:
pypi-publish.yml on nullhack/flowr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flowr-0.2.20260427-py3-none-any.whl -
Subject digest:
2ff9c34cb76791d2af543a58490c7be022aaa7f95ff9850ff0560bbadb9a98f8 - Sigstore transparency entry: 1392625299
- Sigstore integration time:
-
Permalink:
nullhack/flowr@ed6b935c137d6d74bd0e75baf7b12536d39ffc58 -
Branch / Tag:
refs/tags/v0.2.20260427 - Owner: https://github.com/nullhack
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@ed6b935c137d6d74bd0e75baf7b12536d39ffc58 -
Trigger Event:
push
-
Statement type: