Button guide
Run a Python script from Zapier? Code by Zapier limits, and how to run a script on your own computer instead
Not directly. Code by Zapier runs in a sandbox on Zapier's cloud, where it can't read files on your computer, only has the standard library plus requests and BeautifulSoup, and stops after 1 second on the Free plan or up to 10 minutes with extended runtimes on paid plans. If a person starts the run, you can turn your local script into a web form with Button (https://button.bitgate.dev) instead, which runs the script on your own machine for up to 30 minutes per run and is $0 on the Free plan for 1 published tool, 3 people and 100 runs per month.
Code by Zapier limits
When you add a "Code by Zapier" step to a Zap, it doesn't reach into your laptop or office machine. It runs Python 3.13 in a sandbox in Zapier's cloud.
Because it's in their cloud, your script has no access to files on your computer. The environment is also locked down to specific limits:
- Time limits: 1 second on Free, 30 seconds on Professional and Team, and 2 minutes on Enterprise. Paid plans can use extended runtimes up to 10 minutes.
- Memory: 512 MB.
- Packages: You only get the Python standard library,
requests, and BeautifulSoup. If your script needs other packages, you can'tpip installthem into a Code step. - Monthly tasks: Zapier's Free plan includes 100 tasks per month.
Your three options
Depending on what triggers your script and what it needs to do, you have three ways to handle this.
1. Rewrite the script into a Code by Zapier step If your script doesn't actually need local files or extra packages, and it finishes within the time and 512 MB memory limits, the simplest move is pasting the logic into a Code by Zapier step and letting it run in Zapier's cloud. Zapier stays the best fit for app-to-app automation, so if a new row in a spreadsheet or a webhook from another service needs to trigger a quick bit of Python automatically, keep it in Zapier.
2. Host the script as an API and call it from a Zapier webhook step
If the script must be triggered automatically by a Zap, and it needs your local machine, extra packages, or more than 512 MB of memory, Zapier can't run it directly. Put an HTTP endpoint in front of the script and call it from a webhook step. One tool for this is webhook (github.com/adnanh/webhook), a small open-source server that runs shell commands when it receives HTTP requests.
3. Use Button when a person starts the run Often, people only reach for Zapier because they want a colleague to kick off a Python script without installing Python themselves. If a human starts the job, you don't need Zapier in the middle. Button turns a script on your own computer into a web form your colleagues open in their browser, fill out and run. The job runs on your computer, so it can use the packages installed there, for up to 30 minutes per run.
| Feature or limit | Code by Zapier | Button (button.bitgate.dev) |
|---|---|---|
| Where the script runs | Zapier's cloud sandbox | Your own computer |
| Python packages | Standard library, requests, BeautifulSoup |
Anything installed on your computer |
| Max runtime | 1 sec (Free), 30 sec (Pro/Team), 2 min (Enterprise), up to 10 min extended on paid plans | 30 minutes per run |
| Memory limit | 512 MB | Your computer's memory |
| File limits | No local computer file access | Up to 25 MB per file; up to 8 files and 100 MB per run |
| Free plan | $0 for 100 tasks/month (1 sec runtime limit) | $0 for 1 published tool, 3 people, 100 runs/month, 1 GB file transfer/month |
| Paid plans | Paid plans unlock 30 sec to 10 min runtimes | Pro is $15/month (or $144/year) for 50 tools, 250 people, 5,000 runs/month, 50 GB file transfer/month |
How to prepare your Python script for Button
Before you hook a script up to Button, make sure it takes its inputs as command-line arguments rather than using hard-coded file paths or interactive input() prompts. In Python, you do this with argparse (the same idea as commandArgs() in R, a param() block in PowerShell, or $1 and $2 in bash).
If your script takes input files and produces output files, take each input file path as an argument, and write the results as files into an output folder that is also passed in as an argument.
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument("--input-file", required=True)
parser.add_argument("--currency", required=True)
parser.add_argument("--output-dir", required=True)
args = parser.parse_args()
os.makedirs(args.output_dir, exist_ok=True)
out_path = os.path.join(args.output_dir, "result.txt")
with open(args.input_file, "r") as f_in, open(out_path, "w") as f_out:
f_out.write(f"Currency: {args.currency}\n")
f_out.write(f_in.read())
When you set this up in Button, fixed flags like --currency are part of the command you approve on your machine; your colleagues only supply the values for the form fields (like USD or the uploaded file).
How to set up your script on Button
- Sign in to Button. Go to https://button.bitgate.dev and sign in.
- Install the Button runner. Run the one-line command the site shows you on the computer where your script lives (it uses
curlon macOS and Linux, or PowerShell on Windows). You get one computer (runner) per workspace on every plan, and pairing a new computer replaces the previous one. - Pick your program. In the local setup page that opens, select your Python script (Button also works with Node, R, PowerShell, shell scripts, and compiled binaries).
- Describe the inputs. Set up the form fields your colleagues will fill out: text, number, yes/no, choice, or files.
- Publish the tool. Button gives your tool its own web page and pins the exact command you approved on your computer by hash.
And what does it look like for the people you share it with?
- Open the invite link. Colleagues click the link in their invite email and sign in with Google or a one-time email code. They install nothing and never pay.
- Fill in the form and press Run. They see if your computer is Ready, Busy, or Offline, fill in the inputs, and run the tool.
- Download the results. When the script finishes on your computer, they download the output files right from the page.
How Button runs scripts and handles limits
Jobs run on your computer, never in Button's cloud, though Button's servers relay the form values and files between the browser and your computer. Because the work happens on your machine, your computer has to be on and online when someone wants to use the tool, and it handles one run at a time per computer.
The runner only executes the exact command you approved on that computer, pinned by hash, passes every form value as its own argument with no shell, and rejects values that start with -. If you change a tool, people have to confirm the new version before running it. Every run is logged with who ran it and when, and you can revoke access or set it to expire at any time.
Keep the platform limits in mind when sizing your script's inputs and outputs:
- Up to 25 MB per file, and up to 8 files and 100 MB total per run.
- Up to 30 minutes per run, with logs up to 1 MB per run.
- Inputs are deleted 24 hours after a run ends, and outputs are deleted after 7 days.
- Free ($0): 1 published tool, 3 people, 100 runs and 1 GB of file transfer per month. Pro ($15/month or $144/year): 50 tools, 250 people, 5,000 runs and 50 GB per month. Your own runs count toward the monthly total, and downgrading deletes nothing.
FAQ
Can Zapier trigger a Button tool automatically?
No. Button is built for runs that a person starts from a web form, not for automated app-to-app workflows. If you need a Zap to trigger a script without a person clicking Run, keep the logic in Code by Zapier or call a self-hosted tool like webhook (github.com/adnanh/webhook) from a Zapier webhook step.
Do my colleagues need Python or a paid Button account to run my script?
No, recipients never pay and don't install anything on their computers. They open the link from their invite email, sign in with Google or a one-time email code, fill in the form, and press Run.
Does my data stay only on my computer when using Button?
No. While the script itself runs on your computer and never in Button's cloud, Button's servers relay the form values and files between the browser and your computer. Input files are deleted 24 hours after a run ends, and outputs are deleted after 7 days.
What happens if my computer is asleep or already running a job?
Your computer has to be on and online for the script to run, and Button runs one job at a time per computer. The tool page shows your colleagues whether your computer is Ready, Busy, or Offline before they press Run.
Can I connect more than one computer to my Button workspace?
No, every plan includes one computer (runner) per workspace. If you pair a new computer, it replaces the previous one.
Last updated
Put your script behind a form
Button turns a script on your computer into a web form. Colleagues sign in, fill it in, press Run and download the results. Free for 1 tool and 3 people.