Start different workflows in \run parallel action\"

  • 9 December 2015
  • 3 replies
  • 6 views

Badge +3

Hi

 

I've created a main workflow with different sub workflows in it. Basis of these workflows is the same list.

In the main workflow I'm using a "run parallel action" item to start 4 different workflows in it. I also selected the "Wait for the workflow to complete before continuing" field in the action settings of the "Start workflow" action. My intention is, that these 4 sub workflows should be finished until the main workflow will be continued.

 

NintexForum.png

 


But I always receive the same error message: "An error has occurred in "Workflow Name".
And there are also Workflow Comments for each sub workflow: "Failed to start workflow. The selected workflow "SubWorkflow Name" is already running on list item with ID "Item ID" in list "List Name" on site "Site URL".

 

After this error message the sub workflows will be started but also the main workflow will be continued without the input of the finished sub workflows.

 

Does anybody know how to solve my problem?


3 replies

Badge +4

Hi Axel, your workflows 1, 2, 3 and 4 are the same workflow definition?

Because it's not possible to start a workflow on an item where an instance of this same workflow is already running.

You can start workflow 1, workflow 2, workflow 3 and workflow 4 on your item only if these are different each other.

Badge +3

These 4 workflows have the same structure but the flexi tasks in this sub workflows are assigned to different users and they also edit different content of this item.

What do you think how to solve this problem? Because I need to finish this 4 sub workflows until the main workflow should be continued.

Badge +4

Ah I understand!!! I already have the same issue and find below my solution.

I don't like use a lot of "pause", especially when there are tasks (it is not known when users will respond) so I prefer change the logic like that.

    - My Main Workflow is built with a State Machine, the branches which you interest are here : Group Validation that launches my sub workflow and Waiting that checks if a workflow is in running on the item.As you can see in the beginning of each branch, I save my last state (this variable is useful to restart the workflow on the last state and make it available on start from, you understand later why).

01.png

   - In the WAITING action this is my process :

       1. I make a little pause just for waiting all your previous  workflows have been launched

       2. I reset my collection of running instances (just to be sure)

       3. If you know your workflow names, ignore my next logic (red cross)

02.png

       4. And foreach of your workflow started previously you need to check their state and add to the collection if is running :

03.png

Details of my actions :

04.png

05.png

06.png

07.png

         5. After you need to check if you can continue your main workflow (the next state of your state machine) or end it (declare end state machine, it's my way to not make pause)

08.png

09.png

6. And the last point is : Restart your main workflow from your sub workflow (we terminated the main workflow previously if a sub workflow was already running). Find below my workflow architecture and details of the last action :

10.png

11.png

Let me know if you need more informations.

Reply