Migrate from Zapier Functions to Code by Zapier

Zapier Functions is being deprecated on September 1, 2026. Use this guide to move your Functions workflows to Code by Zapier. Code by Zapier runs natively inside your Zaps and supports both JavaScript and Python, along with npm and PyPI packages, AI-assisted code generation, and the Zapier SDK.

Code by Zapier supports Python, so you can reuse some of your existing logic. If your functions use zapier.action, you'll need to rewrite those calls in JavaScript using the Zapier SDK. Use this guide to plan your migration and understand how each Functions feature maps to Code by Zapier.

Before you start

  • Copy your function code. From the Functions home, open each function and save your Python code locally before the September 1, 2026 shutdown date.
  • List your functions and triggers. Note which apps, triggers, and actions each function uses. This helps you plan which Zaps to create or update.
  • Review Code by Zapier docs. Familiarize yourself with JavaScript code in Zaps, Python code in Zaps, and the Zapier SDK (JavaScript only).

Timeline

Date What happens
June 1, 2026 Functions is no longer accepting new users. Start planning your migration.
September 1, 2026 All functions stop running. Migrate your workflows before this date.

Feature comparison

Functions feature Code by Zapier equivalent Notes
Python code Python or JavaScript code You can work in either Python or Javascript in Code by Zapier. However, use JavaScript if you need the Zapier SDK.
Third-party packages npm and PyPI packages Available on Zapier paid plans.
zapier.action (authenticated app calls) Zapier SDK (JavaScript only) Call any app action from code with zapier.apps..
Multiple triggers Sub-Zaps Wrap your Code step in a Sub-Zap, then call it from multiple trigger Zaps.
Secrets (API keys, tokens) API by Zapier Handles authenticated API calls.
Multiple code files Single Code step Combine logic into one step, or split across multiple Zap steps.
Copilot in Functions AI-assisted code generation Built into the Code editor.
Deploy and rollback Zap publishing Use Zap version history to manage changes.
5-minute runtime Plan-based runtime limits Enterprise plans support up to 10-minute runtimes.
1,500 tasks per month Tasks counted per Zap run Standard task usage applies.

Differences between Functions and Code by Zapier

Some Functions features work differently in Code by Zapier. The following sections explain how to handle these differences during your migration.

Secrets and persistent tokens

Functions stored secrets for use in code. In Code by Zapier:

  • For authenticated API calls, use API by Zapier which handles credentials through your existing app connections.
  • For the Zapier SDK, credentials are handled automatically through your app connections. No API keys are exposed in code.

Multiple code files

Functions supported multiple code files within a single function. Code by Zapier uses a single code editor per step. To manage complex logic:

  • Combine related code into a single Code step.
  • Split independent logic across multiple Code by Zapier steps in the same Zap.
  • Use helper functions within your Code step to organize your code.

Step-by-step migration

1. Create a new Zap with a trigger

Each function trigger becomes a separate Zap trigger. If your function has multiple triggers, you will need to create a separate Zap for each one (or use a Sub-Zap to share the code logic).

  1. Go to your Zaps and click Create.
  2. Set up the trigger for the same app and event your function trigger used.
  3. Connect your app account and configure the trigger.
  4. Test the trigger to confirm it returns data.

2. Add a Code by Zapier step

  1. Click the + icon to add a new step.
  2. Search for and select Code by Zapier.
  3. Select Run JavaScript or Run Python as the action event. Use JavaScript if you need the Zapier SDK.
  4. Click Continue.

3. Adapt your code for Code by Zapier

If your function does not use zapier.action, you can use a Python code step and reuse much of your existing code. The main changes are how input and output data are handled.

If your function uses zapier.action to call app actions, you'll need to rewrite in JavaScript and use the Zapier SDK. Before writing your code, enable the SDK and add your app connections in the Code editor.

The following table maps common Python-to-JavaScript patterns:

Python (Functions) JavaScript (Code by Zapier)
input_data['key'] inputData.key or inputData['key']
output = {'key': 'value'} output = {key: 'value'}
print(value) console.log(value)
import requests Use the built-in fetch function
requests.get(url) await fetch(url)
requests.post(url, json=data) await fetch(url, {method: 'POST', body: JSON.stringify(data), headers: {'Content-Type': 'application/json'}})
try: ... except: try { ... } catch (error) { ... }
zapier.action.app.action_key(params={...}) Use the Zapier SDK: await app.write.action_key({inputs: {...}})
Tip

Use the AI code generation in the Code editor to help adapt your code. If converting from Python to JavaScript, paste your Python code and ask the AI to convert it.

4. Replace authenticated app calls with the Zapier SDK

If your function uses zapier.action to call app actions, replace those calls with the Zapier SDK. You'll need to enable the SDK and add your app connections in the Code editor first.

  1. In the Code editor, click the Packages icon and enable @zapier/zapier-sdk.
  2. Click Add app connection and select the app account you want to use.
  3. Note the Account ID Variable (for example, slack). This is the key you'll use in your code to reference the connection.

Functions (Python):


    zapier.action.slack.send_channel_message(
    params={"channel": "#general", "text": "Hello"},
    type_of="write",
)

Code by Zapier (JavaScript with SDK):


    import { createZapierSdk } from '@zapier/zapier-sdk';
const zapier = createZapierSdk();

export default async function main({inputData, connections}) {
  const slack = zapier.apps.slack({ connectionId: connections['slack'] });

  await slack.write.channel_message({
    inputs: {
      channel: "CHANNEL_ID",
      text: "Hello",
    },
  });

  return { success: true };
}

The connections object contains the connection IDs you configured in the Code editor. Use the Account ID Variable as the key (for example, connections['slack'] or connections['my_slack'] if you customized it).

5. Replace Python libraries

Code by Zapier includes built-in utilities for both Python and JavaScript on all plans:

Python (built-in) JavaScript (built-in) Purpose
requests fetch HTTP client
print console.log Debugging
StoreClient StoreClient Store and retrieve data between Zap runs
BeautifulSoup Not applicable Parse HTML and XML content

If you need libraries beyond what is built in, you can add third-party packages from npm or PyPI to your Code step. Learn how to add third-party packages to your Code step.

6. Handle multiple triggers

If your function used multiple triggers, you have two options:

  • Create separate Zaps. Build one Zap per trigger, each with its own Code by Zapier step containing the same logic.
  • Use a Sub-Zap. Put your code logic in a Sub-Zap, then call that Sub-Zap from multiple trigger Zaps. This avoids duplicating code.

7. Test and publish

  1. Click Run Code to test your Code step.
  2. Review the Output Data to confirm the results match your function's output.
  3. If your Zap has subsequent steps, remap fields if the output structure has changed.
  4. Test the full Zap end to end.
  5. Publish the Zap.
  6. Once confirmed, you can stop or remove the original function.

Related resources

Get help

Was this article helpful?
0 out of 0 found this helpful