Setting Up a Sub-workflow Group
A sub-workflow group is set up in the workflow builder, on the parent template. Users who hold Create Workflow Templates or Edit Workflow Templates add a Sub Workflow Node in Group mode, say which child workflows it starts, and add a Collect Sub-workflow Results step that waits for them. For what a group does when it runs, see Sub-workflow Groups.
Before you start
Each child workflow is an ordinary workflow template. Check it before a group uses it:
- It ends with a Complete Workflow step. A group child finishes only there. The builder does not save a parent whose group uses a workflow without one. See A child workflow without a Complete Workflow step.
- It has an Output Node where the parent needs a label. A Collect step's label conditions, and a group that counts only some labels, read the label an Output Node recorded. Put the Output Node and the Complete Workflow step on the same reply.
The group's settings
Configure group on the Sub Workflow node opens Sub Workflow group. Its first part, Group settings, applies to every child the step starts.

Sub Workflow group
| Setting | Description |
|---|---|
| Deadline (hours) | Children still running this many hours after the group starts are timed out. Leave it blank for no deadline. |
| When a child fails | Fail the parent (the default) or Continue the parent. Cancelling the parent always cancels its open children. |
| A child counts when | It completes, or It ends with one of these labels. Only an Output Node records a label, so with labels, each child workflow needs one. |
The card's summary follows these settings: Deadline shows the hours, and When a child fails shows the choice.
Spawn entries
The second part, Spawn entries, lists the entries. Each entry starts its own children. A new step has one entry. Add entry adds another, and the remove icon on an entry removes it with everything set on it.
| Setting | Description |
|---|---|
| Name | Names the entry. It is shown on the entry, in the Inbox, and in the start dialog when the initiator chooses its workflow. |
| Only when | Ticked, the entry is used only when the parent's document meets the conditions set on the entry. |
| Start | How many children the entry starts. See How many children. |
| Each child works on | The document each child runs on. See Child document. |
| Which workflow | How the child's workflow is chosen. See Choosing the child workflow. |
| Let the initiator choose the workflow | The person who starts the parent chooses the child's workflow. See Letting the initiator choose. |
| When nothing matches | What happens when no workflow is chosen, for example Start no child. |
| When a workflow is inactive | What happens when the chosen workflow is disabled, for example Try the next option. |
| Subject Template (under Each child) | Each child's subject. It can read the parent's document fields, and the grid row or attachment the child is for. |
| Visibility (under Each child) | Visible or Hidden. A hidden child never appears on anyone's lists, so it should not wait for a person. |
| Add input (under Each child) | The values each child starts with. Each value is a template over the parent's document. |
How many children
| Start | Children started |
|---|---|
| One child | One. |
| One per grid row | One for each row of a grid on the parent's document. Only some rows starts one only for the rows that meet the conditions. |
| One per attachment | One for each attachment of the parent's document. |
| One per document in the transmittal | One for each document listed in the parent's transmittal. |
Child document
| Each child works on | Description |
|---|---|
| The parent's document | Every child runs on the parent's own document. The entry says that isolation between children cannot be guaranteed. |
| A new document | Each child gets a new document, with the Document type, Title and Custom field values set here. The title and the values are templates over the parent's document. File the new document in is No folder or The workflow private folder, which System Config sets. See System Config. |
| Its attachment | With One per attachment: each child runs on its attachment. |
| Its listed document | With One per document in the transmittal: each child runs on its listed document. |
Choosing the child workflow
Which workflow has four choices.
| Choice | The child runs |
|---|---|
| Always the same | The Workflow Template chosen. |
| Chosen by rules | The workflow of the first rule the parent's document matches, or the one under Otherwise. |
| Named in a field | The workflow named in a field of the document, or in a start input of the parent workflow. |
| Best match for the document | The workflow from a list or a workflow group that best fits the document's project and document type. |
Chosen by rules
Each rule has conditions under Use this rule when, and the Workflow Template it runs. + Add Rule adds a rule; add at least one. Otherwise is the workflow started when no rule matches.

