Description:
The Dynamic Subworkflow step starts a selected subworkflow and dynamically builds the process based on the configured dynamic keys.
It combines the parent/child workflow model with explicit dynamic-key configuration, allowing a common child workflow to be used for dynamically supplied processing targets. It also supports parent-to-child and child-to-parent variable/global mappings and synchronization.
The step supports:
- Selecting the Process Definition to use for the child workflow.
- Passing variables from the parent instance to the child instance.
- Passing variables from the child instance back to the parent.
- Passing globals from the parent instance to the child instance.
- Passing globals from the child instance back to the parent.
- Providing Dynamic keys to process.
- Specifying the Dynamic key variable used by the child workflow.
- Synchronizing the child workflow with the parent workflow.
- Mapping parent variables and globals to child variables and globals.
- Mapping child variables and globals back to parent variables and globals.
The Dynamic Subworkflow step can be used for:
- Dynamically processing a collection of items.
- Creating reusable child workflow processing.
- Processing multiple records through the same child Process Definition.
- Separating item-level processing from the parent workflow.
- Passing a dynamic key to a child workflow for each processing operation.
- Building modular workflows where the child workflow operates on dynamically supplied keys.
The Dynamic Subworkflow step is a Dynamic process step. It is implemented by FlowWright.Workflow.dll and uses the FlowWright.Workflow.DynamicSubWorkflow namespace.
Inputs
- definitionID – Select the Process Definition to execute as the subworkflow.
- passVariablesToChild – passes variable values from parent to child instance. Make sure the child instance has the same variables, named exactly the same as the parent variables.
- passVariablesBackToParent – passes the variable values back to the parent from the child instance
- passGlobalsToChild – pass Globals to child instance
- passGlobalsBackToParent – pass Globals back to the parent from the child instance
- dynamicKeys -- dynamic keys to process
- childKeyVariableName -- dynamic key variables
- 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 keeps executing
- pcvarmap – parent to child variable mapping
- pcglobalmap – parent to child global mapping
- cpvarmap – child to parent variable mapping
- cpglobalmap – child to parent global mapping
Returns
- True – step executed successfully
- False – step failed to execute
Usage:
The Dynamic Subworkflow step is typically used when a parent workflow needs to invoke a defined child Process Definition while supplying dynamic keys for processing.
A typical pattern is:
Start
│
▼
Prepare Dynamic Keys
│
▼
Dynamic Subworkflow
│
├──► Child Process for Key 1
├──► Child Process for Key 2
├──► Child Process for Key 3
└──► ...
│
▼
Continue Parent Workflow
The parent workflow supplies the dynamic keys and identifies the child variable that represents the current key.
The selected child Process Definition can then use that variable in its processing.

Typical Workflow Suggestions
Process a Dynamic List of Records
Use Dynamic Subworkflow when the parent workflow retrieves a set of records to be processed using the same child Process Definition.
The Dynamic keys to process and Dynamic key variable properties provide the configuration points for this pattern.
Order Item Processing
Use Dynamic Subworkflow to apply the same child workflow to dynamically identified order items.
The child workflow can receive the current item through the configured dynamic key variable.
Customer-Specific Processing
Use Dynamic Subworkflow when a workflow needs to perform the same processing for a dynamic set of customers.
Parent variables can provide additional context required by each child workflow.
Document Processing
A document workflow can use a Dynamic Subworkflow when documents or document identifiers are determined dynamically during workflow execution.
The dynamic key can represent the identifier that the child workflow uses to locate or process the relevant document.
Dynamic Validation
Use Dynamic Subworkflow to apply the same validation workflow to dynamically identified records.
The parent-to-child mappings can provide additional validation context when required.
Example:
Let’s build and execute the “dynamicSubworkflowDef” example, passing variables or globals between sub-workflows.
- Create a new Form Definition named “dynamicSubworkflowDef” and open it in designer mode.
- Drag a “BootstrapGrid, File, and Submit” control to the canvas and arrange them as shown below.

- Click the “File” control to configure its properties. Provide a name for the control. Specify the file extensions to accept. Set the maximum DB file size. Select the “Required” checkbox to make user input mandatory. Select the “Hide” checkbox to hide the control at runtime. Select the “Read-Only” checkbox to mark the control as read-only. Select the “Multiple” checkbox to allow multiple files to be attached. Select the “Show” checkbox to display the list of attached files. Select the “Allow” checkbox to enable file downloads when the control is read-only. Click the “Save” button.

