Return to

Valid for Sitecore 5.2, 5.3
Associating a workflow action with a workflow state


Is it possible to associate a workflow action with a workflow state so that it is executed when content reaches this state rather than associating the action with a workflow command which requires manual transition?


This task can be solved by attaching an Item which will invoke the action to the workflow state. This Item should be based on either the Action or Command template.

The following article describes how to attach an action to the workflow command.  

The task stated in the present article requires that the action is attached to a workflow state: 
/upload/sdn5/faq/workflow/worflow state action/workflow_state_action1.jpg

See the description of the two approaches below:

  1. Create an action based on the Command template (templates/System/Tasks/Command)
    /upload/sdn5/faq/workflow/worflow state action/workflow_state_action2.jpg
  2. Create an action based on the Action template (templates/System/Workflow/Action)
    /upload/sdn5/faq/workflow/worflow state action/workflow_state_action3.jpg

The difference is that when you use the Command template, the method that will be invoked should be specified. In case the Action template is used, the method named Process will be invoked by default, but with this template you can also pass some Parameters with the method arguments. Below is a sample snippet of the CustomWorkflowActions.LogAction class:  

namespace CustomWorkflowActions


      public class LogAction


      public void Process(WorkflowPipelineArgs args)


         Sitecore.Diagnostics.Log.Info("ALERT!" + args.DataItem, this);