Automation

You don't need a new website. You need to make your current website more effective! How can you do that? There is no single answer -- websites are part of a larger system, and you need to consider many different aspects to make your site effective. We've been making websites since the start of the web, and know what makes them work -- as well as not work. Take what we have learned to make your site better!
Drupal automation platform, ECA module, Rules module, BPMN visualization, Typed Data integration
🕑Jan 10, 2025 🖋John Locke 💬0

Ask Freelock: ECA vs Rules

Yesterday a client asked us to install Rules module (again, repeating an earlier request, when he had missed my answer that we had installed ECA instead).

Santa in red suit checks map by Christmas tree, presents nearby.

Automatically Geolocate Santa

We've reached the last day of the calendar, and it's time for Santa's visit! Santa has been visiting some famous places all month. With the Geocoder module, Leaflet, a Geofield, and an Address field, you can automatically put each address Santa has visited on the map!

You do need to configure a geocoder source. We're using OpenStreetmap, from the geocoder-php/nominatim-provider.

Futuristic robot with glowing eyes surrounded by text bubbles.

Automatically moderate comments using AI

When you allow the general Internet to post comments, or any other kind of content, you're inviting spam and abuse. We see far more spam comments than anything relevant or useful -- but when there is something relevant or useful, we want to hear it!

With the AI module and the Events, Conditions, and Actions module, you can set up automatic comment moderation.

Like any use of AI, setting an appropriate prompt is crucial to getting a decent result. Here's the one we're trying out:

Cloud graphic with tech-related words and symbols.

Parse out names, addresses, complex fields using AI

We've had several clients working with memberships, who have a single name field with the full name of a person. And then they ask us to build a directory that is sorted by last name. This is a bit hard to do if there's a first name in front of it!

Names don't follow rules very well. Some have apostrophes in them, some have multiple words -- you can't just take the last word of a name and assume that's the last name, because often it just isn't.

Stylized griffin with gears, wings spread, blue background with clouds.

Automatically post to BlueSky

Since the 2024 election, the BlueSky social network has exploded in popularity, and appears to be replacing the cesspool that used to be Twitter. I'm not much of a social media person -- I much prefer hanging out in smaller spaces with people with shared interests. If you're like me, I would highly recommend finding a Mastodon server that caters to your interests, where you're sure to find rewarding conversations.

Graphic of blue gears, clouds, circuits, and icons, with words "Drupal" and "Outages."

Make integrations with other services more resilient using a Queue

One downside of automating things is dealing with outages. Sometimes services go down, and are not available for some period of time. When this happens, how does it impact your automation?

If you don't design your automation carefully, you might lose the data entirely. Or get spammed by hundreds of submissions when it comes back up. Handling this correctly does end up needing some understanding of how the automation works, as well as any quirks of the remote system.

Colorful infographic with charts and data tables.

Automatically update a spreadsheet of active products

One of our e-commerce clients has several thousand active products. As a distributor, their clients are retailers, some of which like having an up-to-date product spreadsheet.

Using the Events, Conditions, and Actions (ECA) module along with a Views Data Export view of all products, we created a view of all the relevant fields that exports a spreadsheet of all their products, and saves it in their private media system once per day.