Sub-Zaps and Code steps

Zapier · Advanced · 10 min

Reuse keeps many Zaps consistent, and a few lines of code can replace a tangle of Formatter steps.

Sub-Zaps let several Zaps share one set of steps, like a recipe you refer to instead of copying. If five Zaps all "look up the customer in the CRM and the billing app and combine the details", build that once as a Sub-Zap.

A Sub-Zap has three parts:

  • Start a Sub-Zap trigger: lists the inputs it expects, for example email. Write "required" in a name to make that input mandatory.
  • Any actions you like.
  • Return from Sub-Zap action: chooses the outputs to send back, such as customer_id and plan.

In a main Zap, the Call a Sub-Zap action picks the Sub-Zap, maps data into its inputs, and receives its outputs for later steps. Fix a bug in the Sub-Zap and every caller benefits. Sub-Zaps are still labelled beta.

Code by Zapier runs a short program written in JavaScript or Python (two programming languages) inside a Zap. Use it sparingly, for things built-in steps make awkward, such as complex text parsing or calculations. Data from earlier steps comes in through an Input Data list of named values, and whatever the code returns becomes fields for later steps. Copilot or an AI assistant can draft the code for you, but you need someone who can read it.

Limits: Code steps have short time limits, can't safely store secrets such as API keys in the code, and use UTC (the world standard clock, not your local time zone). The separate Zapier Functions product was retired in September 2026; Zapier points users to Code steps instead.

Remember

  • Sub-Zaps = reusable steps with defined inputs and outputs
  • Call a Sub-Zap maps data in and receives results back
  • Use Code steps only where built-in steps get awkward; never paste secrets into code

Check yourself

  1. Which step must every Sub-Zap end with to send results back to the calling Zap?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: help.zapier.com/hc/en-us/articles/8496308527629