---
sourceDocument: Xanadu ServiceNow AI Platform Capabilities
sourceDocumentLink: https://www.servicenow.com/docs/r/xanadu/servicenow-platform

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# Workflows used as subflows

# Workflows used as subflows {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

A workflow can launch another workflow as an activity.
The parent workflow triggers the subflow and then waits for the subflow to complete before
continuing. Run the workflow validation tool prior to publishing to detect missing subflows
and other dependency problems, such as those involving update sets.

The Workflows tab in the Workflow Editor contains a list of the
workflows available for use as subflows.  
Figure 1. Workflows available to use as subflows

Make sure that the selected subflow is active. If the subflow is inactive, the main
workflow will hang with a Loading message. If you place an inactive
subflow into a workflow, the subflow appears with a red banner, indicating that it cannot
run. An active subflow is highlighted in blue when selected.  
Figure 2. Workflow with active subflows

## Subflows and the Create Task activity

If a workflow contains a [Create Task](https://www.servicenow.com/docs/FebjwN6AWRrMAIWgjTzjiA "The Create Task activity generates a record on any of the tables that extend Task [task].") activity that has executed on the current record, additional
task activities in the workflow might not execute as expected.  
This can happen when the same subflow containing a Create Task activity runs more than once in a parent flow. When the subflow reruns and attempts to execute the Create Task activity again, the system reopens the first task activity instead and does not create an additional task.  
Note:  
An alternative to creating duplicate subflows that use the Create Task activity is to add a [Run Script](https://www.servicenow.com/docs/dlNV6SqJUOw0kkFeBfny7A "The Run Script activity runs the specified script in the scope of the workflow version.") activity to the workflow that creates a task with a script.  
Figure 3. The same create task activity runs twice in a workflow  
In this configuration, the workflow does not run the same subflow containing a Create Task activity more than once. This allows the workflow to create additional tasks.Figure 4. Running different subflows containing the Create Task activity
* **[Pass a variable from a workflow to a subflow](https://www.servicenow.com/docs/YdjLMvNL6eltDl9OHhBMpg#t_VariableWorkflowSubflow)**   
  Use this process to pass variables from a parent workflow to a subflow.
* **[Prepare a subflow](https://www.servicenow.com/docs/XfkV~2S5cw1K7XiH_U3wdQ#t_PrepareASubflow)**   
  Review the process of preparing a subflow for use in a parent workflow, and for preparing the parent workflow to use a subflow.

