Cloudflare Workers
Serverless platform that serves static assets and Worker code from Cloudflare's global network.
- Always free
- Commercial use not stated
- No card required
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_firstget 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 setassets.directoryin the Wrangler config file.
Setup
What you do
- Sign up at https://dash.cloudflare.com/sign-up and verify your email address.
- 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
- developers.cloudflare.com/pages
- developers.cloudflare.com/workers/static-assets
- developers.cloudflare.com/workers/static-assets/billing-and-limitations
- developers.cloudflare.com/workers/static-assets/get-started
- developers.cloudflare.com/workers/platform/pricing
- developers.cloudflare.com/workers/platform/limits
- developers.cloudflare.com/workers/ci-cd/builds/limits-and-pricing
- developers.cloudflare.com/workers/configuration/routing/workers-dev
- www.cloudflare.com/terms
- www.cloudflare.com/plans
- developers.cloudflare.com/fundamentals/account/create-account
- developers.cloudflare.com/fundamentals/user-profiles/login
- developers.cloudflare.com/fundamentals/api/get-started/create-token
- developers.cloudflare.com/workers/wrangler/install-and-update
- developers.cloudflare.com/workers/wrangler/commands/general
- developers.cloudflare.com/workers/wrangler/commands/workers
- developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions
- developers.cloudflare.com/workers/llms.txt