Tuesday, May 14, 2013

Starting a child workflow from Parent Workflow

Referred URL - http://sharepoint.stackexchange.com/questions/15620/how-to-start-a-child-workflow

Question -

I've created a new list-based workflow which has one step that's pretty simple. After that step I'd like to launch another workflow - the Collect Signatures workflow. How can I launch a child workflow from my workflow? I'm using SharePoint Designer to create the workflow.


Answer -

SharePoint Designer workflows do not natively have any way to launch another workflow, but there are ways to accomplish this.

  • Configure the secondary/child workflow to start "On Change"
  • Create a site column that will be used as control field between the parent/child
  • Add the site column as an Association Column on both workflows so they can see it
  • Have the parent workflow set the control field with a status value (e.g. "Start")
  • Have the child workflow read the status to know it should fire. When done, have it update the status (e.g. "Complete")

It is possible that other native fields (e.g. an existing status column) could be used instead of a control field, but I like using a specific control field to communicate between the parent and the child.

If you need the parent workflow to wait for the child, add a "Wait for ..." activity to wait for the control field to be set to "Complete".

If you need to pass additional state between the workflows you can either add additional association columns, or use a secondary list.

No comments: