Resources · Zapier integration

Code by Zapier Zapier integrationAutomate Code by Zapier with Zapier.

The Code by Zapier Zapier integration puts a few lines of Python or JavaScript inside a Zap. It counts 2 triggers, 2 actions and 0 searches. Below: what each one does, what it costs, and the traps to know before you switch anything on.

Verified Trustpilot reviews · AI, automation & growth agency

Overview

What the Code by Zapier Zapier integration is for

Code by Zapier is the step you reach for when no app offers the operation you want. You write a short piece of Python or JavaScript, and the Zap runs it like any other step. It is not a premium app, so it works from the free plan, within that plan's limits.

Three typical results. A cleaned-up value: Run Javascript takes a messy phone number or name from the step before and passes on a tidy version. A computed figure: Run Python adds, rounds or converts something no app computes for you. A Zap with no app behind its start: the Run Python and Run Javascript triggers let your own code decide when the automation kicks off.

Each step runs on the latest version of Python or Node that Zapier supports. Zapier itself files these operations as advanced, and it means it (you are writing code, even if it is ten lines).

What Zapier does not do here: there is no search step, and neither trigger is instant. Both are checked on a timer, so the free plan waits up to 15 minutes. And a Code action placed between a trigger and another action makes a Zap of three steps, which the free plan refuses.

If you are weighing tools, the Code by Zapier n8n integration sits on its own page, and the n8n vs Zapier comparison sets the two platforms side by side.

Vocabulary

Zapier vocabulary in one minute

Eight words come back on every line of this page. Here they are in plain English, once.

Zap
The automation you build in Zapier: one trigger, then one or more actions that run each time the trigger event happens.
Trigger
The event that starts the Zap. Once the Zap is switched on, Zapier sits and waits for it to happen.
Action
What the Zap does after it starts: the step that writes, sends or moves something on your behalf.
Task
The unit Zapier bills you on: one action your Zap completes successfully. The number on your plan counts these.
Polling trigger
A trigger Zapier checks on a timer. It asks for new items at a fixed interval and keeps only what it has not seen.
Instant trigger
A trigger the app reports itself, the moment the event happens. Code by Zapier has none of these, both of its triggers poll.
Filter
A step that lets the Zap continue only when what arrived meets your condition, and stops it quietly otherwise.
Multi-step Zap
Any Zap that goes beyond one trigger and one action. A second action or a filter makes one, and it needs a paid plan.
Cost

What a Code step really costs

The trigger never costs a task, and neither does checking for new data, however often Zapier looks.

  • Premium appNo, works on the free plan
  • Free plan100 tasks a month, two steps per Zap
  • TriggerCosts no task

Each action that succeeds counts as one task. An action that fails is not counted. The free plan gives 100 tasks a month and unlimited Zaps, but only two steps per Zap. So a Code action squeezed between a trigger and a second action, or followed by a filter, moves you to a paid plan. Zapier also has a help article titled How is Code by Zapier usage measured, worth a careful look before you roll a Code step out widely.

Connect

Add Code by Zapier to your account in 3 steps

  1. 01

    Open the Apps page

    In your Zapier account, go to Apps. This is where every connection lives, meaning each app account you link to Zapier once and then reuse in all your Zaps.

  2. 02

    Add the connection

    Click + Add connection, type Code by Zapier in the search box of the dialog, select it in the results, then confirm your choice with the Add connection button.

  3. 03

    Sign in and grant access

    Sign in to the app in the tab that opens and allow Zapier to use the account. You need an account on the app, plus access to anything you do not own that the Zap should touch.

First Zap

Your first Zap: leads scored in JavaScript, then sent to HubSpot

GoalA marketing agency lets a JavaScript trigger produce lead records, keeps only the serious ones and creates them in HubSpot.

  1. 01

    Build the start

    Create a Zap, pick Code by Zapier as the app and Run Javascript as the trigger event. Write the few lines that produce each lead and give it a score.

  2. 02

    Test the trigger

    Run the test and read what came back. Spot the score your code returned, because the filter will compare against it in the next step.

  3. 03

    Add the filter

    Add a Filter on that returned value, with a rule of the right type: a number rule for a score, a text rule for a label. The wrong type never passes.

  4. 04

    Send to HubSpot

    Add HubSpot with Create Contact, then map the values your code returned into the contact fields. Test this step once, on the lead picked earlier.

  5. 05

    Publish

    Check the whole chain once more, then Publish. With a filter, this Zap needs a paid plan. On the free plan, keep only the trigger and one action.

Triggers

Code by Zapier triggers

2 events start a Zap when something happens in Code by Zapier. Zapier checks for them at the interval your plan allows.

1

Run Python

Polling trigger

In Zapier“Use Python to kick off a workflow. This is an advanced action! Uses the latest supported version of Python.”

Here the Zap starts from your own Python rather than from an event in some app. Your code is the starting point, and every step after it works with what the code produces. It runs on the latest Python version Zapier supports.

How it fires
Zapier goes and looks at regular intervals, and how often depends on your plan: every 15 minutes on the free one.
When to use it
when the event you care about is not offered as a trigger by any app, and a short script can tell whether something new happened.
Watch out
Zapier labels this an advanced step, so plan time for testing before you publish.
2

Run Javascript

Polling trigger

In Zapier“Use Javascript to kick off a workflow. This is an advanced action! Uses the latest supported version of Node.”

