Skip to content
Building flows

Subflows

Reuse common logic by calling one flow from another and keep your automations organized.

What a subflow is

A subflow is a regular flow that other flows can call as if it were a step. The main flow passes it some input data, the subflow does its work and, if needed, returns a result that the main flow can keep using through the data selector.

It is the equivalent of a function in programming: you write the logic once and reuse it everywhere.

When to use them

  • Repeated logic: if five flows create customers in the CRM with the same normalization rules, put those rules in a subflow.
  • Several sources, one process: an order coming from the online store, from the point of sale or from an internal form can go through the same invoicing subflow.
  • Flows that are too long: splitting a 40-step process into three or four clearly named subflows makes it much easier to understand, test and maintain.
  • Teamwork: one person can maintain the invoicing subflow while another works on the flows that use it.

Example: shared customer onboarding

You create a subflow called "Shared - Create customer" that receives name, email, tax ID and source. Inside, it lowercases the email, checks whether the customer already exists in the CRM, creates or updates it, and returns the customer identifier.

The web form flow, the event leads flow and the spreadsheet import flow all call that subflow, passing for example {{trigger.email}} as the email. They then use the returned identifier to continue: send a welcome email or post to Slack. If the onboarding rules change tomorrow, you only change one place.

Best practices

  • Define clear, documented inputs. The less data a subflow needs, the easier it is to reuse.
  • Use a name prefix, such as Shared or Sub, to tell subflows apart in the list.
  • Make the subflow idempotent: if it is called twice with the same customer, it must not create two records.
  • Publish the subflow before relying on it from flows in production.
  • Test the subflow on its own with realistic data before connecting it.

Common errors

  • Changing a subflow's inputs without reviewing the flows that call it.
  • Creating circular chains where a subflow ends up calling the flow that called it.
  • Moving logic used by only one flow into a subflow; it adds nothing and makes maintenance harder.

Your first floow, running today.

Work out the price of your plan in a minute and request your sign-up, or book a demo and we will help your team design its first flows.

✓ No credit card✓ Human support✓ Data hosted in Spain