Free Videos about Mastering Views

How To: Drupal Workflows & Automation

Play Video
Movie link (right-click to download)
Problem with this video? Contact me

The definition of a workflow, according to Wikipedia, is a "depiction of a sequence of operations". When taken at face value, a workflow is typically something you want to automate in Drupal. In other words, what we're talking about is Drupal Automation and my guess is, you'll want to automate things in Drupal based on certain events.

The confusing part of Drupal automation is the fact that you need to know what works together to accomplish such automation. With the modules of Workflow, Actions*, Triggers* (* Part of Drupal 6 core) and Rules, it can be quite confusing when it comes to automation.

Put simply, in Drupal 6, you can still use the Workflow module (which I don't show in the video) but you can also get by with the default Triggers and Actions (as mentioned, already installed with Drupal). However, unless you know you need to install Workflow module to achieve the automation you're seeking, and potentially install Triggerunlock module (which you don't really need if you install Workflow in Drupal 6), things can get really confusing, really fast.

So, aside from trying to confuse you with the above paragraph (I did that on purpose), about all the setup and things you do or don't need, I focused a bit more on the Rules module because it's a one-stop-shop for automation which goes beyond what you can do with Triggers, Actions and Workflow.

Even though I'm a convert to Drupal's Rules module, my compliments go out to John VanDyk (whose book helped me learn Drupal even better) for creating Workflow and Actions (which I started with in Drupal 4.7) and to Wolfgang Ziegler for creating the ever powerful Rules module. I can only hope this video will provide you with most everything you need to know to automate things so you can achieve your ultimate Drupal workflow!

Note: If you're still working with Drupal 5, then Workflow, Actions, and Workflow-Ng (also by Wolfgang) will give you the automation you need. In most all cases, you'll definitely want Token module installed so you can do the cool stuff the big boys do.

Added to <a href="http://DrupalSightings.com>DrupalSightings.com

I agree with you regarding the confusion of the user interface of the triggers and actions.
But in my opinion the use of the term Trigger is actually very good, check out the definition on wiktionary: http://en.wiktionary.org/wiki/trigger

3 - An event that initiates others, or incites a response.

The rules module sounds to me like overkill for basic events/triggers/actions, but as you explain the possibilities enormous!

Drupal is getting better by the drop!

Thank you very much for another great video!

Semantic naming is always an issue, until there's a shakeout with some module that's accepted as a "standard". Views could be called Extractor with a companion module called Presenter - but this wouldn't be easy to understand unless you knew that's what you needed.

Personally, I like names which are the most descriptive of what the module does. Aside from any potential legal issues, which I doubt there would be any (because Apple doesn't own the word itself), I'd like to see rules named Automator, because it automates things you would normally do manually. It simply uses the concepts of rules, events, conditions and actions.

This is one of the unique issues with Drupal and module naming. If one name is already taken, even if that module was for version 4.7 and it's pretty much dead, it's not available unless the former maintainer or one of the site admins turns it over. Even then, some want to keep older named modules around for historical reasons - and once you've started coding a module, it's a bit of a hassle to rename it - especially if it's an API module and other modules make calls to it!

I would LOVE to see the module section on Drupal.org use some type of heuristics to determine the "freshness" of a module. Answers to these questions and more, presented in a nice widget-like/graphical format would be awesome.

  • How many items have been dealt with in the issue queue?
  • What was the last date of activity?
  • How many people are commenting on issues?
  • How many new issues are being created in what period of time?
  • What are the usage statistics of the module?
  • What is the percentage of feature requests to bugs?
  • What are the other modules which offer similar features?

Gathering data like this would really give new people to Drupal an idea of what modules to investigate first.

One of the biggest problems any new Drupal user comes up against is "What modules do I use?". Over time, this will become more and more of a problem. (Funny story... I remember printing out the whole list of modules in the 4.7 days and taking them home to read about. Just to know what was out there and possible. I can't imagine doing that now)

Time will tell how well things shake out. The cream usually floats to the top - ala Views, CCK.

Yes, drupal.org modules sections needs a restructuring, I've started working with drupal, mid 2008, I built a very basic site with Drupal 5 although 6 was already out the door. I saw many modules in dev state, and to stay clear of them stuck with Drupal 5. I regreat it now ofcourse. But the point is It was very confusing finding modules.

Even today I search for modules, find one with perfect description for what I want to acomplish, read the page, scroll down and it's only for 4.7, or 5.
But drupal.org is getting better, there's no doubt about that.

Thanks again for the video!

I agree that the module section needs restructuring, but you can filter the module section by Drupal release number, thus eliminating those moldy oldies. I always start with that, and work from there. Makes the task easier.

Being a somewhat new Drupal 6 developer, I very much appreciate the work that goes into your excellent videos.

This Drupal Rules module video has been extremely helpful in "blowing out" my mind to the almost limitless possibilities of Drupal on Rules! Your presentation skills are absolutely terrific, as well.

Drupal Lifer.

Thanks!

@Doug, thanks for the compliments. I'm always open to suggestions about what people would like to see covered. Even if it's not a module per se, but rather a solution to a perplexing problem.

Very nice tutorial, as always.

About the issue with the list with the confusing elements "content author" and the other one, I think it could be easily distinguishable by referring to "node" and "comment", so that you easily know who is the author it is referring to.

I came to see if anything new was published and found two new videos, but I wasn't notified of any of them... did you change the subscription mechanism? (By the way, I'd like to know how to set it up, I'm needing something like that)

I'd like a lot if you made it easier to download the video files, since quicktime videos just play without letting me choose to download, even worse is they get kind-of encrypted in the temp folder and because of that I can't just copy the downloaded file :S. (how about a link to the actual video file?)

Last but not least: Thanks a lot for this material, I enjoy it a lot not only because of the good explanations but also because of the top-notch quality! :)

jedihe

Your videos are great, very academic,easy to put into practice.
Thanks for the time and effort you put into them to make drupal easy to learn for new drupal users.
Your tutorials are the reason i started using Drupal.
keep up the good work and i am sure alot of people appricate your work.

I am still struggling with how you can check a (cck) field value of a node as a condition.

Maybe its "Check a truth value" or "Numeric comparison" but neither of those options allow you to choose a field name.

Can anyone help?

many thanks

Mike

It looks like the options for CCK fields are Field has changed and Field has value, when added as conditions for your Rule. If you choose the later, it will be dependent upon the field type for that cck field. If it's numeric, then you'll be able to specify a number value. If text, then text.

The confusing part will be the requirement to choose the change condition within the Arguments configuration. You choose whether it's based on updated content or unchanged content. THEN, based on the field you choose, you'll have the option to specify the value on the following screen.

This is one of those places where the UI suffers. It leaves you at an intermediary step that doesn't make sense when considering the initial selection you had made. I imagine this is, in part, due to the way the developer has programmed the forms - making them multi-step forms for collecting information. Otherwise, there would need to be a lot more UI coding using stuff like jQuery to make the UI more usable.

Hi Matt

Thanks for the quick reply. My condtions are as follows - no sign of CCK. Maybe I'm missing a D6 module?

best regards

Mike Chaplin

Node
Content has type
Content is promoted to frontpage
Content is published
Content is sticky

Path
Path has alias(es)
URL alias exists

Rules
Check a truth value
Numeric comparison
Textual comparison

User
Compare two users
User has role(s)

I have solved this with the latest version of the CCK module.

Could you please post the link of the video you mentioned?

Great video, very informative! Thank you!

I noticed a mistake at the end of the video. You mention "The following has been a video production from..." It should really be "The previous has been a video production from..." or, better yet, "This has been a video production from..."

Thanks for the mention! When I update my intro and exit the next time around I'll make sure to adjust it. If I could only get rid of all that other work I have to do. :) - Matt

Hi,

Thank you for sharing, loving it!

I am wondering if we can use rules to change a state in a workflow? Has anyone been successful at this one ?

I have a process that is both automated and semi-automated.
For the semi-automated I'm using workflows to allow a user to choose to move from state to state.
However, once it is in one particular state, I want to use cron and triggered rules to read a CCK field and then invoke an action to update the workflow state.
I'm thinking that this can create the timer logic for the wokflow that I so desparately need.

Please help!
 Joe

Hey Matt,
I have spent the last month or so trying to get my head around Drupal. I felt I was getting it, but boy, at a snails pace. I ran into your gotdrupal.com website today and literally watched all your videos (some twice) all day long. You really have a knack for presentation and an ability to guide and teach that is really quite extraordinary. At any rate, I wanted to write you to thank you for your work. It helped me immensely and I feel more confident with Drupal now. I'm wondering if you'll be covering Panels and Advanced Profile any time soon. I want to have a dynamite profile page for users with their own picture gallery, video gallery and other cool stuff. Unfortunately I'm not there yet. Hope all is well with you and I look forward to your next video.

Thanks Claudio, I've been training a bit in another market (FileMaker Pro), and I'd love to do more in the world of Drupal. Since I've been providing all my videos for free, it's a bit hard to justify the time sometimes, but I do my best.

Panels is one of the modules I've not used personally, and it would be a good one to look at (it's quite popular). I'll also need to look at Advanced Profile. However, from the sound of it, the Fields in Core sprint that happened a bit ago for Drupal 7 may make the profile module go away. There will probably be a migration path, but being able to attach fields to users in Drupal will make things even more cool.

If theming the profile page is what you're wanting, then make sure to learn about the possible .tpl.php files that control the area you want to theme. There are a lot of modules which add in GUI goodness, but often at the cost of adding more code - when you can do the same thing with theming. Of course, as mentioned, I've not looked at Advanced Profile module - and, quite honestly - the addition of more code, which might affect performance, typically doesn't start to show until you really need to start tweaking your site based on increased traffic.

If you're looking to stay updated with my video posts then make sure and sign up for the email notification or follow me on Twitter!

Why don't you add a Tip Jar widget or even a Paypal button? Drupal is only going to get more popular and these videos are definetly worth people chipping in for the talanted work available on your site.
My 2 cents
 Claudio

Matt, as usual I loved the video...but please tell me, how did you rig up your 'modules' page to display with all of the fields collapsed? That would be very handy for me,

Mark

Thanks, good video helped me choose a better direction for a site I'm building, keep up the good work :)

Hi Matt,

thanks for the great vid! I was wondering:
I already have workflow/triggers/actions in place on a site, but some stuff I simply cannot do with that setup. Is it possible to run both workflow/triggers/actions as well as rules on the same Drupal install. Or would you suggest to port all the workflow/triggers/actions-stuff to rules?

Wow, this is a terrific video. The evolution of Workflow-NG into Rules with version six of Drupal represents a major improvement, making Drupal far more useful in an enterprise context than it has been in the past. For those intimately involved in Drupal's evolution these improvements might seem trivial, but I reckon this will be a tipping point for those looking to get small and medium-sized enterprise publishing projects off the ground quickly. Really looking forward to version seven later this year!

Hi Matt,

Thanks for your great videos.

I trying to create rules events, but there are not many examples out there.

Specificing would like to create a rules event for signup module.

Could you please provide any pointers?

Thanks
 Ed

Better than watching porn!!! Otherwise Workflow, Rules and Actions looked like rocket science to me!

I found your video quite helpful. Thank you. I created a trigger/action to redirect users to the Forum Home after deleting a Forum Topic. This works, but the same action is applied when deleting News or any other node. So, I recreated my action as a triggered rule, this time with a condition checking content type. Everything looks like it should work, but it does not.

Label: URL Redirect After Delete - Forum Topic
Event: After deleting content
If: Deleted content is Forum topic
Do: Page redirect
To: forum

The debug text after deleting a Forum topic says:

  • 0 ms "After deleting content" has been invoked.
  • 0.132 ms Executing the rule "URL Redirect After Delete - Forum Topic" on rule set "After deleting content"
  • 20.684 ms Loaded variable "acting user"
  • 20.851 ms Condition "Deleted content is Forum topic" evaluated to FALSE.
  • 20.947 ms Evaluation of "After deleting content" has been finished.
  • Forum topic 1231231 has been deleted.

I'm not sure how "Deleted content is Forum topic" returned FALSE when the last line shows it is a Forum topic. Maybe I am missing something.

Thanks.

It wasn't just failing to detect content type. Most Token replacement patterns were not being evaluated either. Apparently, it was a problem with PHP4. I've upgraded to PHP5 and everything works perfectly now. So, thank you again for your video.

Hi,

First of all, great job with this (and other) videos. This is really helpful.

I am a pretty newbie (but now addicted) to Drupal. I am thinking of the following functionality and was wondering if Rules would work in this scenario -

There are two types of users - Producer and Consumer. Producer adds instances of a custom type, say Fish, which has attributes like color, speed and size. Consumers look for the fishes that are added into the system. The consumers would like to create search criteria for the fishes they are looking for e.g. size > 5 inch, color = red, speed = 1 mph. (Currently I am using Views Saved Searches Module for that, and am having some issues with that. If there is any better module available, please suggest).

Now, when a producer adds a new Fish, based on an event or a cron job, it should look for the saved criteria, and if this new fish matches any saved criteria, Rules(?) should be used to send out notification to the criteria owner (Consumer).

Is this something that has been solved in Drupal, or are there any recommendations around it?

All and any help is appreciated!

Ramona.

This is interesting topic and give many good post. It is very useful and informative.

wow guide

Hello,

I just downloaded the movie file for the Drupal Workflow tutorial. Do you know whether this is a fault at origin? could you check? Sorry to ask for that but it is the second time that I try to download it getting the same.

Thanks in advance.

Great insight into the possibilities and basic handling of those modules!
I just had a hard time getting to know triggers/actions and will now join the rules club ;)

Okay, I had to play the video back to hear it, but I knew I heard it...

Firstly, thank you sooo much for your videos. You don't know how many times in the last couple of months spending 15 minutes watching one of your videos has saved me, surely, several hours of fumbling through the tool.

So, I've seen written and now heard in your video references to being able to trigger (pardon the ambiguity) an action when a user is assigned a role. This is of immediate importance to me. And I quote, "A user is assigned to a role...a user is taken off of a role," from your video. I am on Drupal 6.19 with Rules 6.x-1.2 install and I can't seem to find any indication of being able to use this as a possible event/trigger. Is there any advice you can provide regarding tapping into such an event.

On a related note, do you know anything about the ability to write custom events/triggers with the Rules module?