Restarting a failed workflow in specific State

Badge +1

I have a workflow with a State Machine in it which i want to be able to restart in a different state in the state machine. (An instance when this would be needed is if a user sends the workflow to the wrong step, or if the workflow errors and needs to be restarted without going through all the steps it has already gone through.)

I am using a secondary workflow which has 3 actions in it,

  1. Terminate Workflow Instances, which stops the current workflow
  2. Update List Item, which is adds the State chosen in a variable with Initiation set to Yes, this should choose the state in which the workflow starts in.
    Variable to specify restart position
    Variable Initiation Options


  3. Start Workflow, to restart the workflow, hopefully in the state chosen previously.

The workflow works almost as intended, it stops the workflow and sets the state to restart in, and then restarts the workflow, but does not start it in the chosen state.

Someone who previously built a workflow on our site built this exact workflow and it does start it at the chosen state, but for some reason i can’t get it to start there.

The Start Workflow Action doesn’t seem to have any indicator as to where it should be started, which is most likely the issue, but the original i have doesn’t show where it specifies this state either.

Has anyone ever built something like this? I am willing to try any other ways of making this work.


Best answer by Garrett 24 May 2023, 15:32

View original

2 replies

Userlevel 6
Badge +16

Hi @michael_bostwic 

  1. You have run the secondary workflow. 
    You have a RestartStatus set to Yes. 
    Where did you save the value of the State to start from? Assign or Updating MI
    I believe that you are saving the value to a SP column

  2. You need that value to use as the Starting State in your state Machine.
  3. Here is an simple State Machine. Branch1 to Branch6
    We are setting the starting state from a variable value which determine where the state machine starts from.  
  4. Variable “GoToState” = Branch3.
    Log to History. Starting from GoToState variable
    Variable is used in the State Machine.


In your case, I believe that you probably save the choice value to a SP column for example “Level”.
Here we set the starting state as the value from column “Level”


Hope that helps

Badge +1

This was the issue, i was looking at the secondary workflow for the problem, but it was in the state machine in the primary workflow.

I really appreciate your help and your quick response!