- Create a new process definition named “dynamicSubworkflowDef” and open it in designer mode.
- Drag “updateVariable, updateGlobals, getFileAttachments, dynamicSubWorkflow” steps to the canvas.
- Connect the dots between the “Start” and other steps, as shown below.
- Select the line between the steps to configure the “Connection Properties”. The default property values are “None, True, False, Error, and Evaluate”. Depending on the step’s purpose, additional values are available for configuration.

- Click the “updateVariables” step to configure its “Optional” properties. Provide a variable reference and value as shown below. Select “Has Expression” as “Yes” if the variable value is an expression—for example, TODAY().

- Click the “updateGlobals” step to configure its “Optional” properties. Click the button to configure multiple globals and values. Click the Add Row (+) button to insert an empty row. Enter a global name and value as shown below. Add more rows to map additional global names and values. Click the Save button to confirm changes. Select “Has Expression” as Yes if the variable value is an expression such as TODAY(). Click the “Save” button.

- Click the “getFileAttachments” step to configure its “Required” properties. Provide a name for the step. Provide a variable or global reference to hold the form instance ID, the file attachment path, and the file attachment file name. Click the Save button. Note: Click the "AI Predict" button to have Copilot add new process steps that match your process description.

- Click the “getFileAttachments” step to configure its “Optional” properties. Select the form definition from the drop-down list. Click the button to map the file control ID from the form. Click the Add Row (+) button to insert an empty row. Select the appropriate File Control ID from the form. Click the Save button to confirm the changes. Select the File List format from the options (blank, XML, or JSON). Click the “Save” button.

- Click the “dynamicSubWorkflow” step to configure its “Required” properties. Select the process definition to use. Provide dynamic keys and variables for processing. Here, the count of file attachments is treated as a dynamic key-value pair, and a variable used to track iterations is treated as a dynamic key variable. Click the Save button. Note: Click the "AI Predict" button to have Copilot add new process steps that match your process description.

- Click the “dynamicSubWorkflow” step to configure its “Optional” properties. Select “Yes” to pass variables to the child instance. Select “Yes” to pass variables back to the parent instance. Select “Yes” to pass globals to the child instance. Select “Yes” to pass globals back to the parent instance. Select 'Yes' to synchronize workflow execution between parent and child instances. Selecting “No” makes the process executions mutually independent. Click the “Save” button.

- Click the button to map variables between parent and child instances. A configuration pop-up window appears. Click the Add Row (+) button to add an empty row. Provide the variable-to-value mapping below. Click the Save button. You can add multiple variable mappings using the Add Row button.

- Click the button to map the globals between parent and child instances. A configuration pop-up window appears. Click the Add Row (+) button to insert an empty row. Enter the global and value mapping as shown below. Click the Save button. You can add multiple global mappings using the Add Row button.

- Click the button to map variables between child and parent instances. A configuration pop-up window appears. Click the Add Row (+) button to insert an empty row. Provide the variable-to-value mapping below. Click the Save button. You can add multiple variable mappings by using the Add Row button. 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 globals between child and parent instances. A configuration pop-up appears. Click the Add Row (+) button to insert an empty row. Enter the global and value mappings as shown below. Click the Save button. You can add multiple child-to-parent global mappings by using the Add Row button. Note: Configurations for passing variables/globals from the parent workflow to the child and back at runtime are optional. You can map sub-process variables to parent process globals when you need to swap values between globals and variables.

- Create another process definition named “BooleanDef” for use by the “dynamicSubworkflow” step, and open the definition in designer mode.
- Drag the “updateVariables, updateGlobals, decision, and placeHolder” steps to the canvas.
- Connect the dots between the “Start” and other steps, as shown below.

- Click the “updateVariables” step to configure its “Optional” properties. Provide a variable reference and store a value as shown below. Select “Has Expression” as “Yes” if the variable value is an expression such as TODAY(). Click the Save button.

- Click the “updateGlobals” step to configure its “Optional” properties. Click the button to configure multiple globals and values. Click the Add Row (+) button to insert an empty row. Enter a global name and value as shown below. Add more rows to map additional global names and values. Click the Save button to confirm changes. Select “Has Expression” as “Yes” if the variable value is an expression such as TODAY(). Click the Save button.

- Click the “decision” step to configure its “Required” properties. Provide a name for the step and a condition to evaluate. Then click the Save button. Note: Click the "AI Predict" button to have Copilot add new process steps that match your process description.

- Let's instantiate a new process by executing the Form. To do this, navigate to the Form-Definition page. Select the Form definition “dynamicsubworkflowDef” above. Click the “View > Execute With Params” menu option.