Same idea in JavaScript: a block of code you write opens the Zap, on the latest Node version Zapier supports. Pick it if your team already reads JavaScript more easily than Python.

How it fires
Zapier goes and looks at regular intervals, and how often depends on your plan: every 15 minutes on the free one.
When to use it
when a developer on the team wants the start of the automation to follow a rule that lives in code, not in an app setting.
Watch out
since the trigger polls, nothing happens between two checks. On the free plan, that gap can reach 15 minutes.
Actions

Code by Zapier actions

Code by Zapier gives you 2 actions. For each one: what it does for you, when to reach for it, and what to watch out for.

1

Run Javascript

Action

In Zapier“Run Javascript code This is an advanced action! Uses the latest supported version of Node.”

Drops JavaScript in the middle of a Zap, so the data from earlier steps gets reshaped before it moves on. It runs on the latest Node version Zapier supports.

When to use it
splitting a full name, tidying a date or building a label that the next app expects.
Watch out
each successful run is one task, like any other action.
2

Run Python

Action

In Zapier“Run Python code This is an advanced action! Uses the latest supported version of Python.”

The Python twin of the step above: your script receives the values you map in, and the steps that follow can use what it returns.

When to use it
a calculation no app does for you, such as a margin, a score or a converted amount.
Watch out
inside a Zap that already has a trigger and one action, it adds a third step, so a paid plan.
When it breaks

When a Code by Zapier Zap breaks

Most failures come from Zapier's general rules, not from your code.

Zapier's help center files several articles under this app. Their titles alone tell you where the friction is: longer runtimes, usage, and a product being retired. The six cases below cover what to check first. For a Zap that keeps failing, the Zapier troubleshooting page is the next stop.

  • Nothing from before the Zap was on

    A Zap only reacts to what happens after you publish it. Old records are never picked up, and moving a backlog is a separate job.
  • The Zap keeps setting itself off

    If the last step writes into the very place the trigger watches, the Zap restarts again and again, and your task count drains fast.
  • A sudden huge batch is held back

    After a bulk import or a migration, a trigger that returns a pile of items at once can be held back by Zapier's flood protection.
  • The same item does not run twice

    On a polling trigger, Zapier remembers what it has already seen. An item it already processed will not start the Zap a second time.
  • Long-running code

    Two help articles carry the words in their titles: Run longer Code steps with extended runtimes, and Configure extended runtimes for Code steps. If a step seems to run long, start there.
  • Zapier Functions is being retired

    One help article is titled Important update: Zapier Functions is being deprecated, another Migrate from Zapier Functions to Code by Zapier. Still on Functions? Read both.
Need help

Need help automating Code by Zapier with Zapier?

A person reads every message.

FAQ

Code by Zapier Zapier integration: FAQ

01Is the Code by Zapier Zapier integration free?
Yes, Code by Zapier is not a premium app, so it works on the free plan. That plan gives 100 tasks a month and unlimited Zaps. The catch is the size of each Zap: the free plan stops at two steps, one trigger and one action. A Code step placed between a trigger and another action makes three steps, and that needs a paid plan. The same goes for any filter you add to check what your code returned.
02How many tasks does a Code step use?
Each Code action that succeeds counts as one task, exactly like an action in any other app. The trigger costs nothing, and the checks Zapier runs to look for new data cost nothing either. An action that fails is not billed. In a Zap with three actions, each successful one is counted, so it eats three times what a single-action Zap does. Zapier keeps a help article on how Code by Zapier usage is measured, worth reading before a heavy rollout.
03Is Code by Zapier real time?
No. Both triggers, Run Python and Run Javascript, are polling triggers: Zapier checks at a fixed interval instead of being told the moment something happens. The interval depends on the plan, every 15 minutes on Free, 2 on Professional, 1 on Team and Enterprise. On paid plans the interval can be changed, and a check can be run by hand from the editor. The type cannot be switched to instant from the editor either: the app's own API decides, and these two triggers are built to poll.
04What does it take to connect Code by Zapier?
A Zapier account, then a connection from the Apps page with + Add connection. You search for the app in the dialog, confirm, sign in in the tab that opens and grant access. Zapier also asks for access to anything you do not own that the Zap should touch. Beyond that, the real requirement is someone able to write and read a few lines of Python or JavaScript, since Zapier files these steps as advanced.
05Why does a Code by Zapier Zap stop after the code step?
Most often because a filter right after it never passes. Filter rules are typed: a text rule only works on text, a number rule only on numbers. If your code returns a figure and the filter compares it as text, the Zap stops every time. Test the Code step, look at the exact value it returned, then pick a rule of the matching type. Remember too that a filter turns the Zap into a multi-step Zap, so a paid plan.
06What if the operation you need does not exist in any app?
That is precisely the job of Code by Zapier. When no app offers the step, Run Python or Run Javascript lets you write it in a few lines and slot it into the Zap. Zapier also has a help article titled Generate a Code step using AI (Beta). And if the missing piece is the start of the Zap rather than a middle step, the two Code triggers cover that case as well.
07Zapier, Make or n8n for running custom code?
It depends on criteria, not on a winner. Check first where your other apps already run: a Code step is most useful inside a Zap that already connects them. Then check volume, since every successful Code action is a task on your Zapier plan. Check the shape of the Zap too, because the free plan stops at two steps. Finally, look at who maintains the code, since Zapier files these steps as advanced.