You are on page 1of 5

How to

Create a simple state machine workflow


A state machine workflow should be used when it is necessary to jump back and forth between different but repetitive steps in a process, where advancement is dependent on an outcome. In this simple example, we are setting up a workflow that will allow for the process of creating an advertisement. We require the artwork to be approved by the Graphics department, the artwork and content to be approved by the marketing department then finally the entire advertisement needs to be approved by the CEO. The workflow also has to cater for the idea that if the Marketing Department rejects the artwork, the artwork returns to the Graphics department and if the CEO rejects the advertisement that it return to the Marketing Department. While there are many other scenarios imaginable, for now we will keep the workflow simple to illustrate how to set it up. The first step is to drag on a State machine action to the workflow designer, normally found in the Logic and flow set of actions. By default, two branches or states appear. Configure the action, as shown below, so that there are 3 states that are labeled and the state the state machine will begin with is Graphics team.

Your workflow should appear as it does below.

Now for each state, drag on a Request Approval action and configure them with relevant users information from your environment.

In the Graphics team state (below), if the advertisement is rejected, we will send an email to the initiator (and/or whoever else would be appropriate) then end the workflow. In the Approved branch we can add a Change state action, which will route the workflow to the Marketing department state. PLEASE NOTE: the "Change State" action does not instantly change execution to the new state, it only sets which state should be run next. Selecting End State Machine will exit the State Machine construct when the current state has finished running.

For the Marketing department state, drag and drop a Change state action for each outcome path of the Request approval action. You can then set the declined path to change state back to the Graphics team state. Similarly, route the workflow to the third step, CEO approval. Please note: you can change to any state from any other states do not have to be directly next to each other.

The CEO approval state comprises of a Request approval action as well. In the case that it is rejected, the workflow changes state back to Marketing department using a Change State action.

In the case of approval, an email is sent to the initiator of the workflow and the state machine is ended. The workflow can continue on to other actions after the state machine if required.

The completed workflow is depicted on the following page.

You might also like