Open-source project
dromara/liteflow avatar
dromara/liteflow

LiteFlow: A Component Rule Engine That Treats an AI Agent as Just Another Node

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.

3,855 stars525 forksJavaApache-2.0

At a glance

What is it?
LiteFlow is a Java orchestration and rule engine where every piece of logic, including a ReAct AI agent, is a component driven by a small DSL. It is a good fit for teams with bloated Java business flows who want the wiring outside the code, and a poor fit for anyone expecting a drop-in LLM framework.
Who is it for?
Adopt LiteFlow if your problem is a long Java business flow whose branching and parallelism have become unreadable, and you want that wiring in an XML, JSON or YML rule file that can be reloaded without a restart. Do not adopt it if you only need an LLM call wrapped in a Java client, or if you cannot host a rule file in one of the supported stores and keep it under review.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 47 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The Java flow that outgrew its service class

The problem LiteFlow targets is stated plainly in its README: a complex system with bloated code. In Java services this usually looks like a method that calls eight collaborators in sequence, fans out to three more in parallel, retries two of them on specific exceptions, and branches on a flag that arrived from a config table. The calls are correct. The shape of them is invisible unless you read the whole method. LiteFlow moves that shape into a rule expression such as THEN(prepare, deepseekAgent, recordReply) or WHEN(deepseekAgent, qwenAgent), and leaves each step as a component class. The audience is Java teams already running Spring Boot or plain Spring who want the orchestration readable as data rather than as control flow. The README also positions it for teams that want scripting language nodes (Groovy, Java, Kotlin, JavaScript, QLExpress, Python, Lua, Aviator) inside the same flow, which is a different motivation: letting non-Java logic participate without a compile cycle.

Components, rule expressions, and where the rules live

Every unit of logic is a component. The README calls this component definition unified: all logic is a component, with a single implementation contract. A rule file then composes those components with operators. The operators named in the material are THEN, WHEN, IF, SWITCH and FOR. THEN is sequential, WHEN is parallel, IF and SWITCH are conditional routing, and FOR is iteration. Nesting is supported, which is how the README's multi-agent example works: THEN(prepare, WHEN(analyzerAgent, riskAgent), summaryAgent, notify) runs two agents in parallel and then aggregates. Rules can be written in XML, JSON or YML. The framework natively supports loading them from a structured database, Nacos, Etcd, Zookeeper, Apollo or Redis, and exposes an extension interface for other stores. That last point matters more than it reads: the rule file is not necessarily a file. It can be a row, a config entry or a key in a coordination service, which is what makes the hot refresh story possible at all. The README describes a context isolation mechanism for concurrent executions and per-component retry with custom configuration and specified exceptions, but it does not describe how either is implemented.

The ReAct agent module added in v2.16.0

Starting with v2.16.0, LiteFlow ships a module called liteflow-react-agent. The README is explicit that this is not a simple LLM component. It wraps a full ReAct (Reasoning plus Acting) agent into a standard LiteFlow component, so one component is one agent. The developer declares a component and implements a small number of methods; conversation with LLM providers, multi-turn memory and the Skills system are handled by the module. The README states the module connects to mainstream LLM platforms and names OpenAI, but the supplied text is truncated mid-sentence at that point, so the full provider list cannot be confirmed from this material. The interesting design claim is that no new operators were invented for AI. THEN, WHEN, IF, SWITCH and FOR are the operators LiteFlow has used for years, and an agent is simply a node they can point at. The README's summary line is that if you can orchestrate LiteFlow, you can orchestrate AI. That is a real architectural decision, and it cuts both ways: an agent inherits retry, nesting and hot refresh, and it also inherits the constraint that its behaviour is expressed in the same DSL as your business logic.

Getting it running: what the material actually specifies

The README does not give an install command, a Maven coordinate or a Spring Boot starter name. It gives the official site (liteflow.cc) and a documentation URL, and it states the framework works with Spring Boot 2.X, 3.X and 4.X, with plain Spring, and with other Java frameworks, on JDK8 through JDK25, with virtual threads on JDK21 and above. For rule authoring, the concrete facts are the three formats (XML, JSON, YML) and the rule sources (structured database, Nacos, Etcd, Zookeeper, Apollo, Redis, plus an extension interface). A minimal setup therefore has three decisions rather than a command sequence: which rule format, which rule source, and which component contract your classes implement. The README also mentions declarative component support, which it says can turn any class into a component in seconds. Because no configuration keys, artifact IDs or CLI commands appear in the supplied material, treat any specific key you see elsewhere as something to verify against the documentation at liteflow.cc rather than against this review.

