Skip to main content

Let's talk about Open Source "Automation" aka the ECA module in Drupal

Let's talk about the ECA module. If you know me personally, then you know if we are talking open-source, I've been talking about the ECA module. The Drupal ECA module, or Event-Condition-Action, is a no-code solution that allows site devs and permissioned users to automate complex workflows without writing a single line of code. Building on the foundation of the popular Drupal 7 Rules module, the ECA module modernizes the Drupal 8+ architecture by providing a robust and flexible way to orchestrate a wide range of tasks.

Business Value

For businesses, the primary value of the ECA module lies in its ability to streamline operations and enhance efficiency. By automating repetitive or manual tasks, organizations can:

  • Increase Efficiency and Reduce Manual Effort: Automate content publishing, user management, and e-commerce operations. This frees up teams to focus on higher-value activities.
  • Improve Accuracy and Consistency: Enforce business rules and workflows consistently, minimizing human error. For example, automatically sending confirmation emails or updating inventory levels ensures a smooth and reliable process.
  • Enhance Collaboration: The visual, no-code interface allows technical and non-technical teams to work together more effectively. Business requirements can be directly implemented and understood by all stakeholders.
  • Rapid Prototyping and Scalability: Quickly create and test new workflows. Since ECA models are stored as configuration, they can be easily deployed across different environments, making it simple to scale operations.

Quick Tutorial for a Proof of Concept

To get started with the ECA module, you'll need to install the core module and a "modeller" module that provides the user interface. BPMN.iO is the most commonly recommended modeller.

  1. Installation: Install the ECA and BPMN.iO modules using Composer, for example: composer require 'drupal/eca:^1.0' 'drupal/bpmn_io:^1.0'. Then, enable the modules from the Extend page in your Drupal administration.
  2. Create Your First Model: Navigate to Configuration > Workflow > ECA Models. Click "Add model" and give it a name. You'll be presented with the BPMN.iO visual interface.
  3. Define a Simple Workflow:
    • Event: Drag and drop a "StartEvent" onto the canvas. This is your trigger. A common example is "After saving a new content entity."
    • Condition: Add a "Gateway" to check a condition. For instance, you could check if the content type is "Article."
    • Action: Add a "Task" to perform an action. For example, "Send an email." You can configure the email details (recipient, subject, body) in the task's settings.
  4. Connect and Save: Draw arrows to connect the elements in the correct order: StartEvent -> Gateway -> Task. Save your model.

This simple workflow demonstrates the core principles of ECA. You can build upon this by adding more complex conditions and actions to automate a variety of business processes on your Drupal site.

Here is a video from YouTube from the search results that shows a step-by-step guide on how to redirect users by role using the Drupal ECA module.

Redirect users by role with the Drupal ECA module

Tags
I am an Austin, Texas-based designer, I'll add more later.

Contact info

Contact.

Recent Posts