Trigger Rules
The@repo/trigger-rules
package provides a powerful rule engine for processing events in your Trigger.dev workflows. It allows you to define JSON-based rules that can be evaluated against event payloads to determine actions and routing.
Features
- JSON-based rule definitions for easy configuration
- Condition evaluation with support for complex expressions
- Integration with Trigger.dev jobs and events
- Dynamic rule loading and evaluation
- Support for internationalization
Installation
This package is part of thezopio
monorepo and is available to all applications in the workspace.
Basic Usage
Importing the Rule Engine
Defining Rules
Rules are defined in JSON format, either inline or loaded from a file:Evaluating Rules
Integration with Trigger.dev
The trigger rules package integrates seamlessly with Trigger.dev jobs:Advanced Usage
For more detailed information on using trigger rules, see the following pages:- Rule Structure - Learn about the structure of rules
- Conditions - Available condition types and operators
- Actions - Available action types and configuration
- Rule Management - How to manage and organize rules
- Testing Rules - How to test and validate rules