Sub-Workflow

Use this step to separate functions and execute.

Last published at: September 8th, 2025

subWorkflow Step

Description:

This step separates functionality into child instances and executes them separately from the parent instance.

 

Inputs

  • definitionID – definition to use
  • passVariablesToChild – passes variable values from parent to child instance. Make sure the child instance has the same variables, named the same as the parent variables
  • passVariablesBackToParent – passes the variable's values back to the parent from the child instance
  • passGlobalsToChild - Pass globals to child instance
  • passGlobalsBackToParent - pass globals back to parent
  • pcvarmap - parent to child variable mapping
  • pcglobalmap - parent to child global mapping
  • isSynched – Yes = parent waits until child instance is completed to execute, No = parent instance does not wait for the child instance to complete, parent instance continues execution
  • executionPriority -Select execution priority
  • cpvarmap - child to parent variable mapping
  • cpglobalmap - child to parent global mapping
 

 

Returns

  • True – step executed successfully
  • False – step failed to execute 
 

 

Usage:

 

 

Example:

Let’s build and execute the “subWorkflowDef” example.          

  • Create a new definition named “subWorkflowDef” and open it in designer mode. 
  • Drag the “updateVariables”, “updateGlobals,” “subWorkflow”, “decision,” and “placeholder” controls to the canvas.
  • Connect the dots between the “Start” and other steps, as shown above.
  • Define the variables or globals to store the values.
  • Click the "updateVariables" step to configure its "Required" properties. Provide a name for the step. Navigate to the “Optional” tab. Click the icon, then enter values for multiple variables. A pop-up window appears for configuration. Click the Add Row button to insert an empty row. Enter the variable name and value. Click the Save button. You may add multiple variables using the Add Row button. 

 

  • Click the "updateGlobals" step to configure its "Required" properties. Provide a name for the step. Navigate to the “Optional” tab. Click the icon, then enter values for multiple globals. A pop-up window appears for configuration. Click the Add Row button to insert an empty row. Enter the global name and value. Click the Save button. You may add multiple globals using the Add Row button. 

 

  • Click the "subWorkflow" step to configure its "Required" properties. Provide a name for the step. Select the process definition as a separate function from the dropdown list. Then click the Save button. 

 

  • The process definition configured as a sub-workflow in this example is this workflow.

 

  • Click the "evalExpression" step to configure its "Required" properties. The expression evaluates the variables and global values passed to the subworkflow at runtime. 

 

  •  Click the "subWorkflow" step to configure its "Optional" properties. Set “Yes” to pass variables to the child instance. Set “Yes” to pass variable values back to the parent instance. Set “Yes” to pass globals to the child instance. Set “Yes” to pass global values back to the parent instance. Click the button to map “parent-to-child” variable values to and fro. Click the button to map “parent-to-child” global values to and from. Set “Yes” for “Is Synchronized” if the parent should wait until the child instance is completed before executing. Set “No” if the parent instance does not wait for the child instance to complete; the parent instance continues execution. Select execution priority from the dropdown list - “low, medium, high.” 

 

  • Click the button to map the “parent-to-child” variable mapping. Click the “Add Row” icon to add new rows to map sub-process variables to parent process variables or values.  

 

  • Click the button to map “parent-to-child” global mapping. Click the “Add Row” icon to add new rows to map sub-process globals to parent process globals or values. 

 

  • Click the button to map the “child-to-parent” variable mapping. Click the “Add Row” icon to add new rows to map sub-process variables to parent process variables or values. Note: You can map sub-process globals to parent process variables when you need to swap values between globals and variables. 

 

  • Click the button to map “child-to-parent” global mapping. Click the “Add Row” icon to add new rows to map sub-process globals to parent process globals or values. Note: You can map sub-process variables to parent process globals when you need to swap values between globals and variables. 

 

  • Click the "decision" step to configure its "Required" properties. Provide a name for the step and the expression to evaluate. 

 

  • Click the Connection Properties link and configure the workflow's “True” and “False” process paths. 

 

  • Save the process definition, create a new instance, and execute it. Render the process instance. To render the child process instance, click the navigation icon (black) on the sub-workflow step. 

 

  • The child process instance is displayed in a new tab. 

 

Definition Sample:

You may download the sample definition(s) from the link provided and later import them (drag-and-drop) into your FlowWright Process Definition (XML file) or Form Definition (HTML file) page. 

Note: Please verify and complete the import process steps for any missing configurations, such as file path references and database connections. Then, save the definition to confirm the changes.

Click here to download the sample file.