# LiteFlow: A Java Rule Engine for Component Orchestration with AI Agent Support

> LiteFlow is a Java orchestration and rule engine framework that drives complex business logic through DSL expressions in XML, JSON, or YAML, with hot reload, multi-language scripting, and since version 2.16.0, first-class AI agent nodes. It fits teams that need to decouple and rearrange business flows without redeploying their application.

**dromara/liteflow** — 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.

- Repository: https://github.com/dromara/liteflow
- Stars: 3,871 · Forks: 526
- Language: Java
- License: Apache-2.0
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/dromara-liteflow

## What LiteFlow Solves and Who It Is For

LiteFlow addresses a specific architecture problem: business logic that has grown into a large, tightly coupled block of code that is hard to modify, test in isolation, or hand to non-developers for configuration. The framework turns each piece of logic into a component and uses a DSL to express how those components connect, so changing the flow means editing a rule file rather than modifying Java code.

The README describes the target scenario as complex systems with bloated code. The primary users are Java backend teams working on Spring Boot or Spring applications, though the framework also supports other Java frameworks. It is useful in scenarios where business logic changes frequently, where parts of the flow can run in parallel, and where the operations team needs to adjust rules between deployments.

LiteFlow was officially open-sourced in 2020 and has been iterating since. The README states the framework has more than 2000 test cases, which provides some confidence in the core orchestration engine's stability. The last push to the repository was on 2026-07-31.

## The DSL: Sync, Async, Conditionals, and Nested Rules

LiteFlow uses an expression language to describe flows. The README shows the core operators through the AI agent orchestration examples, which use the same operators as ordinary business components.

Sequential execution uses THEN:

```
THEN(prepare, deepseekAgent, recordReply);
```

Parallel execution uses WHEN:

```
WHEN(deepseekAgent, qwenAgent);
```

Conditional branching uses IF:

```
IF(isMath, mathAgent, deepseekAgent);
```

These can be composed. A multi-agent example from the README combines parallel analysis with aggregated output:

```
THEN(prepare, WHEN(analyzerAgent, riskAgent), summaryAgent, notify);
```

SWITCH and FOR are also available for routing and iteration. The README notes that these operators are not new for AI: they are the same ones LiteFlow has used for years. The DSL can be stored in XML, JSON, or YAML files, and the framework supports loading rules from structured databases, Nacos, Etcd, Zookeeper, Apollo, and Redis, as well as from custom sources through an extension interface.

## Hot Reload, Scripting Languages, and Spring Boot Integration

One of LiteFlow's stated design priorities is rule changes without a restart. The README describes the hot-reload mechanism as changing application rules instantly when rule files change, with high concurrency not causing execution errors during the refresh. This means a team can push a rule change to a configuration store and see it take effect in the running process.

For scripting, the framework supports defining nodes as Groovy, Java, Kotlin, JavaScript, QLExpress, Python, Lua, or Aviator scripts. The README notes that all scripting languages can call Java methods, reference any Spring bean, and make RPC calls from within scripts. This is significant: it means a Python or Groovy script in a rule node can call into the full Java application context.

Spring Boot integration covers versions 2.X, 3.X, and 4.X. JDK support runs from JDK 8 through JDK 25. Virtual threads, introduced in JDK 21, are supported for the async execution operators on compatible runtimes.

The repository is organized into a multi-module Maven project. Relevant modules include `liteflow-core/`, `liteflow-script-plugin/` for the scripting integrations, `liteflow-rule-db/` and `liteflow-rule-plugin/` for storage adapters, `liteflow-spring-boot-starter/` and `liteflow-spring-boot4-starter/` for the Spring Boot integrations, and `liteflow-agent/` for the AI agent module.

## AI Agent Orchestration in v2.16.0

Version 2.16.0 added the `liteflow-agent` module, which wraps an AI agent into a standard LiteFlow component. The README describes this as treating a reasoning-and-acting agent as an ordinary node, so it participates in THEN, WHEN, IF, SWITCH, and FOR expressions the same way any Java component does.

The module connects to OpenAI, Claude, Gemini, DeepSeek, Qwen (DashScope), Kimi, GLM, and other LLM platforms. It provides namespaced AgentScope state, typed event observation, structured output, human-in-the-loop (HITL) support, and skill definitions. Switching between models is described as a one-line change to the `model()` configuration.

