SharePoint 2016 General Availability was announced in the Future Of SharePoint conference in May 2016. The series that discusses the installation of SharePoint 2016 in Azure can be found at C# Corner from the links, mentioned below.
Nintex is a premium technology partner for SharePoint. With the announcement of SharePoint 2016, Nintex has made the announcement of the General Availability of Nintex Workflow 2016 in July 11th 2016.
In this article, we will see how to trigger a secondary Workflow from the primary Nintex Workflow. To demo this, I have already created:
- 2 Lists – Master & BackUp, so that items from Master can be copied to BackUp list, using Workflow
- CopyListItems Worflow that will copy the list items between the Master and BackUp list. (You can find the article about this here).
Now, we will be creating a master Workflow within which the CopyListItems Workflow will be invoked.
Here “Start another Workflow within the list” will be the main Workflow. “Copy List Items” Workflow will be called from the main Workflow.
Create the Main Workflow
From the Workflow settings option, select “Create a Workflow, using Nintex Workflow”.
Drag and drop the action Start Workflow on to the Workflow designer.
It will show the message regarding missing configurations.
Hence from the drop down, select the Configure option.
In the Workflow to start option, select the name of the secondary Workflow, which has to be invoked.
Also, make sure to select the checkbox “Wait for the Workflow to complete before continuing”, so that the primary Workflow will continue execution only after the secondary child Workflow has completed execution.
Finally, the Workflow designer would look, as shown below.
Now, we have to set the triggering condition for the main Workflow. Let’s set it to manual. Hence, when it is manually started, the secondary Workflow to copy the list items will be started automatically (This is a demo scenario, as we can have a single Workflow to accomplish this requirement).
Specify the name of the Workflow and the description.
Finally, publish the Workflow.
The Workflow has been published.
Test the Workflow
The master list will show 2 Workflow status columns for both primary and secondary Workflows.
- Start another Workflow within the list – Primary Workflow status column.
- Copy List Items – Secondary Workflow status column.
Now, we can go ahead and test the Workflow for which we will be creating a list item in the master list.
Since the Primary Workflow is set to run manually, run the Workflow by going to the Workflow settings. This will set the primary Workflow to “In Progress” state and the secondary Workflow to “Starting” state.
After some time, the secondary Workflow (Copy List Items) will complete, followed by the main Workflow.
Heading over to the BackUp list, we can see the copied item in the list. This operation was done by the secondary Workflow, which was started from the main Workflow.
Summary
Thus, we saw how to start a secondary Workflow within a main Nintex Workflow in SharePoint Server 2016.