Mysticleaf
Mysticleaf

Reputation: 5

How to create items in child list and trigger a child workflow from a Parent workflow

I want to know if we can have a parent workflow which when called leads to spawning of multiple child workflows. Is there a way we can actually implement it in SharePoint. So basically I want to use a part of my parent workflow to trigger another workflow - this particular workflow can be associated to the same list and sometimes they can be associated with different lists and libraries...will that cause any problems.

It would be awesome if you guys can share your thoughts and ideas regarding this topic.

So how I expect it to work :-

Let's say when something triggers workflow A it goes and spawns multiple items in the SharePoint list which triggers workflow B. And all the newly created items are running workflow B. Also if there is a way to call another workflow C which is linked to another library.

Upvotes: 0

Views: 1220

Answers (2)

Mysticleaf
Mysticleaf

Reputation: 5

So I have got some great news ! I was able to figure this one out but It is not exactly very direct

So SharePoint Designer allows you to create an item in another list using the create function. I have attached a screenshot click here to view

So using this functionality you can create an item in a completely different list or the same list. But this has one problem- Once you actually create an item on the child list using a 2013 workflow it will not trigger the workflow in the child list. So this has been explicitly disabled to prevent a condition called Workflow recursion. So is there a way around it ?

Yes ! you have two options:- 1.Call the Rest Endpoint for the child workflow, Sample approach : https://blogs.msdn.microsoft.com/sridhara/2014/08/21/fix-sharepoint-2013-workflow-recursion-prevention-part-2/

2.Use MS Flow to create the flow in the child list

Hopefully it helps someone out there !

PS: For some weird reason for our company we cannot create 2010 workflows- apparently 2010 workflows are not supported in modern sites (I maybe misinformed)

Upvotes: 0

Mike Smith - MCT
Mike Smith - MCT

Reputation: 1221

If you are using SharePoint 2013 or later:

  • Add a column to the list with a name like WFBtrigger or WFBstatus. Set it to default to "" or "Not run" or similar.
  • Create your Workflow A. When it's finished have it update WFBstatus to "Pending" or similar.
  • Create your Workflow B. Set it to start when the item is created. Add a Loop. In the loop wait for WFBstatus to change to "Pending". Do "B's" work. Update the WFBstatus field to "Done".

Now when A is triggered, B will shortly there after run.

To trigger C in another list, just have A or B update a "WFCstatus" column in the C list and have a workflow C waiting for that column to change.

Upvotes: 1

Related Questions