跪拜 Guibai
← All articles
Backend

Jeeflow: A 98KB Workflow Engine That Runs the Same Process in Java, Go, Python, and Node

By mldong ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Most workflow engines force a heavy framework dependency and lock you into one language stack. Jeeflow shows an alternative path: a spec-first, polyglot engine where the process definition is the portable artifact and each language gets a native implementation, not a binding. Teams that run mixed stacks can share workflow logic without sharing a runtime.

Summary

Jeeflow began as the built-in workflow module inside the mldong Java framework, a lightweight alternative to heavyweight engines like Flowable. It was extracted into a standalone 98KB core with zero framework dependencies and six pluggable SPIs for storage, identity, JSON parsing, expression evaluation, ID generation, and transactions. The engine models process instances and tasks as a DDD rich domain model with an explicit state machine.

That independence solved coupling and upgrade pain, but left non-Java teams behind. The answer is a multi-language federation: four native implementations in Java, Go, Python, and Node.js, all governed by a single specification document and verified against ten shared process-definition JSONs. A unified Vue3 frontend connects to any backend.

Every change follows a strict spec-first, cross-verification discipline. The same expense-report process produces identical results across all four language demos, and no code is committed without passing positive, negative, and regression tests.

Takeaways
Jeeflow's Java core is 98KB with zero framework dependencies; the only dependency is slf4j-api, marked as provided.
Six SPIs (repository, user info, JSON, expressions, ID generation, transactions) let teams plug in any tech stack without engine changes.
The engine uses a DDD aggregate-root model: ProcessInstance owns all state transitions, and ProcessTask handles its own behavior.
Process definitions are stored as LogicFlow JSON and remain identical across all four language implementations.
Ten shared process-definition files serve as a cross-language conformance suite, producing identical results in Java, Go, Python, and Node.
A single Vue3 frontend works with all four backends because the REST contract (code=0, msg field, submitType enum, VO shapes) is aligned.
Every change must pass positive, negative, and regression tests across all languages before commit.
The engine supports full approval semantics: initiate, approve, reject, rollback, jump, countersign, carbon copy, and delegation.
Conclusions

Extracting a workflow engine from a framework and making the framework its first consumer, rather than its host, inverts the usual dependency direction and gives the engine an independent release cadence.

Four independent implementations aligned to a spec is a harder coordination problem than one engine with language bindings, but it avoids lowest-common-denominator API design and lets each implementation feel native.

A 98KB core with pluggable SPIs is a deliberate rejection of the "enterprise engine" model where the engine dictates the database schema, ORM, and deployment topology.

Using shared process-definition JSONs as a cross-language test suite turns the spec into an executable contract, not just a document.

Concepts & terms
SPI (Service Provider Interface)
A pluggability mechanism where the engine defines an interface contract and the host application supplies the implementation. Jeeflow uses six SPIs so teams can swap in their own storage, identity provider, JSON parser, expression evaluator, ID generator, and transaction manager without modifying the engine.
DDD Aggregate Root
In Domain-Driven Design, an aggregate root is the top-level entity that enforces consistency boundaries for a cluster of related objects. In Jeeflow, ProcessInstance is the aggregate root that owns all state-change commands; ProcessTask is a sub-entity that manages its own behavior but cannot be modified directly from outside the aggregate.
LogicFlow
A flowchart visualization and editing library that represents process diagrams as JSON (nodes and edges). Jeeflow uses LogicFlow JSON as its process-definition format, so what the designer draws is exactly what the engine executes.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