# When to use a Subflow?

**URL:** <https://forum.gumloop.com/t/when-to-use-a-subflow/2119>\
**Category:** General Question\
**Tags:** General\
**Created:** [March 25, 2025, 5:24am UTC](https://forum.gumloop.com/t/when-to-use-a-subflow/2119 "2025-03-25T05:24:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stvngunn](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@stvngunn](https://forum.gumloop.com/u/stvngunn)\
**Post date:** [March 25, 2025, 5:24am UTC](https://forum.gumloop.com/t/when-to-use-a-subflow/2119/1 "2025-03-25T05:24:23Z")

</div>

Hey everyone, this might be a stupid question, but when is it best to use a subflow? I’m new to Gumloop and haven’t used one yet, but was wondering when you know to add one to a flow. Thank you.

---

<div class="post-metadata">

**Author:** ![Gumloop\_Bot](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.gumloop.com/gumloop_bot/32/504_2.png) [@Gumloop\_Bot](https://forum.gumloop.com/u/Gumloop_Bot)\
**Post date:** [March 25, 2025, 5:24am UTC](https://forum.gumloop.com/t/when-to-use-a-subflow/2119/2 "2025-03-25T05:24:26Z")

</div>

Hey @stvngunn! If you’re reporting an issue with a flow or an error in a run, please include the **run link** and make sure it’s **shareable** so we can take a look.

1. **Find your run link** on the history page. Format: `https://www.gumloop.com/pipeline?run_id={your_run_id}&workbook_id={workbook_id}`

2. **Make it shareable** by clicking **“Share”** → ‘Anyone with the link can view’ in the top-left corner of the flow screen.  
 ![GIF guide](https://canada1.discourse-cdn.com/flex027/uploads/gumloop/original/1X/92c00c612fd65b861e706dd1b5eec5ec61677835.gif)

3. **Provide details** about the issue—more context helps us troubleshoot faster.

You can find your run history here: [https://www.gumloop.com/history](https://www.gumloop.com/history)

---

<div class="post-metadata">

**Author:** ![Wasay-Gumloop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.gumloop.com/wasay-gumloop/32/69_2.png) [@Wasay-Gumloop](https://forum.gumloop.com/u/Wasay-Gumloop)\
**Post date:** [March 25, 2025, 7:49pm UTC](https://forum.gumloop.com/t/when-to-use-a-subflow/2119/3 "2025-03-25T19:49:52Z")

</div>

Hey @stvngunn - this is a great question! Subflows are one of Gumloop’s most powerful features, and knowing when to use them can really level up your workflow building.

**When to Use Subflows**

There are three main situations where subflows really shine:

**1. When Your Flow Gets Too Complex**  
If your canvas is getting crowded with many nodes that serve a specific purpose, consider grouping them into a subflow. This keeps your main flow clean and easier to understand—similar to how functions help organize code.  
For example, if you have 10+ nodes just to process website data, moving that logic into a subflow labeled “Process Website” keeps your main flow much more readable.

**2. For Repetitive Operations (Looping)**  
Subflows are perfect when you need to perform the same set of operations on multiple items. Build a subflow that handles a single item perfectly, then use it in Loop Mode to process many.  
Say you’re analyzing 100 company websites—create a subflow that processes one website, then loop it over your URL list.  
Bonus: you can wrap the subflow in an error shield, so if anything fails during the loop, it’ll safely skip that item and keep going.

**3. For Multi-level Processing (Nested Loops)**  
When working with nested data structures (like reports \> orders \> line items), subflows let you build multi-layered automation:

- One flow processes the full report
- A nested subflow handles each order
- A third-level subflow processes each line item

It works just like nested for-loops in programming.

You can check out a [video tutorial here](https://docs.gumloop.com/core-concepts/subflows).

And if you’re looking for inspiration, I’d recommend browsing the [template library](https://www.gumloop.com/templates) to see how other flows are structured.

---

<div class="post-metadata">

**Author:** ![stvngunn](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@stvngunn](https://forum.gumloop.com/u/stvngunn)\
**Post date:** [March 26, 2025, 3:43am UTC](https://forum.gumloop.com/t/when-to-use-a-subflow/2119/4 "2025-03-26T03:43:08Z")

</div>

Thank you for the detailed response @Wasay-Gumloop, much appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/gumloop/original/1X/d02ff8efcde6ac5d3ac8aa0376137d5f804da549.png) [@system](https://forum.gumloop.com/u/system)\
**Post date:** [March 26, 2025, 4:43am UTC](https://forum.gumloop.com/t/when-to-use-a-subflow/2119/5 "2025-03-26T04:43:41Z")

</div>

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Wasay-Gumloop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.gumloop.com/wasay-gumloop/32/69_2.png) [@Wasay-Gumloop](https://forum.gumloop.com/u/Wasay-Gumloop)\
**Post date:** [March 26, 2025, 6:43pm UTC](https://forum.gumloop.com/t/when-to-use-a-subflow/2119/6 "2025-03-26T18:43:17Z")

</div>

No problem! 🙂