The README frames this feature as enabling two concrete patterns: running multiple LLMs in parallel on the same input to compare results, and building multi-stage pipelines where AI nodes sit alongside standard business components. An AI node that analyzes risk runs in parallel with an AI node that analyzes sentiment, and their outputs feed into a summary agent, which then calls a Java notification component. This is the same composability as the non-AI flow, with LLM inference as one node type among several.

## LiteFlow vs Drools: Two Different Rule Engine Approaches

Drools is the most commonly cited alternative to LiteFlow in the Java rule engine space. The two tools solve related but distinct problems.

Drools is built around the Rete algorithm and a pattern-matching model: you define rules as conditions on facts, and the engine fires the rules whose conditions are true. This model is well suited to large sets of independent business rules that need to evaluate simultaneously against a shared fact base, such as insurance underwriting or credit risk calculations.

LiteFlow is an orchestration engine. Its DSL describes the order and control flow of components, not a set of conditions that fire on data patterns. It is well suited to workflows where the question is which steps run and in what order, not which rules are triggered by which facts.

Teams choosing between them should ask whether their problem is a flow problem or a rule-matching problem. If the business logic is a sequence of steps with conditional branches and parallel sections, LiteFlow's DSL is more direct. If the business logic is a large set of rules that all evaluate against incoming data, Drools's Rete model fits better. The two can also be used together: a LiteFlow flow can call a Drools rule session as one component in its chain.

## Limitations and Monitoring

LiteFlow has no GitHub releases. Version history and release notes would need to be found through the project's official documentation site at `liteflow.cc`. The README references documentation for installation and configuration at `liteflow.cc/pages/5816c5/`, but the repository itself does not include a getting-started guide.

The framework ships a built-in command-line monitoring tool that shows component execution times ranked by duration. This is a simple diagnostic aid: the README describes it as showing each component's running time ranking, not a full observability integration. Teams that need integration with external metrics systems such as Prometheus would need to implement that through LiteFlow's extension points.

The repository is licensed under Apache-2.0, which permits commercial use and modification without requiring source publication. The Apache-2.0 license does require attribution and preservation of the original license and notice.

The `liteflow-benchmark/` module in the repository layout suggests performance benchmarks exist, but the README does not publish specific numbers.

## Conclusion

LiteFlow is a good fit for Java teams with complex, frequently changing business logic that currently lives in deeply nested conditional code. The hot-reload mechanism and multi-language scripting give operations teams the ability to adjust rules without a redeployment cycle. Teams that already use Drools and have invested in its Rete-algorithm rule model should evaluate whether LiteFlow's orchestration-first approach matches their use case: LiteFlow is strongest when the problem is flow and sequencing, not when it is a large set of independent business rules that fire on fact patterns. Check JDK compatibility before adopting: JDK 8 through JDK 25 are supported, with virtual thread support on JDK 21 and above.

## FAQ

### LiteFlow vs Drools: which should I choose?

LiteFlow is an orchestration engine where you describe the order and flow of components using a DSL. Drools is a pattern-matching engine built on the Rete algorithm that fires rules when conditions match a fact base. Use LiteFlow when your problem is a workflow with conditional branches and parallel steps; consider Drools when you have a large set of independent rules that need to evaluate simultaneously against shared data.

### Does LiteFlow support hot reload of rules in production?

Yes. The README describes the hot-reload mechanism as allowing rule changes to take effect instantly without restarting the application, and states that the reload does not cause errors in concurrent rule executions during the refresh.

### Which scripting languages can I use for LiteFlow script nodes?

The README lists Groovy, Java, Kotlin, JavaScript, QLExpress, Python, Lua, and Aviator. All of these can call Java methods and reference Spring beans from within the script.

## Sources

- [dromara/liteflow on GitHub](https://github.com/dromara/liteflow)
- [Issues](https://github.com/dromara/liteflow/issues)
- [License: Apache-2.0](https://github.com/dromara/liteflow/blob/master/LICENSE)
- [README](https://github.com/dromara/liteflow/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/dromara-liteflow
