Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Built-in tools
  • Functions
  • Create a function

Call a function from a Zap

Written by Owner

Updated at August 20th, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Tables
    Work with tables Manage tables Create tables Troubleshoot Zapier Tables
  • Product updates
    Product updates: January 2023 Product updates: March 2023 Product updates: February 2023 Product updates: April 2023 Product updates: May 2023 Product updates: June 2023 Product updates: July 2023 Product updates: August 2023 Product updates: September 2023 Product updates: October 2023 Product updates: November 2023 Product updates: December 2023 Product updates: January 2024 Product updates: February 2024 Product updates: March 2024 Product updates: April 2024 Product updates: May 2024 Product updates: June 2024 Product updates: July 2024 Product updates: August 2024 Product updates: September 2024 Product updates: October 2024 Product updates: November 2024 Product updates: December 2024 Product updates: January 2025 Product updates: February 2025 Product updates: March 2025 Product updates: April 2025 Product updates: May 2025 Product updates: June 2025 Product updates: July 2025 Product updates: August 2025
  • Zaps
    Zap basics Zap history Troubleshoot Zaps Manage your Zaps Do more with Zaps
  • Your Zapier account
    Plans Billing Account profile Notifications Data privacy & security Get help User roles and permissions
  • Interfaces
    Troubleshoot Zapier Interfaces Create an interface Use interface components Manage interfaces
  • Canvas
    Create a canvas Collaborate on a canvas
  • Chatbots
    Add logic and knowledge to chatbots Troubleshoot chatbots Create chatbots Manage chatbots
  • Getting started
    Intro to Zapier Set up your Zapier account Use case templates
  • Agents
    Create agents Manage agents Troubleshoot agents
  • MCP
    Set up MCP
  • Built-in tools
    Filter & Paths Formatter Schedule & Delay Email, IMAP, SMTP, & Email Parser Webhooks & Code Storage, Digest, & RSS Sub-Zap & Looping Other built-in tools Custom Actions & API Requests Functions AI by Zapier & AI actions Copilot Human in the Loop
  • Lead Router
    Create routers
  • Apps
    Connect and manage your app connections AI apps on Zapier Apps on Zapier
+ More

Table of Contents

Requirements In your function In your Zap 1. Create a function Set up your function trigger Write your code (Optional) Return results to the Zap 2. Set up your Zap Add a trigger and other action steps Add a Zapier Functions action (Optional) Add more steps to your Zap Provide feedback and get help

With Zapier Functions, you can connect your function code to a Zap. This allows you to run custom code as a step in your Zap with access to features like Python packages, secrets, and a full development environment. You can call your function from any new or existing Zap by adding a Zapier Functions action event to it.

miscBoltAlt icon Beta

This product is in open beta. It’s available for use but still in active development and may change.

Requirements

To use a function with a Zap, you must have:

In your function

  • A Start a Function trigger.
  • Input fields set up in the Start a Function trigger.
  • Sample output data to use when testing the Zap step.
  • (Optional) A Return from a Function (return_action) action event in your code to return data to the calling Zap. 

In your Zap

  • A Zapier Functions Call a Function action event.

1. Create a function

A function normally starts from a function trigger related to a specific app. When you call it through a Zap, the trigger can retrieve any information that's part of that Zap, allowing you to reference, in your code, data from different steps of that Zap. 

Learn how to create a new function. 

Set up your function trigger

  • On the left sidebar of your function, click the Explorer icon. This will expand the sidebar.
  • Next to the Triggers section, click the plus sign +. This will create a new trigger file.
  • Within the trigger editor, start typing `functions` to find Zapier Functions and select it.
  • In the next field, select Start a Function as the trigger event.
  • Once the parameters load, add the input fields you want to use in the Zap.
    • Add one value per text field.
    • Fields you create here will appear in your Zap step Configure tab.
  • In the Sample Data field, enter sample data to be used when testing your Zap step. 
Screenshot 2025-05-29 at 5.34.08 PM.png
miscEye icon Note

If you're using the return_function action in your code, make sure the action parameters within the Output Data field match the structure of the sample output you add to this field.

Write your code

Your code can incorporate data coming from your Zap by referencing your trigger's output. 

(Optional) Return results to the Zap

If you want to return the code's results to the Zap, add a Return from a Function action (return_function). The Zap will wait for the function to finish running and return the contents of the return_function action to your Zap step as that step's output. 

To add this action, enter zapier.action.functions.return_function into your code. This will populate the parameters for that action, and you can enter any data you'd like to pass back to the Zap.

Screen Shot 2025-05-23 at 4.18.38 PM.png

The return_function action ends the function's execution, so you can only call it once in an execution path. If you do not use return_function in your code, the Zap step will halt once it calls the function. If you're not returning data to your Zap, make sure the Zapier Functions step is the last one in your Zap.

2. Set up your Zap

Add a trigger and other action steps

Your function can use data from any trigger or action step in the Zap that precedes the Zapier Functions step. After you set up your trigger and other actions, add the Zapier Functions step to your Zap.

Add a Zapier Functions action

  • In the Zap outline, click the Action step or the plus sign + to add a new action. A dialog box will open.
  • In the search box, search for and select Zapier Functions. The right sidebar will open to the Setup tab.
  • Click the Action event field to open the dropdown menu, then select Call a Function.
  • Select the Configure tab.
  • Click the Select Function and Trigger field to open the dropdown menu, then select the trigger for your function.
    • Only functions that use the trigger Start a Function appear in the dropdown menu. Click Refresh results if you make changes to your function.
  • Fill out the input fields created in your function trigger. You can map data from previous steps to them.
    • Click Refresh fields if you add more input fields to your function.
  • In the field Would you like to run this Function while testing?, decide if you want the function to run during test or not.
    • If you select True, all code in your main.py file will run when testing your Zap. You can also select a version of the function to run during testing.
    • If you select False, the code will not run and the Zap step will output the sample data you set up in your function trigger.

ratingStar icon Tip

You can also start a new function from the link in your Zap step, with the trigger pre-selected and a return_function action in the main.py file.

(Optional) Add more steps to your Zap

If you add a return_function to your code, once your Functions by Zapier step finishes running, you can use the content of the output fields in later steps. You can then add more actions, or use paths and filters to create conditional logic.

Learn more:

  • Blog post: Function steps in Zaps

Provide feedback and get help

Submit a feature request, provide feedback on existing features, or get help from the Zapier Functions team. You can also discuss Functions with other users on Zapier's Early Access Program Slack.

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Create a workflow using Python with Functions
  • Create trigger events for your functions
  • Write code in Zapier Functions
  • Import packages in Zapier Functions
  • Use secrets in Zapier Functions

Copyright 2025 – OBZ-Zapier.

Knowledge Base Software powered by Helpjuice

Expand