Start a Subworkflow and Control Parent Continuation¶
Goal¶
Start one child instance per selected row and choose explicitly whether the parent continues immediately or waits for the child instances to finish and synchronize their results.
What You Will Learn¶
- bind subworkflow creation to repeating XML rows
- choose between continue and wait modes
- correlate and synchronize child results with stable row IDs
Difficulty and Estimated Time¶
- Difficulty: Advanced
- Estimated time: 25 minutes
Assumed Knowledge¶
You should understand pools, module tasks, repeating XML rows, and parent/child process data.
Required Reading¶
Prerequisites¶
- permission to import a definition containing two pools
- one or more test rows under
Items/Item, each with a stableId
Example Overview¶
The parent pool contains a subworkflow module and a completion task. The child pool contains one task that updates the row passed by its parent.
Steps¶
Bind Child Instances to Rows¶
Configure the subworkflow module with:
1 2 3 4 5 6 | |
RowIdXPath provides stable correlation. Do not use row position because insertion or deletion can change it.
Choose the Parent Behavior¶
CreateInstancesAndContinuestarts the children and lets the parent route onward immediately.WaitForAllChildsToCompletepauses the module until every child finishes.SynchronizeChildInstancesAndContinueis useful when the parent should continue while later synchronization remains part of the design.
The downloadable example uses WaitForAllChildsToComplete so the final parent task can verify synchronized status.
How It Works¶
The module selects source rows, starts a child for each matching row, and correlates results by Id. Waiting controls workflow timing; synchronization controls how child data returns. They are separate design decisions.
Verify the Result¶
- Import the definition and add two rows with different IDs.
- Start the subworkflow action and confirm that two child tasks are created.
- Complete one child and confirm that the parent still waits.
- Complete the second child and confirm that the parent advances with both row statuses synchronized.
- In a copy, switch to
CreateInstancesAndContinueand confirm that the parent advances immediately.
Failure and Edge Cases¶
- Duplicate or empty row IDs must be rejected before child creation.
- Decide how the parent handles a cancelled or failed child instead of waiting indefinitely.
- Do not allow deleted rows to start new children.
Security and Portability Notes¶
- Both pools execute in the current tenant; configure child-task roles after import.
- Pass only data the child requires and re-check authorization for child-side actions.
- Keep stable correlation IDs and define retry behavior before allowing the module to run twice.
Download and Try It Yourself¶
Download the parent/child workflow definition.
Troubleshooting¶
- No child is created: Check the row XPath, condition, target pool, and target task.
- Results update the wrong row: Confirm every row has a unique stable
Idand the same synchronization path. - Parent never advances: Confirm every child reached a terminal state and review the selected mode.