Skip to content

About

🎨 core business process engine of Alibaba Halo platform, best process engine for trade scenes. | 一个高性能流程编排引擎

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2.0k stars

Watchers

43 watching

Forks

Latest commit

 

History

228 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
CompileFlow

CompileFlow

A high-performance process engine for Java

CompileFlow Workbench Server CI Java Core CI Workbench CI OpenSSF Scorecard Java License

GitHub Stars GitHub Forks

中文 README

CompileFlow is a lightweight, high-performance, embeddable, and extensible process engine for Java. It supports TBBPM and the documented subset of BPMN 2.0.

The CompileFlow Process engine focuses on in-memory, stateless execution. It is used by core systems across Alibaba business platforms, including Taobao, Alibaba Cloud, and international businesses.

CompileFlow Durable is an embeddable durable execution engine for cross-system workflows, resumable background jobs, and long-running AI agents.

Key capabilities

  • ⚡ High-performance execution — Choose compiled or interpreted execution; compiled mode generates and reuses Java runtimes.
  • 🧩 TBBPM and BPMN — Use one engine API and runtime model for TBBPM and the documented subset of BPMN 2.0.
  • ✅ Java and Spring Boot integration — Embed a thread-safe engine directly or through Spring Boot, with declared variables, preflight validation, typed results, and stable errors.
  • 🚦 Versioned deployment — Publish immutable versions, update aliases with revision checks, and route deterministic canary traffic with CompileFlow Deploy.
  • ⏱️ Durable execution — Persist waits, timers, and external-operation state, then resume execution after an application restart.
  • 🖥️ Visual Workbench — Model and validate processes in the browser, then publish, monitor, and inspect execution through the Workbench Server.

Choose a product surface

Need Use
In-process, low-latency execution ProcessEngine with compileflow-tbbpm or compileflow-bpmn
Immutable versions, aliases, and canary rollout CompileFlow Deploy
Persisted waits, timers, external operations, and restart recovery CompileFlow Durable
Browser modeling, release management, and execution inspection CompileFlow Workbench

Core API

Type Purpose
ProcessEngine Thread-safe process execution entry point
ProcessRef Reference to an exact version or a published alias
ProcessDefinition Process definition supplied inline or from the classpath
ProcessResult<T> Typed result or failure with stable error information

Keep one long-lived ProcessEngine for each distinct configuration. A single engine discovers every installed frontend, while each definition carries its model type. Close the engine with the application lifecycle; do not create an engine per request.

Quick start

Use a full JDK 17, 21, or 25 that includes jdk.compiler. Generated bytecode targets Java 17.

Build and install the required modules from source:

./mvnw install -pl :compileflow-spring-boot-starter-tbbpm -am -DskipTests

Add the Spring Boot starter:

<dependency>
    <groupId>com.alibaba.compileflow</groupId>
    <artifactId>compileflow-spring-boot-starter-tbbpm</artifactId>
    <version>2.0.0-SNAPSHOT</version>
</dependency>

This snippet illustrates typed integration. Supply OrderRequest, OrderResult, and flows/order-process.bpm in the application; the process code, variable mappings, and Java types must agree with the definition. Inject the application-scoped engine and execute that definition:

import com.alibaba.compileflow.engine.ProcessDefinition;
import com.alibaba.compileflow.engine.ProcessEngine;
import com.alibaba.compileflow.engine.ProcessExecutionOptions;
import com.alibaba.compileflow.engine.ProcessModelType;
import org.springframework.stereotype.Service;

@Service
public class OrderService {

    private final ProcessEngine processEngine;

    public OrderService(ProcessEngine processEngine) {
        this.processEngine = processEngine;
    }

    public OrderResult execute(OrderRequest request) {
        ProcessDefinition definition = ProcessDefinition.classpath(
                ProcessModelType.TBBPM, "order.process",
                "flows/order-process.bpm");

        return processEngine.execute(
                        definition,
                        request,
                        OrderResult.class,
                        ProcessExecutionOptions.defaults())
                .orElseThrow();
    }
}

For a complete project, run examples/spring-boot-basic. Its flow uses QLExpress, so its POM declares the corresponding executor dependency. The quick-start guide also covers standalone composition, preflight, warm-up, and shutdown. For a fuller HTTP example with gateways, a process call, parallel work, iteration, retries, and controlled errors, run examples/spring-boot-order-fulfillment.

Execution model

flowchart LR
    definition["TBBPM or BPMN definition"]
    engine["ProcessEngine"]
    semantic["Validated process model"]
    compile["COMPILED: generate and compile Java"]
    interpret["INTERPRETED: prepare an interpreted program"]
    runtime["Process runtime"]
    result["ProcessResult"]

    definition --> engine --> semantic
    semantic --> compile --> runtime
    semantic --> interpret --> runtime
    runtime --> result
Loading

See Supported Surfaces for executable nodes, process formats, and public compatibility commitments.

Documentation

Goal English 中文
Start using the engine Quick Start 快速开始
Configure and size an application Configuration 配置指南
Use persisted execution Durable Process Durable Process
Understand the architecture Architecture 架构文档
Check supported surfaces Supported Surfaces 支持范围与兼容性
Operate a deployment Operations 运维手册
Contribute Contributing 贡献指南(英文)

The documentation center is the canonical index for task guides, specifications, architecture, and module documentation. Use Supported Surfaces for compatibility decisions.

Build and test

Run the embedded-engine integration suite:

./mvnw -B test -pl compileflow-integration-tests -am

Repository-specific verification commands are documented in the testing guide and CONTRIBUTING.md.

Adopters

Alibaba Group
Alibaba Group
Taobao
Taobao
Tmall
Tmall
Alipay
Alipay
Cainiao
Cainiao
Alibaba Cloud
Alibaba Cloud
AliExpress
AliExpress
Lazada
Lazada
Fliggy
Fliggy
…

Community

License

CompileFlow is available under the Apache License 2.0.

About

🎨 core business process engine of Alibaba Halo platform, best process engine for trade scenes. | 一个高性能流程编排引擎

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2.0k stars

Watchers

43 watching

Forks

Releases

Used by

Contributors

Languages