Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A fast and reliable .NET Rules Engine with extensive Dynamic expression support
| Date | Stars |
|---|---|
| 2026-07-24 | 4313 |
| 2026-07-25 | 4315 |
| 2026-07-28 | 4322 |
| 2026-07-30 | 4326 |
| 2026-08-06 | 4327 |
Today
+1 stars today
This week
+1 stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.02%/day
# Rules Engine

[](https://coveralls.io/github/microsoft/RulesEngine?branch=main)
[![Nuget download][download-image]][download-url]
[download-image]: https://img.shields.io/nuget/dt/RulesEngine
[download-url]: https://www.nuget.org/packages/RulesEngine/
### Supported target frameworks
[](#)
[](#)
[](#)
[](#)
[](#)
[](#)
## Overview
Rules Engine is a library/NuGet package for abstracting business logic/rules/policies out of a system. It provides a simple way of giving you the ability to put your rules in a store outside the core logic of the system, thus ensuring that any change in rules don't affect the core system.
## Installation
To install this library, download the latest version of [NuGet Package](https://www.nuget.org/packages/RulesEngine/) from [nuget.org](https://www.nuget.org/) and refer it into your project.
## How to use it
There are several ways to populate workflows for the Rules Engine as listed below.
You need to store the rules based on the [schema definition](https://github.com/microsoft/RulesEngine/blob/main/schema/workflow-schema.json) given and they can be stored in any store as deemed appropriate like Azure Blob Storage, Cosmos DB, Azure App Configuration, [Entity Framework](https://github.com/microsoft/RulesEngine#entity-framework), SQL Servers, file systems etc. For RuleExpressionType `LambdaExpression`, the rule is written as a [lambda expressions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions).
An example rule:
```json
[
{
"WorkflowName": "Discount",
"Rules": [
{
"RuleName": "GiveDiscount10",
"SuccessEvent": "10",
"ErrorMessage": "One or more adjust rules failed.",
"RuleExpressionType": "LambdaExpression",
"Expression": "input1.country == \"india\" AND input1.loyaltyFactor <= 2 AND input1.totalPurchasesToDate >= 5000"
},
{
"RuleName": "GiveDiscount20",
"SuccessEvent": "20",
"ErrorMessage": "One or more adjust rules failed.",
"RuleExpressionType": "LambdaExpression",
"Expression": "input1.country == \"india\" AND input1.loyaltyFactor >= 3 AND input1.totalPurchasesToDate >= 10000"
}
]
}
]
```
You can inject the rules into the Rules Engine by initiating an instance by using the following code -
```c#
var rulesEngine = new RulesEngine(workflow);
```
Here, *workflow* is a list of deserialized objects based on the schema explained above
Once initialised, the Rules Engine needs to execute the rules for a given input. This can be done by calling the method `ExecuteAllRulesAsync`:
```c#
List<RuleResultTree> response = await rulesEngine.ExecuteAllRulesAsync(workflowName, input);
```
Here, *workflowName* is the name of the workflow, which is *Discount* in the above mentioned example. And *input* is the object which needs to be checked against the rules, which itself may consist of a list of class instances.
The *response* will contain a list of [*RuleResultTree*](https://github.com/microsoft/RulesEngine/wiki/Getting-Started#ruleresulttree) which gives information if a particular rule passed or failed.
_Note: A detailed example showcasing how to use Rules Engine is explained in [Getting StarteExcerpt of 7,605 characters
Read on GitHub66
43
24
13
Dishant Munjal · @microsoft · India
9
8
Vladyslav Keidaliuk · CHECK24 · Germany
2
2
2
Aleksandar Ivanov · @pipeline-foundation
2
2
1
1
1
1
1
IchHabeKeineNamen · Zhejiang University; · Hong Kong
1
1
1
Carl Meyertons · ServiceTitan · United States
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:00c92fa6eee3b857, topic:workflow