Last December I wrote up 24 specific things we've automated on Drupal, and published them as an Advent Calender -- one little nugget each day. I'm finally taking the time to summarize and categorize those, to give you a few ideas for things you might want to do on your site!

Drupal is a fantastic platform for automating things. In addition to hundreds of single-purpose modules, we now have two major general purpose modules that transform Drupal from a mere CMS (content management system) to an automation powerhouse. The modules? ECA, and the AI module.

Your Drupal site as an automation engine, with Events, Conditions, and Actions (ECA)

Because Drupal provides a structure for your information, that means you can apply rules to do things automatically. ECA has become the most powerful rules engine for Drupal, with thousands of actions available, and a broad ecosystem of what it works with.

Because Drupal provides a base Entity system that most modules use, ECA can automate things like Commerce orders or registrations, even without those modules adding explicit support for ECA.

So here are some automations in Drupal that we have actually used. A few came from modules that do some specific task, but most are ECA. And a couple are even using AI.

Automations for content editors

Content management is the core of what Drupal does. And content management gets complex, especially when you have many editors or a lot of it. Here are some ways we've streamlined publishing or editing content:

Image
Flowchart depicting a process, with various labeled rectangular nodes connected by arrows.
ECA model for a perpetual calendar block

Content display automations

ECA is surprisingly useful for making special-purpose blocks that always shows the right thing, or change what's shown on an event page after the event has happened, or update documents based on new content:

Control access

When you want to engage with a group of people who may not all be trusted, you need access control of some kind. Access control systems can get extremely complex, very quickly. ECA can automate many of the day-to-day tasks -- not only making your job easier, but also doing it more consistently, improving the quality and reducing mistakes -- making the site more secure. Here are a few automations we've done related to access control and caching:

Post to other systems

Chances are, you use other web applications and not just your Drupal site. One of the most powerful ways to use ECA is to wire together workflows, move items through a process -- and when that process extends beyond Drupal, ECA can use APIs. Here are a few recent examples we've put together - note that Freelock created the BlueSky and Matrix integration plugins in house!

Image
Flowchart of Licensed User Access ECA Model with various interconnected boxes and arrows.
ECA model to restrict access to various resources behind a login

Business-process automations

All of the previous automations have been relatively simple -- but when things get more complex, ECA can still handle the job. All the Lego blocks of Drupal things get snapped together in ECA, and you can build really sophisticated systems without needing dedicated modules to do it.

And the best part? You have a visual representation of the entire system, with built-in documentation. That means when you, or someone else, comes back to it months or years later, you can see how it works and where to make changes. 

Why ECA wins

Before 2025, our choice was really between writing custom code to automate things, or figure out how to do it with ECA. As seasoned Drupal developers with advanced development tools like PHPStorm, it was often faster to just write some custom code -- and sometimes it still is. ECA, as powerful as it is, still takes quite a bit of knowledge about what's available and how things work to use effectively -- and like any other software platform, there are rough edges and areas that are hard to figure out.

But ECA wins in several ways:

  1. It provides a visual diagram of what's happening that non-technical stakeholders can understand.
  2. It provides built-in documentation, which if used consistently can really help future site administrators/builders read and understand complex modules, so they can change it effectively.
  3. Because you're building on thousands of plugins, as APIs change, you rarely need to change your models -- those changes will generally get provided by the plugin for you -- with custom code, you need a developer to update for new versions.

In short, using ECA makes future you have less headaches! ECA, like Drupal itself, is built for change. As your organization changes, it's often trivial to make changes to Drupal and ECA to accommodate new business rules, new systems, whatever it is you need to do now that is different from yesterday.

I would just throw in a caution here to say, don't go making reckless changes on production -- they can still have bad consequences if you haven't fully thought them through. This is where engaging a shop like ours to provide development copies, proper testing, and data migration if needed can save the day.

The future of ECA, with AI

Now that it's 2025, vibe coding is all the rage. If you haven't heard of it, vibe coding is basically letting an AI do the coding for you, while you just provide guidance. It's truly impressive what you can build through vibe-coding -- but it's no replacement for building a secure, reliable, performant application. There are plenty of stories of vibe-coding-gone-wrong -- deleted customer databases, private data posted publicly for anyone to download, unintended side effects, and much more.

If you want to build something reliable that doesn't expose your organization to a lot of risk, you need traditional software engineering more than ever. And Drupal is such a strong foundation for building with AI. I'll be writing more blog posts about this, but for now, just a teaser -- the same modeling canvas that ECA uses to show its events and actions, is now available for Drupal's AI module to put together a swarm of AI agents.

And this is perhaps the best part of all of this - starting now, it's possible to build a system that uses deterministic ECA rules and Drupal permissions as guardrails to keep AI agents in line!

 

If you would like help automating or creating an AI-driven application, get in touch and we can help!

Add new comment

The content of this field is kept private and will not be shown publicly.

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <blockquote cite> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h1> <h2 id> <h3 id> <h4 id> <h5 id> <p> <br> <img src alt height width>
  • Lines and paragraphs break automatically.