cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using State Machine Workflows

Jump to solution

This article applies to both Nintex Workflow 2013 and Nintex Workflow 2010 and is targeted to beginner users of Nintex Workflow.

A State Machine Workflow is used when actions within a workflow need to be repeated by multiple parties and workflow advancement is dependent on the outcome.

Situation: Advertisement creation process

The Graphics team needs to approve the artwork, the Marketing department needs to approve the artwork and content and the CEO needs to approve the entire advertisement. If the Marketing department rejects the artwork, the artwork returns to the Graphics department. If the CEO rejects the advertisement then it returns to the Marketing department.

Best Practice for State Machine workflows

To end a state machine, you will need to use the Change State action. Using any other action, e.g. the End Workflow action, can cause any number of fun/ random errors!

Create a New Workflow

  1. Click on the list where the workflow is to appear and then select the List tab in the Ribbon.
  2. In the Ribbon, select Workflow Settings and click on Create a Workflow in Nintex Workflow.
  3. Select the Blank template and click Create.

Add a State Machine Workflow Action and configure the action to display three states

  1. Select a State Machine action and place on the design canvas.
  2. In the State 1 field, type “Graphics Team”.
  3. In the State 2 field, type “Marketing Department”.
  4. Click Add State.
  5. In the new State field, type “CEO Approval”.
  6. In the Choose the state that this state machine will start in field, select Graphics Team.

state_machine_states.png

Your workflow should appear as it does below.

state_machine.png

Add a Request Approval Workflow Action

Select and place a Request Approval workflow action below each state and configure the action with relevant user information from your environment.

request_approval.png

Graphics Team: Request Approval - declined or approved

If the advertisement is rejected from the Graphics Team, an email is sent to the initiator to end the workflow.

  1. Select a Send Notification workflow action on the Request Approval – declined branch.
  2. Configure the Send notification action to email the initiator about the outcome.
  3. Drag a Change State action below the Send notification action. Double click to open the configuration dialog, and select the Next state as End State Machine.

Note: To end a state machine, you will need to use the Change State action. Using any other action, e.g. the End Workflow action, can cause any number of fun/ random errors!

change_state.png

If the advertisement is approved, a Change State workflow action will direct the workflow to the Marketing Department state.

  1. Select a Change State workflow action on the Request Approval – accepted branch.
  2. In the Next State field, select Marketing Department.

marketing_department.pnggraphics_team.png

Marketing Department State

  1. Select a Change State workflow action and place on the Request Approval- declined branch.
  2. In the Next State field, select Graphics Team.
  3. Select another Change State action and place on the Request Approval – approved branch.
  4. In the Next State field, select CEO Approval.

ceo_approval.png

Note: You can change to a state from any other – states do not have to be directly next to each other.

marketing.png

CEO Approval State

  1. Select a Change State workflow action and place on the Request Approval- declined branch.
  2. In the Next State field, select Marketing Department.

If the advertisement is approved by the CEO, an email will be sent to the initiator of the workflow and the state machine will be ended.

  1. Select a Send Notification workflow action and place on the Request Approval – approved branch.
  2. Configure the Send notification action to send an email to the initiator.
  3. Select a Change State workflow action and place below the Send Notification action.
  4. In the Next State field, select End State Machine.

Note: If required, the workflow can continue on to other actions after the state machine is ended. The completed state machine as shown.

full_workflow.png

Reply
16 Replies
Highlighted
murphybp2
Nintex Newbie

Re: Using State Machine Workflows

Jump to solution

I'm currently working on a rather complex approval process, and didn't even realize you could do this.  Very helpful, thank you.

Reply
Not applicable

Re: Using State Machine Workflows

Jump to solution

Always fun when you discover something new

Reply
Not applicable

Re: Using State Machine Workflows

Jump to solution

Hi, created the same exactly, but constantly getting the error message:

Status: failed on start > retrying.

Note: Due to heavy load, the latest workflow operation has been queued. It will attempt to resume at a later time.

Appreciate your help on what's wrong.

BR

Ben

0 Kudos
Reply
Not applicable

Re: Using State Machine Workflows

Jump to solution

Hi,

I have a similar question here.

I am working on "Leave Management System" and I have a scenario where approver can send the request to the user back and ask for "More Information"

I have used the State Action, but it is working as expected.

Attached is the screenshot of the workflow. Can you please help?

0 Kudos
Reply
Not applicable

Re: Using State Machine Workflows

Jump to solution

Hey Ankita, can you please repost this question in the Learn More​ space as a new question? It'll be much more visible by the rest of the community

0 Kudos
Reply
Not applicable

Re: Using State Machine Workflows

Jump to solution

I have posted it in “Learn More” space as well.

Thanks,

Ankita Rikhab Chand

Reply
Not applicable

Re: Using State Machine Workflows

Jump to solution

Very helpful post , thank you

0 Kudos
Reply
cju
Nintex Newbie

Re: Using State Machine Workflows

Jump to solution

Great article Emily !

I'd like to add a precision that I learned few times ago : the "Change state" action should be the last one on a branch otherwise other actions under this one will be executed before changing the state. For example, if you add a "Run if" action and inside this action you add a "Change state" action, this action will be executed (if the condition of the "Run if" action is validated of course) but before changing the state of the state machine, actions after the "Run if" will be executed.

Hope it will help others

Caroline Jung

Reply
Not applicable

Re: Using State Machine Workflows

Jump to solution

Thanks for sharing Caroline!

0 Kudos
Reply