Cloudflare Workers: Two scripts, please. One for staging. One for production


Hello! As our Cloudflare Worker becomes more complex with frequent updates, my patience is running thin for having to manually copy & paste the script into the playground to test before overwriting the current script that’s in production.

Before I deploy the worker to production via curl using the Cloudflare API, my workflow is to bundle together NodeJS modules using webpack, test development builds using Chrome DevTools, then test production builds in the playground. (I use the Playground instead of my dashboard’s Editor because I don’t want to accidentally disrupt the script that’s in production.)

Would the folks at Cloudflare consider offering Cloudflare Workers customers precisely two scripts: one script for production, and another for staging?

Two scripts could also give us a taste of what the multiple scripts interface is like in an Enterprise plan, because right now I’m not sure what that UI looks like or whether an API endpoint exists for uploading different scripts.


Meanwhile, to speed things up I’m using Terraform and WebPack.

Also npm run preview

1 Like

I would like to see more Workers as well, not only for staging and production. We have code in GitHub repositories which are project related. With one only Worker, we have all code into a single repository, where everybody can edit about everything.

And yes, mixing staging and production is an absolute no-go.

1 Like

I wonder why this is not that popular? Are all users of cloud workers in Enterprise (able to have multiple scripts on one domain)?

I know you have to limit to one script for stability purposes, but it’s going to be a pain for people not in Enterprise, to buy a second domain for staging :frowning:

I hope there’s a roadmap of adding more scripts in the future, or at least provide a way to have a staging subdomain.


You could simply get a free domain, like a .tk one to test things…


if you have 500+ domains, that would mean I need to generate 500 ‘free’ domains. :frowning: There’s got to be a solution for this, maybe limit the staging script for a few thousand invocations?