Create a subflow

Create a subflow

What is a subflow? 

A subflow is a set of actions or logic that you can reuse across multiple flows. Imagine you have several workflows that follow the same set of actions or logic elements. Repeating those steps in every workflow can be time-consuming and inefficient. Instead of recreating the same set of steps in multiple flows, you can build them once in a subflow, then use that subflow as a simple drag-and-drop action wherever needed. This saves both time and effort.

Here are a couple of use cases:

Use case 1: Whenever a new lead is captured, you might want to verify whether the email address already exists in your CRM as a contact. Instead of duplicating this logic for leads coming in from different sources, you can create a subflow that handles this verification. The parent flow passes the lead's Email Address to the subflow, which checks for a matching contact and returns the result like 'Exists' or Doesn't exist'. Based on this output, the parent flow can decide whether to update the existing contact or create a new one.
Use case 2: You run an online store where each confirmed order requires sending an invoice email to the customer. This step involves fetching customer details by matching the contact number and sending an email. Instead of manually repeating this process, you can create a subflow that automatically fetches customer details and sends the invoice email. Whenever a new order is placed, the parent flow can call this subflow (by simply passing the customer contact number) to handle the task.
This set of actions needs to be repeated in other flows as well, for order returns and other scenarios where there's a need to generate and send an invoice to a customer. Creating a reusable subflow not only avoids duplication, but also ensures consistency and easier maintenance across various use cases.

Components of a subflow

A subflow receives input data from a parent flow (the flow that calls the subflow), and can be configured to return output back to the parent flow.
Each subflow consists of:
  1. Subflow trigger: You can define the input parameters received from the parent flow and the output parameters to be sent back.
  2. Actions: Similar to a regular flow, a subflow can include one or more actions, decision blocks, and logic elements.
  3. Return data(Optional): If you've configured your parent flow to call a subflow and wait for its output, you need to return results back to the parent. Use this action to send the output, so it can be used in the subsequent steps of the parent flow.

Steps to build a subflow

Follow these steps to create and configure a subflow for reuse in other flows.

Configure a subflow

  1. On the MyFlows page, click Create Flow, enter a flow name, and click Create.
  2. Click Configure in the Subflow box.
  3. In the configuration window that appears, define the input parameters (the data/the fields this subflow needs from the parent flow) and output parameters (the data/the fields this subflow returns to the parent flow).



  4. Click the ➕ icon to add multiple parameters. You can use the ✖ icon to remove any unneeded parameters.
  5. Once you've added the required input and output parameters, click Done.

Add actions

You can add as many actions as required to the subflow. You can also add decision blocks or other logic elements to customize the subflow's behaviour.

The last component of a subflow is an optional Return data action. It collects data from all preceding actions and sends it to the parent flow. Add this action if you want to return output to the parent flow.
  1. In the Builder, navigate to Logic > Flow Control and select Return data.
  2. In the configuration window, choose the Subflow execution status that should be returned to the parent flow. All output fields defined in the subflow will be displayed here. You can either enter the values or map the values to be returned for each field based on whether the status is Success or Failure.

    For example, if the subflow defines five output variables, and the subflow returns all of them on Success and only one on Failure
    , then:
    • On Success: The five specified variables will return their respective values.

    • On Failure: The one specified variable will return its value, while the other four will return null.


    In short, all output variables declared in the subflow will appear in every Return data container,
    regardless of whether they are populated or return null.
    Example:
    • On Success: Return values of Status, Subflow Case, Provided Client Name, Created Client Name, and Date

    • On Failure: Only return the Status value



  3. Click Done.

Steps to call a subflow

To reuse the actions defined in a subflow, you can call it directly from the parent flow.
  1. In the Builder, navigate to Logic > Flow Control and drag and drop Call a subflow to attach your subflow to the required action in the parent flow.
  2. In the configuration window that appears, choose the Subflow you want to call from the parent flow.
  3. Select a value for the Subflow Execution Behavior based on whether the subsequent actions in the parent flow require the return value from the subflow.
      • Wait and continue: The parent flow calls the subflow and waits for it to finish and return a result.

      • Continue without waiting: The parent flow continues executing without waiting for the subflow to complete.

  4. You can either manually enter values for the input fields or map values from the Insert variable section in the right panel. These input fields are defined in the subflow and are required for the subflow to run as expected.



  5. Click Done.



Notes
The 'Call a subflow' action is not enabled in a subflow, and the 'Return data' action is not enabled in a parent flow.
If you select the Wait and continue option under Subflow Execution Behavior, ensure that you include a Return data action in your subflow. This is important because the parent flow will pause and wait for the subflow to finish before proceeding, and the Return data action is needed to send the result back from the subflow to the parent flow.


