Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Subflow entry
How-to guide

Build a flow as a subflow and wire it into a parent

Building a subflow means designing the called flow as a reusable component first, then wiring it into the parent. The steps below cover both halves of the work.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 26, 2026

Building a subflow means designing the called flow as a reusable component first, then wiring it into the parent. The steps below cover both halves of the work.

  1. Design the called flow as a component

    Identify the reusable unit, like a validation, a notification pattern, or a record-prep step. Build it as a standalone Autolaunched or Screen flow. Keep its scope narrow so it stays reusable.

  2. Define input variables for what the subflow needs

    On the called flow's Manager tab, create variables and mark them Available for input. Use clear names like recordId, sendEmail, contactList. Default values help when the parent does not assign every input.

  3. Define output variables for what the parent expects back

    Create variables and mark them Available for output. Common outputs are isValid (boolean), errorMessage (string), createdRecordIds (collection of IDs the subflow inserted).

  4. Activate the called flow

    A subflow only runs if it has an Active version. Activate the called flow before calling it from the parent, or the Subflow element shows an error at design time.

  5. Add a Subflow element in the parent flow

    Drag a Subflow element into the parent. Pick the called flow by name. Assign input values from the parent's resources (variables, formulas, $Record). Pick which output variables the parent should store.

  6. Add a Fault path on the Subflow element

    Drag the Fault path from the Subflow element to a handler: log to a custom object, set an error message, send an email alert. Without a Fault path, a faulting subflow takes the whole parent down.

Key options
Inputsremember

Variables the subflow accepts. Must be marked Available for input on the called flow before the parent can assign them.

Outputsremember

Variables the subflow returns. Must be marked Available for output on the called flow before the parent can capture them.

Fault pathremember

Optional path from the Subflow element that catches faults the subflow does not catch itself. Recommended on every Subflow element in production flows.

Gotchas
  • Subflows always run the Active version of the called flow. There is no version pinning. Activating a new version of a subflow changes behaviour for every parent that calls it.
  • Subflows share the parent's governor limits. A subflow with hidden SOQL inside a loop in the parent will multiply the parent's query count and hit the 100-SOQL limit fast.
  • You cannot call a Screen flow from a Record-Triggered flow because there is no UI context. Use an Autolaunched subflow with output variables instead, and have the parent Screen flow render the result.

See the full Subflow entry

Subflow includes the definition, worked example, deep dive, related terms, and a quiz.