Using State Machines In Workflows

  • 26 March 2021
  • 0 replies
  • 247 views

Userlevel 3
Badge +8

Question

How does a State Machine action work within a Nintex workflow?

 

Answer

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 asEnd 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

 


0 replies

Be the first to reply!

Reply