Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

m8flow

An embeddable BPMN and DMN workflow engine for Python applications.
The workflow core of m8flow: import it, pass it a database session, and run processes inside your own application.

CI status Python 3.12 Apache 2.0 license

m8flow-core

m8flow-core is the workflow core of m8flow. It runs Business Process Model and Notation (BPMN) 2.0 processes and Decision Model and Notation (DMN) decision tables inside your own Python process, on top of SpiffWorkflow and SQLAlchemy. You import it, pass it a database session, and call commands and queries. There's no server to deploy.

It's a library, in the same spirit as an embedded Camunda engine: your application owns the HTTP layer, the users, and the transaction. The library owns the workflow state.

m8flow-core capabilities: define BPMN and DMN processes, run instances and human tasks, automate timers and service tasks, and govern tenants.

Features

The library covers the following:

  • Process definitions. Import BPMN XML and optional DMN XML, validated before anything is stored.
  • Process execution. Start instances from stored definitions and run them through exclusive and parallel gateways, script tasks, and DMN business rule tasks.
  • Human tasks. Build worklists of work items from BPMN lanes, then claim and complete them, safely under concurrency. Form values you submit are stored as process metadata.
  • Lifecycle control. Suspend, resume, error, retry, and terminate process instances, with an event history for each one.
  • Timers and scheduled retries. Timer start events, intermediate timers, interrupting boundary timers, and delayed retries, stored as database jobs that your application polls.
  • Service tasks. Run BPMN service tasks through pluggable connectors, including an adapter for the m8flow connector proxy.
  • Multi-tenancy and authorization. Every call is scoped to a tenant, and stored data, down to workflow payloads, belongs to one tenant. User actions are checked against tenant membership and command grants on exact resources, and you can plug in your own policy.
  • Caller-owned transactions. Pass a SQLAlchemy Connection and the library never commits or rolls back for you.

Quick start

You need Python 3.12 and uv. To install the project and run a complete purchase-order workflow on an in-memory SQLite database, run the following commands:

git clone https://github.com/AOT-Technologies/m8flow-core.git
cd m8flow-core
uv sync
uv run python examples/parallel_review.py

The script imports a BPMN definition, starts a process instance, and drives it through a parallel review to completion, printing the pending tasks after each step.

The core of an integration looks like the following:

from m8flow_core import api

with engine.begin() as connection:
    definition = api.execute_command(
        connection,
        api.ImportBpmnProcessDefinitionCommand(
            tenant_id="acme",
            bpmn_identifier="expense-approval",
            user_id=admin_id,
            source_bpmn_xml=bpmn_xml,
            properties_json={"lane_owners": {"Approvers": ["approver"]}},
        ),
    )
    instance = api.execute_command(
        connection,
        api.InitializeProcessInstanceFromDefinitionCommand(
            tenant_id="acme",
            bpmn_process_definition_id=definition.id,
            process_initiator_id=admin_id,
        ),
    )
    tasks = api.execute_query(
        connection,
        api.GetPendingTasksQuery(tenant_id="acme", user_id=approver_id),
    )

The quick start tutorial builds this into a complete script, from an empty database to a finished process. Running the finished script looks like this:

Terminal running the quick start script: the process starts, waits on Approve expense, and finishes as complete.

Documentation

The full documentation is in docs/. The pages follow the Diátaxis structure. Find your task in the following table:

I want to… Read
Run my first workflow Quick start
Add the library to my application Embed the library in your application · Build and install the package
Run timers and scheduled retries Run timers and scheduled retries
Call an external system from a process Call external services from service tasks
Add my own authorization rules Customize authorization
Upgrade from m8flow-bpmn-core 0.x Upgrade to 1.0
Look up a command, query, or error Public API reference · Database schema
Check which BPMN elements work BPMN support · Limitations
Understand how it fits together Architecture · Workflow data model
Try the runnable examples Run the examples · Sample app
Change the library itself Develop and test

Project status

m8flow-core 1.0 is the first stable release. The public surface is the m8flow_core.api module, documented in the API reference, together with the database schema. The changelog records every change to either. Coming from m8flow-bpmn-core 0.x? Follow Upgrade to 1.0. Messaging and correlation, call activities, multi-instance activities, and tenant and user management aren't covered yet. Limitations lists every known gap.

Get help and contribute

Use the following resources:

License

m8flow-core is released under the Apache License 2.0. See NOTICE for third-party attributions, including the LGPL-3.0 dependencies SpiffWorkflow and psycopg.

Metadata

Release files for m8flow-core 1.0.0b3

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

Source distribution (sdist)

Source distribution for m8flow-core 1.0.0b3
File Size Uploaded Provenance Actions
m8flow_core-1.0.0b3.tar.gz 357.5 kB With provenance Details for m8flow_core-1.0.0b3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for m8flow-core 1.0.0b3
File Interpreter ABI Platform Actions
m8flow_core-1.0.0b3-py3-none-any.whl Python 3 none any Details for m8flow_core-1.0.0b3-py3-none-any.whl

Total release size: 448.9 kB

Release files / m8flow_core-1.0.0b3.tar.gz

Download URL m8flow_core-1.0.0b3.tar.gz
Size 357.5 kB
Tags Source
SHA-256 checksum
How to use checksums
717a88169f1df911d3f81c7994fc177ab547b5d5548707993fcdf2bccd6af1f9
BLAKE2b-256 checksum
How to use checksums
13830607b5eae2bc1d05c13e8cb83d4bdfedb4f31acd32368254390140fe178a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Release files / m8flow_core-1.0.0b3-py3-none-any.whl

Download URL m8flow_core-1.0.0b3-py3-none-any.whl
Size 91.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a770c73d6a11c2488284994cd2e7c4f3b01e889de8d3125d20caaa5e7ea3841
BLAKE2b-256 checksum
How to use checksums
fded6bdbb4b9b03dd6da4ce8366a55148de953d1ca971354d816133567033cb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Security for m8flow-core 1.0.0b3

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for m8flow_core-1.0.0b3.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 Nov 5, 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