gitmyhub

liteflow

Java ★ 3.8k updated 9d ago

Lightweight, fast, stable, programmable component-based rule engine — where AI Agents orchestrate just like ordinary components. Uniquely designed DSL: component reuse, sync/async & dynamic orchestration, multi-language scripting, nested rules, hot deployment and smooth refresh. If you can orchestrate LiteFlow, you can orchestrate AI.

LiteFlow is a Java framework that breaks complex business processes into small reusable components driven by rule files in XML, JSON, or YAML, with hot-reload and built-in support for scripting languages so rules update without a restart.

JavaSpring BootGroovyJavaScriptPythonLuaKotlinsetup: moderatecomplexity 3/5

LiteFlow is a Java framework for orchestrating complex business logic into reusable components and driving their execution through simple rule files. The core idea is that instead of writing a large tangled block of code to handle a multi-step business process, you break each step into a small component and then describe the order and conditions of execution in a separate rule file using a lightweight expression language. The framework reads that rule file and runs the components accordingly.

The rule files can be written in XML, JSON, or YAML, whichever your team prefers. The expression language supports mixing synchronous and asynchronous execution, conditional branching, and nested sub-flows, so processes that would otherwise require complex multi-threaded code can be described clearly in a few lines. If a business rule changes, you update the rule file and the running application picks it up immediately without a restart, which the project calls hot deployment.

Each component in the system is a plain Java class, and the framework supports declarative annotation to register a class as a component with minimal extra code. Components can be configured to retry automatically on failure, with per-component retry policies and exception filters. A built-in context isolation mechanism prevents components from interfering with each other's data in concurrent situations.

Script language support is a notable feature: nodes in a flow can contain logic written in Groovy, JavaScript, Python, Lua, Kotlin, or other languages rather than compiled Java, which allows non-engineers to modify behavior without a build cycle.

LiteFlow supports Spring Boot 2 and 3, plain Spring, and other Java frameworks. It requires JDK 8 or later. The project was open-sourced in 2020, has been adopted on core systems at several companies in China, and includes more than 2,000 test cases. Documentation and a Discord community are available on the official website at liteflow.cc.

Where it fits