Chosen by rules
Test on a rule opens Test rules. Enter a Document reference number and select Run test. Each rule shows whether it matched, for example Matched, and the result names the workflow the child would run: "The child would run "SWG EN Check for Report"." Nothing is started.

Test rules
Best match for the document
Pick from is A workflow group, or Chosen workflows listed under Workflows to pick from. The document's project says where the document's project is read from, for example Its project, else its legacy project field.

Best match for the document
Each child runs the workflow that best fits the parent's document: one for its project and document type first, then one for its project, then one for its document type, then one for neither. Of two equally good matches, the one listed first runs.
Test opens Test template selection. Enter a document's reference number and select Run test. It shows the document's project and document type, and lists the Ranked workflows: the one that Runs, any other that fits but ranks lower (Match), and why another was passed over, such as Another document type. Nothing is started.

Test template selection
Letting the initiator choose
Tick Let the initiator choose the workflow, and list the Allowed workflows. The choice is Asked when the workflow starts: the start dialog has a field named after the entry, and the person who starts the workflow chooses one of the allowed workflows. Only the allowed workflows can be chosen. Left empty, the choice above decides.

Let the initiator choose the workflow
For the start dialog, see Testing and Launching Workflows.
Collecting the results
Add Collect on the Sub Workflow node adds a Collect Sub-workflow Results step joined to Spawned, and is not shown once the group has one. The parent waits at the Collect step until the children have ended. Configure on the step opens its settings.

Collect Sub-workflow Results settings
| Setting | Description |
|---|---|
| Outcome routes | Add route adds a route. Each route has a condition (When), the value the condition needs, such as a Label, and an Output name, which becomes an output of the step. The names end, start and none_completed are reserved. |
| A child counts when (under Which children count) | The group's rule (the default), It completes, or It ends with one of these labels. |
| Collect every kind of document | Ticked (the default), the step collects every kind of document. Unticked, it collects only the Kinds of document to collect, which start as New documents and Attachments. |
| Result fields | Fields read from each child's document, by key or dotted path, for example po.total. |
A route's condition can be:
- Any child has the label or Every child has the label: the labels the children's Output Node steps recorded.
- Any child failed, Any child timed out or Any child was cancelled.
- Fewer children completed than: a number.

Collect Sub-workflow Results step with a route
The parent continues down the first route whose condition matches. With no match, it continues down Done. When no child counts, it continues down None completed. For the node's reference, see Collect Sub-workflow Results Node.
To file or attach the documents the children made, add an Attach Documents step after the Collect step. See Attach Documents.
A child workflow without a Complete Workflow step
A group child finishes only at a Complete Workflow step. When an entry runs a workflow that has none, the entry says so, and Save Workflow is disabled. Its tooltip names the workflow and the step, for example: "Cannot save: "SWG EN Check without Complete Workflow (child)", used by the Sub Workflow Node, has no "Complete Workflow" step. Choose another workflow or add the step to it."

A child workflow without a Complete Workflow step
Add a Complete Workflow step to that workflow, or choose another.
How to set up a sub-workflow group
| Step | Description |
|---|---|
| 1 | Open the parent template in the workflow builder, and drag a Sub Workflow Node onto the canvas. It starts in Group mode. |
| 2 | Select Configure group. Under Group settings, set the deadline, what happens when a child fails, and which children count. |
| 3 | Under Spawn entries, name the entry, choose how many children it starts, the document each works on, and the child workflow. Give the children a Subject Template. Add more entries if needed, then select Close. |
| 4 | Select Add Collect. A Collect Sub-workflow Results step is joined to Spawned. |
| 5 | Select Configure on the Collect step. Add an outcome route for each result the parent should act on, then close it. |
| 6 | Connect None spawned, Done, None completed and each route's output to the steps that follow, and save the template. |
Example: Setting up a sub-workflow group
Related configuration
- Sub-workflow Groups: what a group does when it runs
- Sub-workflow Groups: Troubleshooting and FAQ
- Flow Control Nodes: the Sub Workflow and Collect Sub-workflow Results nodes
- Attach Documents