Info
  1. Make sure to switch on all subflows used by the parent flow before turning on the parent flow to avoid interruptions.
  2. You can't switch off a subflow if it's used in either a live or paused flow.
  3. If you've configured your parent flow to call a subflow and wait for its output, make sure to include a 'Return data' action in the subflow.
  4. When you restart or resume a parent flow, its associated subflows are also restarted or resumed. However, restarting or resuming a subflow alone does not affect the parent flow that uses it.
  5. When a subflow fails, resuming the parent flow after changing input values will restart the subflow instead of resuming it from the failed step. You can view the execution status from the History section.
  6. If you want to switch off a subflow that is currently switched on, you'll need to go back to the parent flow that uses it, delete the 'Call a Subflow' action, then switch off the subflow.


        Create. Review. Publish.

        Write, edit, collaborate on, and publish documents to different content management platforms.

        Get Started Now


          Access your files securely from anywhere

            Zoho CRM Training Programs

            Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

            Zoho CRM Training
              Redefine the way you work
              with Zoho Workplace

                Zoho DataPrep Personalized Demo

                If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

                Zoho CRM Training

                  Create, share, and deliver

                  beautiful slides from anywhere.

                  Get Started Now


                    Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                    BOOK A SESSION







                                Quick LinksWorkflow AutomationData Collection
                                Web FormsEnterpriseOnline Data Collection Tool
                                Embeddable FormsBankingBegin Data Collection
                                Interactive FormsWorkplaceData Collection App
                                CRM FormsCustomer ServiceAccessible Forms
                                Digital FormsMarketingForms for Small Business
                                HTML FormsEducationForms for Enterprise
                                Contact FormsE-commerceForms for any business
                                Lead Generation FormsHealthcareForms for Startups
                                Wordpress FormsCustomer onboardingForms for Small Business
                                No Code FormsConstructionRSVP tool for holidays
                                Free FormsTravelFeatures for Order Forms
                                Prefill FormsNon-Profit

                                Intake FormsLegal
                                Mobile App
                                Form DesignerHR
                                Mobile Forms
                                Card FormsFoodOffline Forms
                                Assign FormsPhotographyMobile Forms Features
                                Translate FormsReal EstateKiosk in Mobile Forms
                                Electronic Forms
                                Drag & drop form builder

                                Notification Emails for FormsAlternativesSecurity & Compliance
                                Holiday FormsGoogle Forms alternative GDPR
                                Form to PDFJotform alternativeHIPAA Forms
                                Email FormsFormstack alternativeEncrypted Forms

                                Wufoo alternativeSecure Forms

                                TypeformWCAG


                                    All-in-one knowledge management and training platform for your employees and customers.

                                              Create. Review. Publish.

                                              Write, edit, collaborate on, and publish documents to different content management platforms.

                                              Get Started Now





                                                                You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                    Manage your brands on social media


                                                                      • Desk Community Learning Series


                                                                      • Digest


                                                                      • Functions


                                                                      • Meetups


                                                                      • Kbase


                                                                      • Resources


                                                                      • Glossary


                                                                      • Desk Marketplace


                                                                      • MVP Corner


                                                                      • Word of the Day


                                                                      • Ask the Experts


                                                                        Zoho Sheet Resources

                                                                         

                                                                            Zoho Forms Resources


                                                                              Secure your business
                                                                              communication with Zoho Mail


                                                                              Mail on the move with
                                                                              Zoho Mail mobile application

                                                                                Stay on top of your schedule
                                                                                at all times


                                                                                Carry your calendar with you
                                                                                Anytime, anywhere




                                                                                      Zoho Sign Resources

                                                                                        Sign, Paperless!

                                                                                        Sign and send business documents on the go!

                                                                                        Get Started Now




                                                                                                Zoho TeamInbox Resources





                                                                                                          Zoho DataPrep Demo

                                                                                                          Get a personalized demo or POC

                                                                                                          REGISTER NOW


                                                                                                            Design. Discuss. Deliver.

                                                                                                            Create visually engaging stories with Zoho Show.

                                                                                                            Get Started Now








                                                                                                                                • Related Articles

                                                                                                                                • Create a flow with on-premise apps

                                                                                                                                  Create flows that have on-premise as well as cloud app triggers and actions. You can follow these generic steps to set up a flow with on-premise app trigger and actions: Create an on-prem agent in Zoho Flow. Install and run the on-prem agent in your ...
                                                                                                                                • Notion

                                                                                                                                  What is Notion? Notion is a customer support platform with customization features like themes, engagement graphics, and labels. You can automate greetings, get detailed reports, create tickets, and track visitors with ease. How to connect your Notion ...
                                                                                                                                • Outgoing webhooks

                                                                                                                                  While a webhook trigger allows you to start a flow based on data updates received from an application, Outgoing Webhooks enable you to send HTTP requests to external applications or services. Outgoing webhooks allow you to access any API through http ...
                                                                                                                                • Manage your flows

                                                                                                                                  Every time you log in to Zoho Flow, you will land on the My Flows page, where all of the flows in your organization will be available. You can perform multiple actions from here. Create flows To create a new flow: Click Create flow in the top-right ...
                                                                                                                                • Create a flow from scratch

                                                                                                                                  Create a flow from scratch Create and customize a flow from scratch to solve your automation needs. In the My Flows section, click Create Flow in the top-right corner. Alternatively, click the + button on the left panel. Enter the flow name and a ...
                                                                                                                                  Wherever you are is as good as
                                                                                                                                  your workplace

                                                                                                                                    Resources

                                                                                                                                    Videos

                                                                                                                                    Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                    eBooks

                                                                                                                                    Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                    Webinars

                                                                                                                                    Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                    CRM Tips

                                                                                                                                    Make the most of Zoho CRM with these useful tips.



                                                                                                                                      Zoho Show Resources