Last updated February 19, 2013. Created by verta on August 3, 2010.
Edited by NancyDru, ShaneOnABike. Log in to edit this page.

The Workflow Module

Project page: http://drupal.org/project/workflow

This is a stub page for documentation of the Workflow module.


The workflow module enables you to create arbitrary workflows in Drupal and associate them with node types.

A Workflow is made up of workflow states.

Moving from one state to another is called a transition.

Actions are associated with transitions (actions.module was used for this in Drupal 5; core actions support is in Drupal 6). You may also use the Rules module to react to transitions and states.

Alex Reisner introduced role-based permissions for workflow states and generally enhanced this module.


INSTALLATION

  1. Place the entire workflow directory into your Drupal sites/all/modules directory.
  2. Enable the workflow module by navigating to:
    Administer > Site building > Modules
    Enabling the Workflow module will create the necessary database tables for you.
  3. The Workflow Admin UI modules is required to create and configure Workflows.
  4. If you want anyone besides the administrative user to be able to configure workflows (usually a bad idea), they must be given the "administer workflow" access permission:
    Administer > User management > Permissions

    When the module is enabled and the user has the "administer workflow" permission, a "Workflow" menu should appear in the menu system under Administer -> Site building.

    You may also allow only some users to schedule transitions in the future. Select the "schedule workflow transitions" permission to allow transitions.

  5. You may limit whic roles show up in the workflow edit screen by using the "Participate in workflow" permission.
    Administer > User management > Permissions

GETTING STARTED

Note: Recent changes to the admin UI have affected these instructions a bit. You should still be able to find your way around though.

  • Let's create a new workflow. Click on Administer -> Site building -> Workflow and click on the "Add workflow" tab.
  • We'll start simple. Call our workflow "Draft-Done" and click Add Workflow.
  • Now lets add some workflow states to our workflow. Click "add state" and enter "draft" and click the Add State button. Do the same for "done".
  • So we've got a workflow with two states, "draft" and "done". Now we have to tell each state which other states it can move to. With only two states, this is easy.
  • Click on the "edit" link of the newly created Workflow to edit the workflow and see its state transitions.
  • The "From / To -->" column lists all states. To the right are columns for each state. Within each cell is a list of roles with checkboxes.
  • This is confusing. It's easiest to understand if you read rows across from the left. For example, we start with the creation state. Who may move a node from its creation state to the "draft" state? Well, the author of the node, for one. So check the "author" checkbox.
  • Who may move the node from the "draft" state to the "done" state? This is up to you. If you want authors to be able to do this, check the "author" checkbox under the "done" state. If you had another role, say "editor", that you wanted to give the ability to decree a node as "done", you'd check the checkbox next to the "editor" role and not the author role. In this scenario authors would turn in drafts and editors would say when they are "done".
  • Be sure to click the Save button to save your settings.
  • Now let's tell Drupal which node types should use this workflow. Click on Administer -> Site building -> Workflow. Let's assign the Draft-Done workflow to the story node type and click Save Workflow Mapping.
  • Now we could add an action (previously configured using the trigger module). Click on the Actions link above your workflow. Add the action to the transition.
  • Now create a new story by going to Create content -> Story. If there is no sign of a workflow interface here, don't panic. The interface is only displayed if there is more than one state to which the user can move the node (why bother the user with a form with only one selection?) Click Submit to create the story.
  • You can see the state the node is in and the history of state changes by clicking on the Workflow tab while viewing a node.
  • Changing the state to "done" and clicking Submit will fire the action you set up earlier.

Comments

Regular Content Review

Drupal is so amazing as a base to build upon - anything is possible! But sometimes it's really hard to figure out what the best solution to my problem is....

I need my site to email content authors periodically when their content "expires" and needs to be updated. Certain nodes will need annual attention, others more frequently. Also, I need to be able to see a view of what content has expired so I can put the screws to anybody who hasn't updated their content.

According to http://drupal.org/node/959494, this module seems to be part of what I need. Unfortunately that article is a little lacking on details... and I'm not even sure it all applies to Drupal 7.x (my love-hate relationship with Drupal continues...)

Anyway, this feature seems to me like the sort of thing that should be built-in to a content management system, but I can't find anything in the "core" that does this, and googling it is difficult: "Drupal content review" comes up with hundreds of reviews on the content mangement system known as Drupal :)

A Suggestion to Regular Content Review

In case you haven't found a solution yet; explore using a combination of Workflow, Rules and Views Bulk Operations. There is a tutorial that could get you very close to what you need at this address: http://nodeone.se/sv/node/650
Don't give up on Drupal!

Drupal 7 and Workflow

The workflow menu doesn't seem to show in the menu system in Drupal 7
The only place that I see "workflow" is in the configuration section, and it appears as a section called "workflow" and it only has Rules in it!

I'm wondering from where I can add a new workflow and new states in it? I've installed workflow module and enabled every module that comes with it. but all I have is Rules!

Am I missing something?? do I have to install other modules with the "workflow" module?

Enable: Workflow Admin UI

There are some Workflow sub-modules, make sure that you enabled the right one, i.e. workflow_admin_ui.
It's similar like in Views module, there is also Views UI.

I had to clear caches before

I had to clear caches before the workflow UI would show.

http://ITShepherd.org - web, marketing, social media

Workflow module video

this is a great video for the workflow module:
http://www.drupalove.com/drupal-video/workflow

http://SocialNicheGuru.com
Creating gurus to deliver the right product and the right message to the right niche at the right time

Please note: as of this

Please note: as of this writing (1/16/13) only one workflow can be attached to a node at a time.

http://SocialNicheGuru.com
Creating gurus to deliver the right product and the right message to the right niche at the right time

How to control field access in a state?

How to control field access in a state?
I do not want certain field visible in state to user how do i achieve this?

workflow fields could be an answer

Page status

Needs updating

Log in to edit this page

About this page

Drupal version
Drupal 5.x, Drupal 6.x, Drupal 7.x
Audience
Site administrators, Site builders, Site users
Level
Intermediate
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.