Recap of the Previous Post

In Part 4, I covered GAS and clasp. This time, I'll talk about Cloudflare Workers as the "next step beyond GAS."

When I Hit GAS's Limits

GAS is great, but push it hard enough and you'll hit walls.

These limitations became real problems as the Kagemusha System's user base grew.

👨
GAS keeps timing out at 6 minutes… the process never finishes…
🟠
Let's migrate to Cloudflare Workers. You won't have to worry about execution time anymore.

What Are Cloudflare Workers? — A Quick Overview

Workers = a program execution environment that runs on servers around the world.

Cloudflare has servers in over 300 cities worldwide, and your program runs on the server closest to the user. That's why it's fast. And you never have to manage any servers (serverless).

300+
Server locations worldwide
100K/day
Free tier requests
$0
Monthly cost on the free plan

This free tier is incredibly generous. Up to 100,000 requests per day at no cost. More than enough for solo development.

What Is wrangler? — The Deployment Tool for Workers

wrangler = a CLI tool for deploying (publishing) Cloudflare Workers.

Just as clasp was the deployment tool for GAS, wrangler is the deployment tool for Workers. Its job is to send the code you write on your PC to Cloudflare's servers.

Installation

wrangler also installs via npm.

npm install -g wrangler

For the first time, log in with your Cloudflare account:

wrangler login
# A browser window will open — authorize with your Cloudflare account

How I Use It — One Command to Deploy Worldwide

I mainly use two commands.

# Deploy (publish) Workers
wrangler deploy

# Run locally during development
wrangler dev

Running wrangler deploy distributes your code to servers in over 300 cities worldwide within seconds. I was genuinely amazed the first time I did this.

Before (GAS era)

6-minute execution limit. Cold starts with multi-second waits. Concerns about concurrent access. After clasp push, you still needed to update the deployment on the GAS side.

After (post-Workers migration)

No execution time worries. Millisecond-level responses. A single wrangler deploy publishes globally.

For the Kagemusha System, I migrated the API server portion from GAS to Workers. I didn't abandon GAS entirely — it still handles integration with Google services (spreadsheet operations and email sending). It's all about using the right tool for the job.

Is migrating from GAS to Workers mandatory?
Not at all. Plenty of products work perfectly fine with GAS alone. In my case, I migrated because the growing user base made processing too heavy. There's no need to start with Workers from the beginning — just consider it when you hit GAS's limits.

Next Time

Next up, I'll introduce the Stripe CLI for handling online payments. Dealing with money is nerve-wracking, but Stripe's robust testing environment made development surprisingly stress-free.

Series: Dev Tools for a Non-Coder
Part 1: Claude Code
Part 2: Node.js & npm
Part 3: Git
Part 4: Google Apps Script & clasp
Part 5: Cloudflare Workers & wrangler
Part 6: Stripe CLI
Part 7: Python & Useful Libraries
Part 8: Wrap-Up — The Big Picture & How to Choose

Still managing tutor attendance manually?

Discover Kagemusha System