LiteFlow Assistant
This skill helps users use LiteFlow (v2.16.X) with AI. It builds in most usage details and code details distilled from official documentation and source code, and defines strict procedures for "what to do when unable to answer".
Version Alignment: The content of this skill aligns with LiteFlow v2.16.X (approximately v2.16.0). Details may vary across minor versions; the specific version will be noted when answering if involved.
1. When to Use
Activate this skill when the user mentions any of the following scenarios:
- Writing components (normal/selection/boolean/loop-count/iterator-loop components, or declarative components).
- Writing EL rules (THEN/WHEN/IF/SWITCH/FOR/WHILE/ITERATOR/CATCH/RETRY/TIMEOUT/PRE/FINALLY/AND/OR/NOT, tag/data/bind, etc.).
- Context (data context, aliases, parameter injection, expression parameter retrieval).
- Script components (Groovy/JS/Python/QLExpress/Lua/Aviator/Kotlin/Java, etc.).
- Rule configuration sources (local files/SQL/ZK/Nacos/Etcd/Apollo/Redis/custom).
- Configuration items (SpringBoot/Spring/Solon/pure code).
- Executors (execution methods of FlowExecutor, LiteflowResponse).
- Writing/debugging test cases (JUnit5 + SpringBoot testing paradigm, global state cleanup, official test modules for each feature).
- AI Agent orchestration (: orchestrating ReAct Agent as a component into EL, model/credential configuration, custom tools, streaming output, session/memory).
- Advanced features such as debugging/error reporting/link troubleshooting, hot refresh, thread pools, dynamic construction, decision routing, lifecycle, downgrade/rollback/aspect, etc.
- Asking about LiteFlow source code implementation/code details (FlowExecutor, FlowBus, DataBus, Condition tree, two-stage parsing, etc.).
2. Decision Process for Answering LiteFlow Questions (Must Be Strictly Followed)
This is the most important section. Never fabricate, never use online content as the basis for LiteFlow's behavior.
Step 0 — Check the quick reference in this document first (Section 3 below): About 80% of common questions (EL operators, component types, execution APIs, core configurations) can be answered directly without loading any files.
Step 1 — Load the corresponding reference: When the quick reference is insufficient, use
to open
according to the "Knowledge Map" (Section 4). Most usage and code detail issues are resolved here.
Mark the source reference file name when answering.
Step 2 — Local source code: If the reference does not cover the issue (usually more obscure or deeper source code details), first detect the local LiteFlow repository, in the priority order: environment variable
→
→
.
- Use
scripts/source-lookup.sh path
to detect (prints the absolute path if found; exit code 2 if not found).
- After finding it, use
scripts/source-lookup.sh grep <keyword>
(search ) / / / show <relative path> [a-b]
to locate, answer with reference to .
Step 3 — Request cloning (must obtain user consent first): If the local repository is not available, or the issue clearly requires online/latest source code, stop and inform the user to request confirmation, for example:
"This content is not in my built-in knowledge. I can git clone the official LiteFlow repository (gitee.com/dromara/liteFlow, default
tag, aligned with built-in content) to a temporary directory, confirm from the source code and then answer. Is this allowed?"
- User agrees → Run
scripts/source-lookup.sh clone
(clone to cache ), then use to locate, answer with reference to .
- User refuses / does not explicitly agree → Truthfully state "Cannot confirm temporarily, it is not recommended to speculate", do not clone on your own, do not fabricate, do not use web search results as the basis for LiteFlow's behavior.
Absolute Prohibitions
- Fabricate APIs, method names, parameters, configuration items, default values or behaviors based on memory before reading the corresponding reference or source code.
- Treat web search (WebSearch/webpage) results as the basis for LiteFlow's actual behavior (unless the user explicitly requests online verification).
- Execute or without the user's explicit consent.
3. High-Frequency Quick Reference (Answer Directly, No Need to Load Reference)
All the following content has been verified against official documentation + source code. If the following is still insufficient, check the corresponding reference for details.
3.1 EL Operator Quick Reference (See for details)
| Operator | Semantics | Minimal Example |
|---|
| (alias ) | Serial | |
| (alias ) | Parallel (asynchronous) | |
| Condition (x is a boolean component/expression; supports /) | |
| Selection (x returns target nodeId) | |
| Count loop (x returns the number of times) | |
| Condition loop | |
| Iterator loop (x returns Iterator) | |
| Loop interruption (used with loops) | |
| Catch exceptions of a and pass to b for processing | |
| Retry | |
| / | Timeout control | WHEN(a,b).maxWaitSeconds(5)
|
| / | Pre / Post (always executed) | THEN(PRE(a), b, FINALLY(c))
|
| / / | Boolean AND/OR/NOT (used for IF conditions) | |
| Sub-variable (reuse fragments) | See el-rules.md |
| Node modifiers | / / / | |
| Link inheritance | | See el-rules.md |
WHEN Parallel Modifiers:
(ignore errors and continue),
(end when any completes),
(nodes that must complete),
(by proportion), whether to use an independent thread pool, etc. — details see el-rules.md.
Where to write rules: In rule files such as
/
/
within
<chain name="..."> ... </chain>
, the trailing semicolon can be omitted; comments are supported.
3.2 Component Type Quick Reference (See for details)
| Desired Behavior | Component Type | Key Method/Annotation |
|---|
| Normal processing | | |
| Multi-way selection (returns nodeId) | | returns string |
| Boolean judgment (IF/WHILE condition) | | returns boolean |
| Count loop | | returns count |
| Iterator loop | | returns |
| Declarative (no base class inheritance) | Register Bean with | Add @LiteflowMethod(PROCESS, nodeType=...)
to the method; or declare nodeType with on the class |
- Registration: Both inherited/declarative components use
@LiteflowComponent("nodeId")
(can also use to set alias).
- Component lifecycle hooks (overridable for inherited components, use for declarative components): (admission, skip if false), /, /, , , .
- Retrieve context within component:
this.getContextBean(XxxContext.class)
/ this.getFirstContextBean()
; Retrieve process input parameters: .
3.3 Execution API Quick Reference (See for details)
java
@Resource private FlowExecutor flowExecutor;
// Synchronous execution: chainId + input parameter + multiple context Classes (instantiated by framework)
LiteflowResponse resp = flowExecutor.execute2Resp("chain1", param, OrderContext.class, UserContext.class);
// Directly execute a segment of EL (v2.15.0+, no rule file required)
LiteflowResponse resp2 = flowExecutor.execute2RespWithEL("THEN(a, b, c)", param, OrderContext.class);
// Asynchronous / Routing
Future<LiteflowResponse> f = flowExecutor.execute2Future("chain1", param, OrderContext.class);
List<LiteflowResponse> rs = flowExecutor.executeRouteChain(param, OrderContext.class);
Common values for
(
method names are based on source code):
| Requirement | Method |
|---|
| Whether successful | |
| Failure exception | (it's , not ) |
| Exception code/message | / |
| Context | resp.getContextBean(XxxContext.class)
/ |
| Step string (with time consumption) | resp.getExecuteStepStrWithTime()
|
| Structured steps | (Map<String, List<CmpStep>>
) / |
| Request/session/link ID | / / |
| Timeout nodes (v2.12.3+) | |
| Rollback steps | / |
3.4 Core Configuration Quick Reference (See for details, SpringBoot )
| key | Default | Description |
|---|
| — | Rule file path, required when using rule files; automatically invalid when changed to code dynamic construction |
| | Also available / (lazy loading) |
| | Context slot count, automatically expands |
| (+) | (ms) | Overall timeout for WHEN parallel execution |
| | Global asynchronous node concurrency limit |
| | Set to true when mixing multiple rule sources |
| | Auto-reload when local rule files change |
| | Fast parsing mode |
| | Only takes effect for JDK21+ |
| | Execution process log |
| | Simple monitoring statistics |
⚠️ These configuration names
do not exist in v2.16.X, do not fabricate:
(concurrency is controlled by
),
(should be
),
.
4. Knowledge Map (Question Type → Reference File)
Use
to open the corresponding file under
for details:
| Question Type / Keywords | Load File |
|---|
| Framework positioning, execution model, module map, version/JDK support, performance | |
| Installation and operation, Hello World (SpringBoot/Spring/Solon/others) | |
| All configuration items, scenario differences, LiteflowConfig | |
| Components (5 inherited types / declarative / lifecycle hooks) | |
| Full EL syntax, component parameter syntax, retry/timeout/inheritance/validation | |
| Data context, aliases, parameter injection, expression parameter retrieval | |
| FlowExecutor methods, input parameters, LiteflowResponse | |
| Test cases and examples (testing paradigm, BaseTest cleanup, feature→test module quick reference, DEMO) | |
| Script components, coordinates for various languages, bound variables, dynamic refresh/validation/uninstallation | |
| Rule configuration sources (local/SQL/ZK/Nacos/Etcd/Apollo/Redis/custom) | references/rule-sources.md
|
| Metadata operator, smooth hot refresh, no startup check | |
| Asynchronous thread pools (FlowExecutor layer/component asynchronous layer/virtual threads) | references/thread-pools.md
|
| Dynamic construction of Node/EL/Chain | references/dynamic-build.md
|
| Decision routing (concept/usage/executeRouteChain) | references/decision-routing.md
|
| Framework-level lifecycle (startup/execution hook interfaces) | |
| Advanced features (downgrade/rollback/aspect/implicit sub-process/steps/monitoring...18 items) | |
| AI Agent orchestration (ReAct Agent components, model/credentials, custom tools, streaming output, session memory, ) | references/react-agent.md
|
| Source code details (FlowExecutor/FlowBus/DataBus/Condition tree/operator→class mapping) | references/code-internals.md
|
| Common pitfalls and FAQ | references/faq-pitfalls.md
|
5. Citation Specifications
- Usage-related questions: Mark the source reference file name at the end of the answer, e.g., "See for details".
- Code/source code-related questions: Cite source code (from
references/code-internals.md
or source code found in Step 2/3).
- For APIs/configurations involving version dependencies, mark the aligned version (default v2.16.X).
6. About
A command-line assistant that prioritizes local usage / controlled cloning + retrieval (POSIX sh, can be run directly on macOS):
| Subcommand | Function |
|---|
| Print the path of the detected local repository (exit code 2 if not found, no cloning) |
| Explicitly clone the gitee repository to cache (default tag, aligned with built-in content; can specify other tags/branches using ); only call after obtaining user consent |
| Search in files of the repository (prioritize , fallback to ) |
| Search in all files of the repository |
| Search by file name |
| Display a file (with line numbers, optional range) |
Environment variables:
(specify local repository to override detection),
(optional, specify tag/branch; if not set, clone
, only fallback to master if explicitly set to empty
),
(default
).
Responsibility Boundary: The script does not handle user interaction; whether to clone is determined by the decision process of this skill (Step 3) after obtaining user consent.