Skip to main content
Subflows allow you to use any flow as a reusable node within other flows. This modular approach is one of Gumloop’s most powerful features, enabling you to build complex automations from smaller, well-tested components.

Why Use Subflows?

Cleanliness

Break complex logic into manageable pieces. Like functions in programming, subflows make large automations easier to maintain and debug.

Looping

Perfect a single task once, then loop it across thousands of items. Build and test on one instance, then scale effortlessly.

Nested Processing

Handle multi-level data structures with ease. Process emails containing orders, each with multiple items, using nested subflows.

Example: Web Scraping at Scale

You want to scrape contact information from thousands of company websites. With subflows, you build one flow that perfectly handles a single website, then loop it across your entire list. This approach makes testing simple and scaling automatic.

Example: Nested Data Processing

Process an email inbox containing orders, where each order has multiple items. Using three nested subflows, you can:
  1. First flow: Process the entire inbox and extract orders
  2. Second flow (looped): Process each individual order
  3. Third flow (looped): Process each item within an order
This creates a triple-nested loop structure, allowing operations at each level of your data hierarchy.
Build Flows Backwards Using SubflowsWhen working with lists or batch processing, start by building a subflow that handles a single item perfectly:
  1. Create a subflow with input nodes and default test values
  2. Perfect the logic for one item at a time
  3. Once working, use it as a node in your main flow
  4. Connect your data source and enable Loop Mode
This approach provides parallel processing, faster execution, easier testing, better error handling, and prevents type structure issues.

Working with Subflows

Adding Subflows to Your Canvas

In the flow builder, locate the Subflow Library in the node menu. All of your existing flows appear here and can be dragged onto the canvas like any standard node.
Subflow Library

Configuring Inputs and Outputs

Subflows need defined inputs and outputs to be useful in other flows. Here’s how to set them up:

Step 1: Initial Subflow Without Inputs

Consider this example flow that scrapes a website, extracts the company name, summarizes it, and categorizes the business:
Example Subflow
When you first add this flow as a subflow node, it has no connection points:
Subflow Node Without Inputs

Step 2: Adding Input Nodes

Return to the subflow and add an Input node for each parameter you want to accept. For this example, we need one input for the website URL:
Subflow With Input Node
You can name your input nodes for clarity, though this is optional. The name will appear as the connection label in the parent flow.
After saving, the subflow node now displays the URL input:
Subflow Node With Input

Step 3: Adding Output Nodes

Add Output nodes for each value you want to return. In this example, we want to output the summary, company name, and category separately:
Completed Subflow
The completed subflow node now has both inputs and outputs:
Completed Subflow Node