Build reusable Sub-Zaps – Zapier

Beta

Sub-Zaps is a beta feature. It’s available for use, but still in active development and may change.

[Sub-Zap](https://zapier.com/apps/sub-zap-by-zapier/integrations) is a tool you can use to create a set of actions to re-use in multiple Zaps. 

Using this tool doesn't count towards your [task usage](https://help.zapier.com/hc/en-us/articles/8496196837261).

![actionEdit icon](https://cdn.zapier.com/storage/photos/649a3c82786155ec1f844e1e870a74bf.png) Example

If you have multiple Zaps where you want to use an email address to:

*   Look up a customer in Google Sheets.
*   Find a contact in Pipedrive.

You can use a Sub-Zap to create those actions. Instead of adding those action steps to each Zap, you can use a single Call a Sub-Zap action to perform those actions.

## 1\. Create a Sub-Zap

Sub-Zaps are created the same way that Zaps are created.

*   [Create a new Zap](https://help.zapier.com/hc/en-us/articles/8496309697421).
*   In the Zap editor, click to open the **Trigger** step.
*   In the _Choose app & event_ section, search for and select **Sub-Zap by Zapier**.
*   Click the **Event** dropdown menu and select the **Start a Sub-Zap** trigger.
*   In the _Set up trigger_ section, enter one or more **inputs** in the _Input/Argument List_ field.
*   Click **Continue**.

![miscEye icon](https://cdn.zapier.com/storage/photos/335619ab6472fe1fefab18d493cb39bf.png) Note

*   Inputs are the names of fields in your Zap that send the Sub-Zap data. Add any inputs that you’ll need to use in your Sub-Zap actions. If you want an input field to be required, add "required" anywhere in the name of the input.
*   If you want to use real data in your Sub-Zap, you must create and test a Call a Sub-Zap action before testing the Sub-Zap trigger. Otherwise, default sample data is provided.

## 2\. Add a Call a Sub-Zap action to your Zap

*   In your Zap, click the **Action** step or click the **plus + icon** to add an action to your Zap.
*   Search for and select **Sub-Zap by Zapier**.
*   Click the **Event** dropdown menu and select the **Call a Sub-Zap** action.
*   In the _Set up action_ section, select your **sub-Zap** from the _Select Your Sub-Zap_ dropdown menu.
*   The input fields you created in your sub-Zap will appear. [Set up the data](https://help.zapier.com/hc/en-us/articles/8496257774221#set-up-your-action) that you want to send over to your Sub-Zap.
*   Click **Continue**.
*   In the _Test action_ section, click **Test & Review**.

## 3\. Test your Sub-Zap trigger

*   In your Sub-Zap, select the **Test your trigger** section.
*   Click **Test & Review**.

## 4\. Add actions to your Sub-Zap

You can add as many [actions](https://help.zapier.com/hc/en-us/articles/8496257774221) to your Sub-Zap as you want. All Sub-Zap actions will run each time the Sub-Zap is called by a Zap.

The Sub-Zap must end with a Return From a Sub-Zap action. This action collects the data to send back to your Zap.

*   In your Sub-Zap, click the **Action** step or click the **plus + icon** to add an action to your Zap.
*   Search for and select **Sub-Zap by Zapier**.
*   Click the **Event** dropdown menu and select the **Return From a Sub-Zap** action.
*   In the _Set up action_ section, set up your outputs in the _Output/Return Values_ field:
    *   In the field on the left, enter the output name.
    *   In the field on the right, click the **field** and select a field from a preceding action with the data you want to send to your Zap.
    *   Repeat this step for each output you want to send to your Zap.
*   Click **Continue**.
*   In the _Test action_ section, click **Test & Review**.

![miscEye icon](https://cdn.zapier.com/storage/photos/335619ab6472fe1fefab18d493cb39bf.png) Note

If you add a Return From a Sub-Zap action to your Zap, it will return this error: "Did you fork or replay this step? We expected callbackUrl to be stored!" To prevent this error, only add a Return From a Sub-Zap action in your Sub-Zap.

## Frequently asked questions

**How many tasks does Sub-Zap by Zapier use?**

Each time a Zap calls a Sub-Zap:

*   2 tasks are used by the Sub-Zap by Zapier app.
*   Each action step within the Sub-Zap uses 1 task.

In the example above, 4 tasks are used by the Sub-Zap:

*   The Start a Sub-Zap trigger uses no tasks.
*   The Call a Sub-Zap action uses 1 task.
*   The Google Sheets action uses 1 task.
*   The Pipedrive action uses 1 task.
*   The Return From a Sub-Zap action uses 1 task.

**Why is my Sub-Zap stuck in a Waiting status?**

If you see a Sub-Zap with a [Waiting status](https://help.zapier.com/hc/en-us/articles/8496291148685#view-status-of-zap-runs) in your Zap run history, a [Filter](https://help.zapier.com/hc/en-us/articles/8496276332557) or [Path](https://help.zapier.com/hc/en-us/articles/8496288555917) action in the Sub-Zap prevented the Sub-Zap from continuing. Any Zaps associated with your Sub-Zap won't continue past the Return from a Sub-Zap action.

Learn more about [Sub-Zap example workflows](https://community.zapier.com/featured-articles-65/by-zapier-sub-zaps-and-how-to-use-them-11497).

## Limitations of Sub-Zap by Zapier

There are limitations on how Sub-Zaps work with other Zapier features.

### Sub-Zaps must have a Return from Sub-Zap step

A Sub-Zap must have at least one Return from Sub-Zap step. If you add more than one Return from Sub-Zap step, only the first one will run successfully. This is important to consider when using Looping and Paths within Sub-Zaps.

### Adding Paths actions within a Sub-Zap:

*   If you use multiple Return from Sub-Zap steps within Paths, only the first one will run successfully. The Path branch logic must be configured to be mutually exclusive so that only one ‘Return from Sub-Zap’ step runs at the same time.

### Adding Loop actions within a Sub-Zap:

*   Loop actions can't be added before a Return from Sub-Zap step within a Sub-Zap.

For more details, read our [Announcing Sub-Zap by Zapier](https://community.zapier.com/zapier-announcements-10/announcing-sub-zap-by-zapier-8905) post.