Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

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 m8flow-core 1.0.0 on PyPI 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, 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.0b4

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

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

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

Built distribution (wheel)

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

Total release size: 549.5 kB

Release files / m8flow_core-1.0.0b4.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL m8flow_core-1.0.0b4.tar.gz
Size 424.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a1fb9c751d3daccb5d2fc3debb56a6fa012d626f2b28d0941611625b7c259c20
BLAKE2b-256 checksum
How to use checksums
95016dc88bf258fe829550e5a7a9252d4dbc0dc5edcefdb59eda35efab0a7eb0
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 17, 2026.

Transparency log

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

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL m8flow_core-1.0.0b4-py3-none-any.whl
Size 124.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa6c77e12f134e541f0f28f00fb42dd1e5358735ce15562812aeccf05ea85f8e
BLAKE2b-256 checksum
How to use checksums
392528ee011ce6030c46851808fa6e23fb59e874b7b345425c01c11d7b74111f
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 17, 2026.

Transparency log

Security for m8flow-core 1.0.0b4

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.

Change of provenance

The repository and configuration that created this release differ from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 2 files

Attestation for m8flow_core-1.0.0b4.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 17, 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