Parent-Child Workflows in K2 Studio (Basic)

This tutorial provides the step-by-step instructions for configuring a simple parent-child workflow using K2 Studio. To successfully work through this tutorial, you should be familiar with K2 terminology and workflow concepts.

Why use Parent-Child Workflows?

Parent-Child Workflows are ideal in situations where you have multiple tasks that are not dependent on each other. For example, you might start child workflows if you have a process that requires action from multiple departments, yet those actions are independent of the other departments. Another example would be if your process contains a number of system events (such as updating lists) that are not dependent on other steps in the process. Child workflows can run at the same time, or one after another. The parent workflow must have some sort of closure however, from the child workflow so that it can continue and complete.

For this tutorial, we are using a K2 Virtual Machine environment. The server and user names throughout this document reflect the VM environment. If you are building this tutorial within your own environment, your names and screen views will not be exactly the same as this document, but you can follow along and adapt the labels to meet your needs.

Workflow Design

In our basic parent-child vignette, we will create a new project in K2 Studio, then add two process items (the Parent Workflow and the Child Workflow). (Remember that the terms 'process' and 'workflow' are the same.) The Parent Workflow will consist of a single IPC (Inter-process Communication) event where K2 will fire a Child Workflow. The Child Workflow will send the originator a confirmation email that contains data it received from the Parent Workflow. After the Child Workflow email has been sent, the Child Workflow will be complete and K2 will return to the Parent Workflow. The Parent Workflow will then send an additional confirmation email that contains data it received from the Child Workflow. After the parent email is sent, the parent-child workflow process will be complete.

The diagram below illustrates our basic parent-child concept using a flowchart. Notice that there are two columns, one for the Parent Workflow steps and one for the Child Workflow steps. Notice that the Parent Workflow pauses while the Child Workflow is running. The Parent Workflow then resumes after the Child Workflow has completed.

Mapping out your workflow steps using a flowchart or similar diagram can help you to clearly visualize the events and steps necessary to accomplish your parent-child workflow goal.

There are five steps for completing this vignette. In Step 1, we will create a K2 Studio project and add two process items (the Parent Workflow and the Child Workflow). We will also add several data fields which we will use throughout the workflow to transfer data from the Parent Workflow to the Child Workflow and vice versa. In Step 2, we will add and configure the IPC event for the Parent Workflow. In Step 3, we will add and configure the email event for the Child Workflow. In Step 4, we will deploy the Parent-Child Basic project and assign workflow permissions and finally in Step 5, we will test our project.

Duration
This tutorial should take approximately 20-30 minutes to complete.

We begin with Step 1, creating the K2 Studio project and basic parent/child workflows.