The Rules module allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules).
Example use cases
- Build flexible content publishing workflows changes
- Send customized mails to notify your users about important
- Create custom redirections, system messages, breadcrumbs, ...
- Build an eCommerce store using Ubercart (Drupal 8 or Drupal 7) or Drupal Commerce (Drupal 7 only)
And many more...
Features
- Obviously, you may use reaction rules to react upon any event with custom conditions and actions.
- Allows functionality to be re-used via components.
- Flexible scheduling system that allows scheduling any component / action.
- Users can share their customizations by using the built-in import/export feature. For that the module also integrates with Features.
- Modular input evaluation system - for example you can install the Token module and use it in every action.
- The module has been developed with site performance in mind, so it makes use of caching routines to speed up rule evaluation.
- Rules 2.x (Drupal 7 only) features improved APIs, a new admin UI, support for all entity types, parameter configuration via simple data selection (i.e. just pass
node:author
as argument) and much more. See this blog post for more details.
Integrations
Modules may use the Rules module's API to provide new events, conditions, actions or default rules, which can be customized by users. Some notable ones are:
- Rules Link - Provides clickable links on entities and views that trigger Rules execution
- Rules list conditions - Allows checking condition(s) on list items, evaluating to TRUE if either "any" or "all" items match the condition(s)
- Views Rules - Provides Views directly as Rules actions and loops to seamlessly use view result data
- Rules Forms - Provides a Rules based method for controlling forms and their elements
- Conditional Rules - Provides inline conditional branching in Rules configuration with statements: If/Else, Switch/Case, While
To make your own integration, check out the developer docs. See also issues tagged rules-integration and a manually updated list of modules supporting Rules.
Requirements
Drupal 8, 9, and 10:
Drupal 7:
Resources
- Rules Essentials Documentation Handbook
- api.drupal.org/api/rules - API Reference for developers. Covers Drupal 7, Drupal 8, Drupal 9, and Drupal 10.
Maintainers
- Tim Rohaly (TR)
- Wolfgang Ziegler (fago) (maintainer emeritus)
Alternative modules
Project information
- Module categories: Automation
- 127,128 sites report using this module
- Created by fago on , updated
- Drupal 10 is here!
The 8.x-3.x branch of this module works on Drupal 10 and is being tested against Drupal 10 on a weekly basis. See https://www.drupal.org/pift-ci-job/2270167 for the most recent test results. The intention is to keep the development version of this module in sync with changes to core Drupal as Drupal 10 evolves.
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Development version: 8.x-3.x-dev updated 9 Oct 2023 at 05:40 UTC
PHP 8.2 compatibility.
Development version: 7.x-2.x-dev updated 10 Jul 2023 at 23:47 UTC