Zen Engine is an open-source business rules engine implemented in Rust with Python bindings, designed for high-performance decision-making. It allows users to define complex business logic using a DMN-like JSON/YAML schema for decisions and flows. As of version 0.54.0, it leverages a Rust core for efficiency and provides a Pythonic interface for integration. It is actively maintained with frequent updates.
pip install zen-engineVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `ZenEngine`, define a basic decision rule using its JSON schema, and evaluate it with input context. It also shows how to access the result from the `ZenResult` object.
Review and update your JSON/YAML rule definitions to conform to the new schema introduced in v0.50.0. Refer to the official Zen Engine documentation for the latest schema structure.
Update your code to access evaluation results via the `ZenResult` object's properties, such as `result.result` for the successful output, `result.success` to check for success, and `result.error` for error details.
If you were passing a dictionary of resources to `ZenEngine()`, you now need to provide a `loader` object instead. The `loader` is an interface that the engine uses to fetch external DMNs/Flows/etc. Consult the documentation for implementing a custom loader.
Always refer to the official Zen Engine documentation for the precise syntax and available functions within its expression language. Do not assume full compatibility with JavaScript or other common expression languages.