How to Pass Variables from Parent Workflow/Quickflow to Child Workflow?
- Last UpdatedOct 10, 2022
- 3 minute read
The Workflow Activity enables the execution of a second (child) workflow from a (parent) workflow/quickflow. The workflow activity can be used to call a child workflow from a parent workflow/quickflow. The Variables for the child workflow property and XMLVariables for the child workflow property enable parent workflow/quickflow to pass variable and XML variable information to the child workflow respectively.
To pass variables from parent workflow to child workflow, follow the steps given below:
-
In the parent workflow/quickflow, right-click Workflow Activity, and then select Activity Properties.
-
Enter the repository name for Repository property. The child workflow should belong to the same repository of the parent workflow/quickflow. The repository property of a child workflow is exposed for backward compatibility.
-
Enter the name of the workflow to be executed in the Workflow property.
-
Enter the version only if any specific version of the (child) workflow to be executed in the Version property. Leave this as blank, if the latest published version of (child) workflow has to be executed.
Steps to set the Variables for ChildWorkflow property:
-
To specify the variables to be passed to the child workflow, click the button for the 'Variables for ChildWorkflow' property to open the property window.
-
In the Variables for ChildWorkflow window, select the required variables to be passed to the child workflow.

-
After specifying the data, click Update.
Note: These variables are expected to exist in the child workflow. Make sure to define variables with same name and type as defined in parent workflow/quickflow.
Select the XML variables that need to be passed to the child workflow from XMLVariables for ChildWorkflow property.
Steps to set the XMLVariables for ChildWorkflow property:
-
To specify the XML variables to be passed to the child workflow, click the button for the 'XMLVariables for ChildWorkflow' property to open the property window.
-
In the XMLVariables for ChildWorkflow window, choose the required variables to be passed to the child workflow.

-
Click the Update button.
Note: These XML variables are expected to exist in the child workflow. Make sure to define
XML variables with same name and type as defined in parent workflow/quickflow.
To work with any XML variables or resource activities, SKEventData XML variables must
be passed in the child workflow, where SKEventData contains some events information
related to parent workflow/quickflow which needs to be passed to child workflow. If
SKEventData variable is not created, user can create XML variable of type XMLDocument
with the same name 'SKEventData' by locating the 'SKEventData.xml' from the following
path: [AVEVA Work Tasks Installed Path]\AVEVA\Work Tasks\Web\BPMUITemplates\Default\XMLSchemas
Configuring Child Workflow to route Parent Workflow/Quickflow
Steps to be followed for Child Workflow configuration:
-
Right-click the workflow activity to open child workflow using the context menu item Open Sub Process.
-
Declare a variable named 'ParentWorkflowOutput' of type string in the child workflow Start activity.
-
Use Update Variable activity to set the variable 'ParentWorkflowOutput' value as 'ChildWfCompleted' (This value should be same as the value for the Return Values property in parent workflow action properties).
-
The Update Variable activity to update the parent workflow output should be placed after the logical conclusion of child workflow.

Steps to be followed for Parent Workflow configuration:
-
Use Return Values property to set the routing condition after completion of child workflow. Example: 'ChildWfCompleted'.
This will dynamically create a link output named 'ChildWfCompleted' for the activity. Once the child workflow complete its execution, it returns back to the parent workflow with the return value specified in the child workflow (In this case, child workflow should return 'ChildWfCompleted' value) and then it will continue with further execution.
-
Go back to the parent and set routing condition based on the output 'ChildWfCompleted'.
-
Parent workflow goes to sleep mode after the child is executed.
-
Child completes execution with Update Variable as the last action.
-
Once the child completes execution, the value set in Update variable is given as output for the workflow action in parent.