Applies to version 8.3.x and above; Author: Kamil Nędza
When starting a new workflow with an action, there are three available modes to do it. They are found at the bottom of the Basic configuration tab:
- As a subworkflow of current instance– The created instance will be a subworkflow of the current workflow instance.
- Parallel to current workflow – The created instance will have the same parent workflow as the current workflow instance.
- As a parent workflow, unrelated to current instance – The created instance is independent. When it is started it has no subworkflows or any parent workflow instance.
Examples of use
The most commonly used modes are: starting as a subworkflow of the current instance and as an unrelated workflow. In the following example we will focus on the rarer scenario, where the newly created workflow instance is started parallel to the current instance.
One of the examples can be launching a duplicate of a given workflow instance so that the new instance would have the same parent and certain values would also be the same. Such workflows can be found in:
- Invoice workflows, when using cyclical invoices, where only the invoice number and issuing date change, and the rest of the data remains the same.
- Equipment checkout workflow, when multiples of one item are registered in the system.
- Assigning one task to multiple users (in separate workflow instances) for a project.
On the transition path, add a Start a subworkflow action. In the action configuration, define which workflow should be started as a result of this action, and with which settings. A sample configuration may look like this:
Then go to the Data tab and define which values from the current workflow instance should be copied to the new workflow instance:
In this case, we choose not to send the invoice number and its issuing date, since they will always be different. All other values repeat themselves in cyclical invoices.
Don’t forget to save the process.
We go to the SharePoint form, and move the workflow instance through the transition path on which the Start a subworkflow action was defined. In this case, I named the path Duplicate.
Take note of the parent workflow instance, found in the lower left corner:
After traversing the path, a duplicate if the instance is created. Opening the parent workflow instance in the browser will reveal that it now has two subworkflow instances. The first – FK/2016/07/00002 – which served as the original, and then the duplicate – FK/2016/07/00003.