JDEasyFlow: An Open‑Source Enterprise Workflow Orchestration Engine – Features, Architecture, and Usage
JDEasyFlow is an open‑source Java workflow orchestration component from JD's enterprise finance R&D team that supports JSON and BPMN specifications, offers flexible node types, modular architecture, and provides detailed usage examples and implementation principles for building scalable process‑driven applications.
JDEasyFlow is a self‑developed, open‑source workflow orchestration component created by JD's Enterprise Finance R&D department, suitable for service orchestration, workflow, and approval scenarios. The project is hosted at GitHub and is already used in internal business systems and other departments.
The engine is designed to be simple, flexible, and extensible: developers can get started in about 30 minutes and master the core concepts within half a day. It consists of a core module and several loosely‑coupled extension modules, allowing selective integration and progressive adoption. Both JSON‑based and BPMN‑based specifications are supported.
Supported Scenarios and Node Types
Node flow types: sequential, conditional, loop, parallel, and mixed execution.
Node function types: script nodes (execute code), user nodes (triggered by user actions), and message nodes (triggered by incoming messages).
Interaction patterns: single‑run multi‑node, multi‑run single‑node, and multi‑run multi‑node.
Sub‑process support for decomposing complex flows.
Approval processes with features such as revoke, reject, countersign, and add‑sign, plus a simple dynamic form.
Functional Architecture
The engine’s architecture is modular: the core flow engine provides JSON‑based execution, the BPMN module adds visual design and BPMN‑to‑JDEasyFlow conversion, and additional modules handle flow definition/version management, instance persistence, and task/approval services. All modules are independent JARs without database dependencies, except the persistence‑related modules.
System Architecture
Three deployment tiers are defined – business‑application client, flow service, and flow management console – which can be deployed as a monolith or distributed services. Required middleware includes a relational database (e.g., MySQL), a cache (e.g., Redis), and a service‑communication framework (Java API, HTTP, or JSF).
Performance and Scalability
Pure orchestration runs entirely in memory/CPU on the client side, achieving >10,000 node executions per second on a typical laptop.
When persistence or approval is needed, performance depends on database read/write efficiency.
The engine is stateless and can scale linearly with additional instances; the database can be sharded for large data volumes.
Implementation Principle
Unlike traditional graph‑based engines, JDEasyFlow adopts a computer‑instruction execution model, using a program‑counter‑like stack to manage pending nodes, making the engine Turing‑complete while keeping the model simple (only the concept of a Node).
Each node consists of a pre‑handler (eligibility check), a NodeAction (business logic), and a post‑handler (next‑node calculation). The execution flow initializes the context, pushes the start node onto the stack, and iteratively processes nodes until the stack is empty.
Usage Example – Maven Dependency
com.jd.easyflow
easyflow-flow
{replace-with-latest-version}JSON Flow Definition Example
{
"id": "quickstart_001",
"name": "Quick Start 001",
"nodes": [
{"id":"node001","name":"Node001","action":{"createExp":"new com.jd.easyflow.flow.quickstart.QuickStart001Node01Action()"},"start":true,"post":{"to":"node002"}},
{"id":"node002","name":"Node002","action":{"createExp":"new com.jd.easyflow.flow.quickstart.QuickStart002Node01Action()"},"post":{"to":"node003"}},
{"id":"node003","name":"Node003","action":{"createExp":"new com.jd.easyflow.flow.quickstart.QuickStart003Node01Action()"}}
]
}Java Initialization and Execution
FlowEngineImpl flowEngine = new FlowEngineImpl();
flowEngine.setFlowPath("classpath:flow/quickstart/quickstart_001.json");
flowEngine.init();
FlowParam param = new FlowParam("quickstart_001");
FlowResult result = flowEngine.execute(param);These snippets demonstrate how to integrate the engine in a Spring environment or plain Java application. Comprehensive documentation and additional modules are available on the project's GitHub wiki.
JD Tech Talk
Official JD Tech public account delivering best practices and technology innovation.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.