20

ServiceNow: Creating Flows and Subflows in Flow Designer

In the last chapter, we discussed the architecture of ServiceNow Flow Designer. It is time we understand how Subflows make our tasks easier and how to create flows in ServiceNow. 

What are ServiceNow SubFlows?

ServiceNow Subflows are reusable sequences of actions that can be integrated into multiple flows when you need them. These are important when reusing code, breaking complex flows into manageable chunks, encapsulating functionalities, and improving performance.

ServiceNow subflow

How to create a Flow in ServiceNow? 

Creating ServiceNow flows can be done in two ways: either using Now Assist or building a flow from Scratch. We will discuss how to make a flow from scratch. 

Step 1: Navigate to All, click Process Automation, and select Workflow Studio. 

Step 2: At the Workflow Studio home page, select New, then Flow.

Step 3: Select “Build from scratch.” (You will also see another option to build a flow using Now Assist.)

Step 4: A Flow properties screen will pop up. Fill in the fields such as: 

  • Flow name
  • Description
  • Application
  • Domain
  • Protection
  • Run As / Run with Roles
  • Flow Priority Default

Step 5: Select Submit. 

Step 6: Add a trigger to the flow. You can create a trigger or use a saved trigger. 

Step 7: Once your trigger is added (either a newly created or saved trigger), add actions, flows, subflows, and flow logic. You can drag and reorder actions in the flow. 

Step 8: Final step: save your Flow after completing the mentioned fields.

How to create a subflow in ServiceNow?

To create ServiceNow Flow Designer subflows, there are a few simple steps that you need to follow: 

Step 1: Navigate to All → Process Automation → Workflow Studio → Select New → Subflow.

Step 2: The Subflow properties screen displays the necessary details to be filled/ 

Step 3: Add a proper name to the subflow, description, and select the Application scope. 

Step 4: In the Inputs tab, add the data the subflow needs to receive when called. Mark required inputs and set default values if needed.

Step 5: Add actions, flow logic (If/Else, For Each), or other subflows. Use the inputs you defined to drive this logic.

Step 6: In the Outputs tab, specify what data the subflow should return to whatever calls it. 

Step 7: Save your work, then mark the subflow as ‘Active’ so it becomes available for use. Inactive subflows can’t be called by other flows.

Step 8: In any other flow, add an action step and search for your subflow by name under the ‘Subflows’ category that will appear alongside standard actions.

How to create workflow in ServiceNow?

If you’re starting with ServiceNow Workflows, creating them can look confusing. To avoid confusion, below are the steps to create a workflow. 

Step 1:  Navigate to All, click on Workflow, then open Workflow Editor. The Welcome tab of the Workflow Editor opens.

Step 2: On the Workflows tab in the palette, click New Workflow.

Step 3: Fill in the Name and Table fields on the pop-up display. Also, you can add a Description if needed.

Step 4: Click Submit. The new workflow is created with the Begin and End Activities connected by a single transition.

Step 5: Finish creating the workflow by adding activities, validating it, and publishing it so it is available to other users.

Step 6: If you make changes, click Update.

How to delete workflow in ServiceNow?

Sometimes a workflow is created by mistake or becomes irrelevant over time. However, if it is essential to delete a workflow, the process is simple. 

Step 1: Navigate to Workflows 

Step 2: In Workflow versions, select the workflow you want to delete. 

Step 3: Click on the delete button. 

Remember that it is better to make your workflows inactive rather than delete them. If a workflow is deleted, it removes all historical data along with the old records.  

Conclusion

ServiceNow Workflows are designed to help automate complex processes across the platform. Along with that, subflows are used to integrate multiple flows. There are different ways to create flows and subflows and delete them when needed. 

As professionals, it is important to know these steps and work alongside the process to know when to create and delete a subflow or a flow in ServiceNow. In the next chapter, we will be focusing on the update sets and how to maintain them.

Book Free15-Minutes Career Counselling