Skip to content
Back to search

rulego

⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/rulego/rulego with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/rulego/rulego'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/rulego--rulego/badge.svg)](/listings/rulego--rulego)

HTML

<a href="/listings/rulego--rulego"><img src="/api/listings/rulego--rulego/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Install `RuleGo` using the `go get` command:

go get github.com/rulego/rulego
# or
go get gitee.com/rulego/rulego

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 214 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # RuleGo
  2. [![GoDoc](https://pkg.go.dev/badge/github.com/rulego/rulego)](https://pkg.go.dev/github.com/rulego/rulego)
  3. [![Go Report](https://goreportcard.com/badge/github.com/rulego/rulego)](https://goreportcard.com/report/github.com/rulego/rulego)
  4. [![codecov](https://codecov.io/gh/rulego/rulego/graph/badge.svg?token=G6XCGY7KVN)](https://codecov.io/gh/rulego/rulego)
  5. [![test](https://github.com/rulego/rulego/workflows/test/badge.svg)](https://github.com/rulego/rulego/actions/workflows/test.yml)
  6. [![build](https://github.com/rulego/rulego/workflows/build/badge.svg)](https://github.com/rulego/rulego/actions/workflows/build.yml)
  7. [![build](https://github.com/rulego/rulego/workflows/build/badge.svg)](https://github.com/rulego/rulego/actions/workflows/build.yml)
  8. [![QQ-720103251](https://img.shields.io/badge/QQ-720103251-orange)](https://qm.qq.com/q/8RDaYcOry8)
  9. [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go?tab=readme-ov-file#iot-internet-of-things)
  10. English| [简体中文](README_ZH.md)
  11. [Official Website](https://rulego.cc) | [Docs](https://rulego.cc/en/pages/introduction/) | [Contribution Guide](CONTRIBUTING.md)
  12. <img src="doc/imgs/logo.png" alt="logo" width="100"/>
  13. `RuleGo` is a lightweight, high-performance, embedded, orchestrable component-based rule engine built on the Go language.
  14. It can help you quickly build loosely coupled and flexible systems that can respond and adjust to changes in business requirements in real time.
  15. `RuleGo` also provides a large number of reusable components that support the aggregation, filtering, distribution, transformation, enrichment, and execution of various actions on data, and can also interact and integrate with various protocols and systems.
  16. It has a wide range of application potential in low-code, business code orchestration, data integration, workflows, large model intelligent agents, edge computing, automation, IoT, and other scenarios.
  17. ## Features
  18. * **Lightweight:** No external middleware dependencies, efficient data processing and linkage on low-cost devices, suitable for IoT edge computing.
  19. * **High Performance:** Thanks to Go's high-performance characteristics, RuleGo also employs technologies such as coroutine pools and object pools.
  20. * **Dual Mode:** Embedded and Standalone Deployment modes. Supports embedding `RuleGo` into existing applications. It can also be deployed independently as middleware, providing rule engine and orchestration services.
  21. * **Componentized:** All business logic is component-based, allowing flexible configuration and reuse.
  22. * **Rule Chains:** Flexibly combine and reuse different components to achieve highly customized and scalable business processes.
  23. * **Workflow Orchestration:** Supports dynamic orchestration of rule chain components, replacing or adding business logic without restarting the application.
  24. * **Easy Extension:** Provides rich and flexible extension interfaces, making it easy to implement custom components or introduce third-party components.
  25. * **Dynamic Loading:** Supports dynamic loading of components and extensions through Go plugins.
  26. * **Nested Rule Chains:** Supports nesting of sub-rule chains to reuse processes.
  27. * **Built-in Components:** Includes a large number of components such as `Message Type Switch`, `JavaScript Switch`, `JavaScript Filter`, `JavaScript Transformer`, `HTTP Push`, `MQTT Push`, `Send Email`, `Log Recording`, etc. Other components can be extended as needed.
  28. * **Context Isolation Mechanism:** Reliable context isolation mechanism, no need to worry about data streaming in high concurrency situations.
  29. * **AOP Mechanism:** Allows adding extra behavior to the execution of rule chains or directly replacing the original logic of rule chains or nodes without modifying their original logic.
  30. * **Data Integration:** Allows dynamic configuration of Endpoints, such as `HTTP Endpoint`, `MQTT Endpoint`, `TCP/UDP Endpoint`, `UDP Endpoint`, `Kafka Endpoint`, `Schedule Endpoint`, etc.
  31. ## Use Cases
  32. `RuleGo` is an orchestrable rule engine that excels at decoupling your systems.
  33. - If your system's business is complex and the code is bloated
  34. - If your business scenarios are highly customized or frequently changing
  35. - If your system needs to interface with a large number of third-party applications or protocols
  36. - Or if you need an end-to-end IoT solution
  37. - Or if you need centralized processing of heterogeneous system data
  38. - Or if you want to try hot deployment in the Go language...
  39. Then the RuleGo framework will be a very good solution.
  40. #### Typical Use Cases
  41. * **Edge Computing:** Deploy RuleGo on edge servers to preprocess data, filter, aggregate, or compute before reporting to the cloud. Data processing rules and distribution rules can be dynamically configured and modified through rule chains without restarting the system.
  42. * **IoT:** Collect device data reports, make rule judgments through rule chains, and trigger one or more actions, such as sending emails, alarms, and linking with other devices or systems.
  43. * **Data Distribution:** Distribute data to different systems using HTTP, MQTT, or gRPC based on different message types.
  44. * **Application Integration:** Use RuleGo as glue to connect various systems or protocols, such as SSH, webhook, Kafka, message queues, databases, ChatGPT, third-party application systems.
  45. * **Centralized Processing of Heterogeneous System Data:** Receive data from different sources (such as MQTT, HTTP, WS, TCP/UDP, etc.), then filter, format convert, and distribute to databases, business systems, or dashboards.
  46. * **Highly Customized Business:** Decouple highly customized or frequently changing business and manage it with RuleGo rule chains. Business requirements change without needing to restart the main program.
  47. * **Complex Business Orchestration:** Encapsulate business into custom components, orchestrate and drive these custom components through RuleGo, and support dynamic adjustment and replacement of business logic.
  48. * **Microservice Orchestration:** Orchestrate and drive microservices through RuleGo, or dynamically call third-party services to process business and return results.
  49. * **Decoupling of Business Code and Logic:** For example, user points calculation systems, risk control systems.
  50. * **Automation:** For example, CI/CD systems, process automation systems, marketing automation systems.
  51. * **Low Code:** For example, low-code platforms, iPaaS systems, ETL, LangFlow-like systems (interfacing with large models to extract user intent, then triggering rule chains to interact with other systems or process business).
  52. ## Architecture Diagram
  53. <img src="doc/imgs/architecture.png" width="100%">
  54. <p align="center">RuleGo Architecture Diagram</p>
  55. ## Rule Chain Running Example Diagram
  56. <img src="doc/imgs/rulechain/demo.png" style="height:40%;width:100%;"/>
  57. [More Running Modes](http://8.134.32.225:9090/ui/)
  58. ## Installation
  59. Install `RuleGo` using the `go get` command:
  60. ```bash
  61. go get github.com/rulego/rulego
  62. # or
  63. go get gitee.com/rulego/rulego
  64. ```
  65. ## Usage
  66. `RuleGo` is extremely simple to use. Just follow these 3 steps:
  67. 1. Define rule chains using JSON:
  68. - [Rule Chain DSL Doc](https://rulego.cc/en/pages/rule-chain/)
  69. - [example_chain.json](testdata/rule/chain_call_rest_api.json)
  70. 2. Import the RuleGo package and use the rule chain definition to create a rule engine instance:
  71. ```go
  72. import "github.com/rulego/rulego"
  73. //Load the rule chain definition file.
  74. ruleFile := fs.LoadFile("chain_call_rest_api.json")
  75. // Create a rule engine instance using the rule chain definition
  76. ruleEngine, err := rulego.New("rule01", ruleFile)
  77. ```
  78. 3. Hand over the message payload, message type, and message metadata to the rule engine instance for processing, and then the rule engine will process the message according to the rule chain's definition:
  79. ```go
  80. // Define message metadata
  81. metaData := types.NewMetadata()
  82. metaData.PutValue("productType", "test01")
  83. // Define message payload and message type
  84. msg := types.NewMsg(0, "TELEMETRY_MSG", types.JSON, metaData, "{\"temperature\":35}")
  85. // Hand over the message to the rule engine for processing
  86. ruleEngine.OnMsg(msg)
  87. ```
  88. > Real time update of rule chain logic without restarting the application
  89. ### Rule Engine Management API
  90. - Dynamically update rule chains
  91. ```go
  92. // Dynamically update rule chain logic
  93. err := ruleEngine.ReloadSelf(ruleFile)
  94. // Update a node under the rule chain
  95. ruleEngine.ReloadChild("node01", nodeFile)
  96. // Get the rule chain definition
  97. ruleEngine.DSL()
  98. ```
  99. - Rule Engine Instance Management:
  100. ```go
  101. // Load all rule chain definitions in a folder into the rule engine pool
  102. rulego.Load("/rules", rulego.WithConfig(config))
  103. // Get an already created rule engine instance by ID
  104. ruleEngine, ok := rulego.Get("rule01")
  105. // Delete an already created rule engine instance
  106. rulego.Del("rule01")
  107. ```
  108. - Config:[Documentation](https://rulego.cc/en/pages/config/)
  109. ```go
  110. // Create a default configuration
  111. config := rulego.NewConfig()
  112. // Debug node callback, the node configuration must be set to debugMode:true to trigger the call
  113. // Both node entry and exit information will call this callback function
  114. config.OnDebug = func (chainId,flowType string, nodeId string, msg types.RuleMsg, relationType string, err error) {
  115. }
  116. // Use the configuration
  117. ruleEngine, err := rulego.New("rule01", []byte(ruleFile), rulego.WithConfig(config))
  118. ```
  119. ### Rule Chain Definition DSL
  120. [Rule Chain Definition DSL](https://rulego.cc/en/pages/rule-chain/)
  121. ### Rule Chain Node Components
  122. The core feature of `RuleGo` is its component-based architecture, where all business logic is encapsulated in components that can be flexibly configured and reused. Currently,
  123. `RuleGo` has built-in a vast array of commonly used components.
  124. - [Standard Components](https://rulego.cc/en/pages/standard-components/)
  125. - [rulego-components](https://github.com/rulego/rulego-components) :[Documentation](https://rulego.cc/en/pages/extension-overview/)
  126. - [rulego-components-ai](https://github.com/rulego/rulego-components-ai)
  127. - [rulego-components-ci](https://github.com/rulego/rulego-components-ci)
  128. - [rulego-components-iot](https://github.com/rulego/rulego-components-iot)
  129. - [rulego-components-etl](https://github.com/rulego/rulego-components-etl)
  130. - [rulego-components-discovery](https://github.com/rulego/rulego-components-discovery)
  131. - [rulego-marketplace](https://github.com/rulego/rulego-marketplace) :Dynamic component and rule chain marketplace
  132. - [Custom Node Component Example](examples/custom_component) :[Documentation](https://rulego.cc/en/pages/custom-components-overview/)
  133. ## Data Integration
  134. `RuleGo` provides the Endpoint module for unified data integration and processing of heterogeneous systems. For details, refer to: [Endpoint](endpoint/README.md)
  135. ### Input Endpoint Components
  136. - [Endpoint Components](https://rulego.cc/en/pages/endpoint-extension/)
  137. - [Endpoint DSL](https://rulego.cc/en/pages/endpoint-dsl/)
  138. ### RuleGo-Server
  139. We have provided a ready-to-use automation workflow platform based on `RuleGo`: [RuleGo-Server](server/) ,
  140. and a front-end visual editor: [RuleGo-Editor](https://editor.rulego.cc/) . See [server/README.md](server/README.md) for details.
  141. ## Performance
  142. `RuleGo` completes most of its work during initialization, so running the rule chain almost doesn't add extra overhead to the system, and the resource consumption is extremely low, making it particularly suitable for running on edge servers.
  143. Additionally, RuleGo uses Directed Acyclic Graph (DAG) to represent the rule chain, where each input message only needs to be processed along the path in the graph without matching all the rules, which greatly improves the efficiency of message processing and routing, and also saves system resources.
  144. Performance test cases:
  145. ```
  146. Machine: Raspberry Pi 2 (900MHz Cortex-A7*4,1GB LPDDR2)
  147. Data size: 260B
  148. Rule chain: JS script filtering->JS complex transformation->HTTP push
  149. Test results: 100 concurrent and 500 concurrent, memory consumption does not change much around 19M
  150. ```
  151. [More performance test cases](https://rulego.cc/en/pages/performance/)
  152. ## Ecosystem
  153. - [RuleGo-Editor](https://editor.rulego.cc/) : Rule chain visual editor
  154. - [RuleGo-Server](server/) : Automation workflow platform
  155. - [Tpclaw](https://tpclaw.teambuf.com/) : Autonomous evolution of AI agent platform
  156. - [GFlow Engine](https://github.com/rulego/gflow-engine) : Embeddable approval workflow engine
  157. - [rulego-components](https://gitee.com/rulego/rulego-components) : Extension component library
  158. - [rulego-components-ai](https://github.com/rulego/rulego-components-ai) : Declarative agent framework
  159. - [rulego-components-ci](https://github.com/rulego/rulego-components-ci) : CI/CD scenario component library
  160. - [rulego-components-iot](https://github.com/rulego/rulego-components-iot) : IoT scenario component library
  161. - [rulego-components-etl](https://github.com/rulego/rulego-components-etl) : ETL scenario component library
  162. - [rulego-components-discovery](https://github.com/rulego/rulego-components-discovery) : Service discovery and configuration center component library
  163. - [rulego-marketplace](https://github.com/rulego/rulego-marketplace) : Dynamic component and rule chain marketplace
  164. ## Contribution
  165. Any form of contribution is welcome, including submitting issues, suggestions, documentation, tests or code. [Contribution Guide](CONTRIBUTING.md)
  166. ## License
  167. `RuleGo` uses Apache 2.0 license, please refer to [LICENSE](LICENSE) file for details.
  168. ## Contact Us
  169. Email: rulego@outlook.com

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.