
π A High-Performance, Compile-Then-Execute Process Engine
Transforming business processes into optimized Java code for ultimate performance
CompileFlow is a lightweight, high-performance, integrable, and extensible process engine.
Focused on pure in-memory, stateless execution, the CompileFlow Process Engine is one of Taobao's original TBBPM workflow engines. It achieves exceptional efficiency by converting process files into Java code, which is then compiled and executed. It currently powers several core systems at Alibaba, including the Business Mid-end Platform and Trading systems.
CompileFlow allows developers to visually design business logic, bridging the gap between business analysts and engineers and making business expression more intuitive and efficient.
- β‘ Ultra-High Performance - A compile-then-execute architecture delivers native Java performance.
- π Type-Safe - Strong typing with compile-time validation reduces runtime errors.
- π§ Production-Ready - Seamless Spring Boot integration, monitoring, and enterprise features.
- π Multi-Standard - Supports both BPMN 2.0 and the TBBPM specification.
- π¨ Visual Design - An IntelliJ IDEA plugin is available for visual process modeling.
Get CompileFlow up and running in under 2 minutes.
This is the easiest and most recommended way to use CompileFlow in most applications.
<dependency>
<groupId>com.alibaba.compileflow</groupId>
<artifactId>compileflow-spring-boot-starter</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
The ProcessEngine
is auto-configured as a singleton and can be injected directly.
@Service
public class BusinessService {
@Autowired
private ProcessEngine<TbbpmModel> processEngine;
public MyResponse executeProcess(MyRequest request) {
ProcessSource processSource = ProcessSource.fromCode("my.business.process");
ProcessResult<MyResponse> result = processEngine.execute(
processSource,
request,
MyResponse.class
);
return result.orElseThrow(() -> new RuntimeException(result.getErrorMessage()));
}
}
For non-Spring applications, the recommended approach is to implement a manual singleton.
<dependency>
<groupId>com.alibaba.compileflow</groupId>
<artifactId>compileflow-core</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<!-- Add compileflow-tbbpm or compileflow-bpmn based on your process specification -->
<dependency>
<groupId>com.alibaba.compileflow</groupId>
<artifactId>compileflow-tbbpm</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
// ProcessEngineHolder.java
public final class ProcessEngineHolder {
private static final ProcessEngine<TbbpmModel> INSTANCE = ProcessEngineFactory.createTbbpm();
private ProcessEngineHolder() {}
public static ProcessEngine<TbbpmModel> getInstance() {
return INSTANCE;
}
// Call this from your application's shutdown hook
public static void shutdown() {
if (INSTANCE != null) {
INSTANCE.close();
}
}
}
// YourApplication.java
public class YourApplication {
public static void main(String[] args) {
// At application startup, you can warm-up processes
ProcessEngineHolder.getInstance().admin().deploy(ProcessSource.fromCode("..."));
// In your business logic, get the singleton instance
ProcessEngine<TbbpmModel> engine = ProcessEngineHolder.getInstance();
engine.execute(...);
// Register a shutdown hook to ensure resources are released
Runtime.getRuntime().addShutdownHook(new Thread(ProcessEngineHolder::shutdown));
}
}
β οΈ Important: For long-running applications (like web services), you must use a singleton. Creating a new engine per request will cause severe performance problems. See the Resource Management guide for more details.
Document | Description |
---|---|
π Quick Start Guide | A complete, runnable example in 5 minutes |
Must Read! How to use the engine singleton correctly to avoid resource leaks | |
βοΈ Configuration Guide | All available YAML and programmatic configuration options |
API Reference | Detailed reference for all public APIs |
π₯ Hot Deployment | Zero-downtime process update strategies for production |
π Monitoring & Observability | Integrating with events, metrics, and Prometheus |
β¨ Advanced Features | Engine warm-up, custom ClassLoaders, and more |
π§ Extension Guide | Develop custom extensions via SPI |
π Node Support List | TBBPM & BPMN 2.0 supported node details |
π οΈ Contributing Guide | How to contribute code and documentation to the project |
- π¬ GitHub Discussions - Ask questions and share ideas
- π Issue Tracker - Report bugs and request features
- π§ Security Issues - Report security vulnerabilities
CompileFlow is licensed under the Apache License 2.0
β If CompileFlow helps you, please give us a star! β