Hot refresh is the feature to test first

The README makes two strong claims about rule refresh. First, rule changes take effect instantly without restarting the application. Second, high concurrency does not cause errors in executing rules because of a refresh. The second claim is the one worth scrutiny. Refreshing a rule while requests are mid-flight is the hard part of any rule engine, and the README does not describe the mechanism, only the outcome. The context isolation mechanism is mentioned in the same feature list, also without detail. This is not an accusation of a defect; it is a statement about what the material supports. If you adopt LiteFlow, the refresh path is where your own verification effort belongs, because it is the claim with the least supporting detail and the highest blast radius. A related operational point: because rules can live in Nacos, Etcd, Zookeeper, Apollo or Redis, rule changes become configuration changes with no code review attached. That is the point of the feature and also its risk surface.

Where LiteFlow is the wrong tool

LiteFlow is an orchestration engine, not an inference framework. If your requirement is to call a model, parse a response and return it, the ReAct agent module is more machinery than the task needs, and the DSL is an extra layer between you and the provider SDK. The README's own framing supports this: the AI feature is presented as making an agent orchestrate like any other component, which only pays off when there is an existing flow for it to join. The second boundary is state. Rules loaded from a coordination service or a database are shared mutable configuration. Teams without a review path for those stores will find that a rule edit is an unreviewed production change. The third boundary is complexity that is already well expressed in code. If your flow is three method calls with one branch, a rule file adds a parsing step, a component contract and a rule source to maintain, and the README's own pitch about decoupling bloated systems does not apply.

Alternatives and the difference in approach

The obvious comparison is a general workflow engine such as Flowable or Camunda. Those model long-running, stateful processes: a process instance is persisted, it survives restarts, and human tasks and timers are first-class. LiteFlow is in-memory and execution-scoped. A rule run starts, components execute, it ends. There is no process instance to query and no persistence layer implied by the README. If you need a task that waits three days for an approval, LiteFlow is the wrong shape. The second comparison is Drools, a rules engine in the inference sense: facts go into working memory and a rule set matches against them, with conflict resolution deciding what fires. LiteFlow's DSL is imperative orchestration. You write the order; the engine executes it. Nothing in the README suggests pattern matching over a fact base. That distinction decides the choice: if your logic is a flow with branches, LiteFlow's model fits; if your logic is a set of conditions over a data model, a production rule system fits better.

Maintenance, licence and what to check before adopting

LiteFlow is Apache-2.0, which permits commercial use and modification, and the licence text governs the terms rather than anything written here. The README states the project was open-sourced in 2020 and describes an active community with an issue and suggestion channel on the official site. It also states there are 2000 or more test cases, which is a claim about the repository's test suite rather than a guarantee about your use case. No release history was retrieved for this review, so the cadence of maintenance cannot be assessed from the material. The practical cost of adopting LiteFlow is not the framework; it is the rule files. Every flow you move into XML, JSON or YML becomes an artifact that needs a home, a review process and an owner, and if it lives in Nacos or Apollo, that process is different from your normal pull request flow. Budget for that before the first flow is migrated, not after the tenth.

Editorial conclusion

Adopt LiteFlow if your problem is a long Java business flow whose branching and parallelism have become unreadable, and you want that wiring in an XML, JSON or YML rule file that can be reloaded without a restart. Do not adopt it if you only need an LLM call wrapped in a Java client, or if you cannot host a rule file in one of the supported stores and keep it under review. Before committing, verify three things in your own environment: that your JDK version is covered by the JDK8 to JDK25 range the README claims, that the rule source you intend to use (Nacos, Etcd, Zookeeper, Apollo, Redis or a structured database) has a working extension in your stack, and that the hot refresh behaviour holds under your concurrency profile, since the README asserts it does but gives no mechanism for how in-flight executions are isolated.

Official sources

  1. dromara/liteflow on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
Community notes

Community notes