Subflows in Flow Designer: How to Build Reusable Automation Blocks

Subflows are reusable automation blocks you call from parent flows. They work like functions — you pass inputs in, they execute a sequence of steps, and they can return outputs. Building subflows well is how you avoid duplicating automation logic across dozens of flows.

When to create a subflow

Create a subflow when the same sequence of steps appears in more than one flow, or when a sequence is logically self-contained enough to test independently. Good candidates: sending a notification, looking up a manager chain, creating a standard task.

Creating a subflow

  1. Go to Flow Designer → New → Subflow
  2. Name it clearly (verb + noun: "Send Approval Notification", "Get Manager Chain")
  3. Add Input Variables — these are the parameters the subflow receives
  4. Add Output Variables — the values the subflow returns to the caller
  5. Build the steps

Input and output variables

Input variables are required parameters the calling flow must provide. Output variables are values the subflow sets during execution that the calling flow can read afterward.

Example subflow: "Create Approval Task"

  • Inputs: record_sys_id (Reference: Task), approver (Reference: User), due_date (Date/Time)
  • Outputs: task_sys_id (String), task_number (String)

Calling a subflow from a flow

In the parent flow, add an Action step → Flow Logic → Run Subflow. Select your subflow and map the input variables using data pills from the parent flow context.

After the subflow runs, its output variables appear as data pills in the parent flow:

Trigger record → Run Subflow "Create Approval Task"
  → assign inputs from trigger data pills
  → use output: task_sys_id → in next step Update Record

Error handling in subflows

Subflows should handle their own errors where possible. Add Try steps around risky operations (REST calls, lookups that might return no results). If an error escapes the subflow, it surfaces in the calling flow.

Testing subflows independently

Subflows can be tested independently using the Test button in Flow Designer. Provide test values for all input variables and verify the outputs are correct before integrating into a parent flow.

Versioning considerations

When you modify a subflow, existing active flows continue using the version they were built with until you explicitly update them to use the new version. This prevents breaking changes from propagating automatically.

Want the complete reference?

This article is part of the NowSpectrum knowledge library. Browse all products for cheat sheets, interview prep, and deep-dive reference guides.

Browse All Products →