Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.

Create a subflow

Log in to subscribe to topics and get notified when content changes.

Create a subflow

Create a reusable sequence of actions that can be added to multiple flows.

Before you begin

About this task

Flow designers should know the application table structure and be aware of any existing business logic associated with the target tables of a flow or subflow. Be sure to disable any conflicting business rules or workflows before creating a flow or subflow.

Creating a custom application to contain your Flow Designer content allows you to deploy it using the application repository or the ServiceNow Store.

Procedure

  1. Navigate to Flow Designer > Designer.
  2. Click + New > New Subflow.
    The Subflow properties dialog displays.
  3. Fill in the following properties:
    Field Description
    Name Name of the subflow.
    Application Application scope to create the subflow in.
    Category Logical group for subflow.
    Protection Select whether the subflow is read-only. You can only select a value when you create the subflow in an application scope you own. The default value is None.
    In-Flow Annotation Help text that appears under the subflow title in Flow Designer to help flow designers understand what the subflow does when used in a flow.
    Description Description of the subflow.
  4. Create subflow inputs to specify the data available to the subflow when it starts.
    Each input you define for a subflow becomes a configuration option in the Flow Designer interface. To use the subflow in a flow, flow designers must define a value for each mandatory input. The more inputs a subflow has, the more data flow designers must define and the more familiar they must be with the underlying data model to use the subflow effectively.
    1. Click + to open the Inputs & Outputs pane.
    2. Click + to add a new input.
    3. Define the name and type for the input.
    4. To make the input a mandatory configuration option, select the Mandatory flag.
    5. Click Open icon to view the advanced options and define values.
      Inputs provide advanced options based on their data type. All inputs have advanced options to add a hint or provide a default value. Use advanced options to guide flow designers through adding and configuring a subflow to a flow. For example, create a choice input to provide flow designers with a pre-defined list of configuration options to choose from. For more information about the configuration options available to particular data types, see field types.
  5. Create subflow outputs by defining the names and data types.
    Subflow outputs specify the data available to the parent flow after the subflow completes.
    1. Click + to add a new output.
    2. Define the name and the data type.
      Output values are assigned in later steps.
    Inputs and outputs in a subflow.
  6. Add actions, flows, subflows, or flow logic.
    1. Under Actions, click + and select an option.
      Option Description
      Action

      Select the desired action. Flow Designer includes a set of Actions available to flows and subflows. Alternatively, an action designer can create additional actions to add to flows. The IntegrationHub and spoke plugins install additional actions.

      To add draft actions, set Show draft actions to true from the More Actions menu.

      Flow Logic Select an option to specify conditional or repeated operations.
      Subflow Select a published subflow and define input values. In addition to adding a subflow as a flow action, you can enable the Show triggered flows option from the More Actions menu to select an activated flow and define the required inputs. Running a triggered flow ignores its trigger conditions and runs all actions.

      To change the order of an action in a flow, drag-and-drop the handle on the left side of the action.

      The system displays a set of fields depending on the option selected.
    2. Fill in the fields to configure the action, flow, or subflow.
    3. Click Done.
    4. Repeat adding actions until complete.
  7. Assign subflow outputs to a value.
    You can assign a subflow output to multiple values, enabling you to create conditional outputs based on flow logic.
    1. Under Actions, click + and select Flow Logic.
    2. Click Assign Subflow Outputs.
    3. In the Name field, select an output you created in the Inputs & Outputs section. You can only assign values to outputs that have already been given a name and data type.
    4. In the Data field, enter a value or select a data pill from the data panel.
    5. Click Done.
    Assign subflow outputs in a subflow.

What to do next

Test the subflow, and publish it when it is ready to be added to a flow or called from a script.
Feedback