Cloudflare Workers

Serverless platform that serves static assets and Worker code from Cloudflare's global network.

Free tier

Static asset requests are free and unlimited; Worker script requests are capped at 100,000 per day.

  • Requests that serve static assets are free and unlimited
  • 100,000 Worker requests per day (resets at 00:00 UTC)
  • 10 ms CPU time per Worker request
  • 20,000 static asset files per Worker version
  • 25 MiB max per static asset file
  • 100 Workers per account
  • 3,000 Workers Builds minutes per month, 1 concurrent build, 20-minute build timeout

Gotchas

  • Cloudflare's Pages docs now tell new projects to start on Workers (static assets) instead of Pages.
  • Past 100,000 Worker requests in a day the Worker returns Error 1027; paths matched by run_worker_first get a 429 instead of falling back to static assets.
  • Cloudflare's Self-Serve Subscription Agreement bars collecting or processing credit card information on any web property receiving Free Services.
  • workers.dev subdomains are intended for personal or hobby projects that aren't business-critical; Cloudflare recommends a custom domain or route for production.
  • Accounts created with Google, Apple or GitHub login have no password until one is set, and creating API tokens requires a password.
  • wrangler deploy <dir> only works interactively; agents and CI should set assets.directory in the Wrangler config file.

Setup

What you do

  1. Sign up at https://dash.cloudflare.com/sign-up and verify your email address.
  2. Approve the Wrangler OAuth prompt in the browser when the agent runs npx wrangler login, or create an API token.

How your agent gets access

CLI login

Install
npm i -D wrangler@latest
Run
npx wrangler login

Opens a browser OAuth flow with a localhost:8976 callback; use npx wrangler login --device on remote or containerized machines.

API key

Install
npm i -D wrangler@latest
Get it at
dash.cloudflare.com/profile/api-tokens
Env var
CLOUDFLARE_API_TOKEN

Create it from the "Edit Cloudflare Workers" template; non-interactive Wrangler also needs CLOUDFLARE_ACCOUNT_ID.

Check it worked

npx wrangler whoami

Optional: start without an account

Creates a temporary resource before you have an account, for trying things out. The steps above are the normal path.

Run
npx wrangler deploy --temporary
Expires
The human has 60 minutes to claim the deployment.
To keep it
Open the claim URL Wrangler prints.

Needs Wrangler 4.102.0 or later, and fails if Wrangler can already authenticate with OAuth, CLOUDFLARE_API_TOKEN or a global API key.

Sources

Something out of date?