- On the “Configure Execute Params” page, the Form definition is already selected. Next, select the process definition from the drop-down list. Use the buttons to specify whether to store the form instance ID in variables, globals, or form variables. Select the language for rendering the Form from the drop-down list. Select the checkbox and choose the user from the drop-down list for test mode execution.

- A Form Instance is created and rendered in a new tab. In this example, three files are attached from the local system folders. Click the “Submit” button to continue.

- The dynamic subprocess step executes the sub-workflow once for each file attachment on the form. In this example, the sub-workflow is executed three times. 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.

The child process instance stores the parent process instance's ID as a variable. The parent process instance ID is specified in the URL below.

The child process instance tags the parent process instance as a variable, shown in red below. Note: This behavior is cyclic in that, at any subworkflow level, the parent instance ID is tagged and available.

Tips:
- Select the correct child Process Definition in Definition to use.
- Treat Dynamic keys to process and Dynamic key variable as required configuration.
- Make sure the child Process Definition contains the variable expected by the Dynamic key variable configuration.
- Use parent-to-child variable mappings when the child requires specific parent values.
- Use parent-to-child global mappings when the child requires specific parent globals.
- Use child-to-parent mappings when results from child processing must be made available to the parent.
- Use Is synchronized deliberately when the parent workflow depends on the child workflow execution.
- Use meaningful dynamic-key and child-variable names to make the workflow easier to maintain.
- Test dynamic-key processing with representative data before deploying the workflow.
- Do not assume a particular delimiter or dynamic-key syntax from the XML definition; use the syntax supported by the FlowWright configuration/runtime.
- Use the True and False paths to provide appropriate downstream routing.
- Keep the child Process Definition focused on the functionality that needs to be repeated or dynamically invoked.
Notes:
- The Dynamic Subworkflow step belongs to the Dynamic category.
- The display name is Dynamic Subworkflow.
- The step name is
dynamicsubworkflow. - The namespace is
FlowWright.Workflow.DynamicSubWorkflow. - The step is implemented in
FlowWright.Workflow.dll. - The step is defined as a Process step.
- The step has two input connections and two output connections.
- Definition to use is required.
- Dynamic keys to process are required.
- A dynamic key variable is required.
-
Is synchronized has a default value of
yes. - Parent-to-child and child-to-parent variable/global mappings are supported.
- The step provides True and False return values.
- The XML does not specify the exact syntax for the dynamic key list.
- The XML does not document the exact runtime algorithm used to dynamically build the process.
- The XML does not specify detailed behavior for failure, timeouts, retries, cancellations, or child-instance lifecycles.
- Such runtime behavior should be verified against the FlowWright implementation or applicable product documentation rather than inferred from the step definition.
Recommended Workflow Pattern:
A useful pattern for Dynamic Subworkflow is to have the parent workflow identify and prepare the work, while the child Process Definition performs processing for each dynamic key.

This pattern separates the logic that identifies the work from the logic that processes each dynamic key.
Dynamic Subworkflow vs. Sub-Workflow:
The Dynamic Subworkflow shares many parent/child workflow capabilities with the standard Sub-Workflow step, including variable/global pass-through and mappings. The significant distinction visible in the XML is the addition of Dynamic keys to process and a Dynamic key variable.
| Capability | Sub-Workflow | Dynamic Subworkflow |
|---|---|---|
| Select child Process Definition | Yes | Yes |
| Pass variables to child | Yes | Yes |
| Pass variables back | Yes | Yes |
| Pass globals to child | Yes | Yes |
| Pass globals back | Yes | Yes |
| Parent-to-child mappings | Yes | Yes |
| Child-to-parent mappings | Yes | Yes |
| Synchronization | Yes | Yes |
| Dynamic keys | No | Yes |
| Dynamic key variable | No | Yes |
| Execution priority property | Yes | No |
Definition Sample:
You may download and extract the sample definitions from the provided link, then import them into your FlowWright Process Definition XML page.
The Dynamic Subworkflow definition includes the selected child Process Definition, dynamic-key configuration, parent/child variable and global data exchange, and synchronization configuration.
Note: Verify and complete the configuration after importing the sample, including:
- Definition to use
- Dynamic keys to process
- Dynamic key variable
- Pass variables to child instance
- Pass variables back to parent
- Pass globals to child instance
- Pass globals back to parent
- Is synchronized
- Parent-to-child variable mappings
- Parent-to-child global mappings
- Child-to-parent variable mappings
- Child-to-parent global mappings
- Workflow-specific connections
After verifying the configuration, save the Process Definition before execution.
Click here to download the sample files.