Skip to content

Versions and rollback

Every jiayang deploy makes a new version of the app, numbered from 1, and puts it live once it’s running. A rollback puts an earlier version live again, with the app’s current configuration, secrets and data.

A new version of a Worker or a site can take up to a minute to reach every location, and until it has, some requests still get the one before. A deploy that replaces a live version says so:

Version 3 can still answer some requests for up to a minute, until this one reaches every location.

A container app changes over by a rollout. Cloudflare stops the running container with SIGTERM, gives it up to 15 minutes to exit, then starts the new version’s. The old version answers until it has stopped, so how long this takes is mostly how quickly your app exits on SIGTERM:

Version 3 keeps answering until its container has stopped and this one's has started. Cloudflare stops it with SIGTERM and gives it up to 15 minutes to exit, so how long that takes is mostly how quickly the app exits on SIGTERM.
Terminal window
jiayang versions acme/hello
4 deployed 2026-09-23 someone@example.com (live)
3 failed 2026-09-23 someone@example.com
2 deployed 2026-09-22 you@example.com
1 deployed 2026-09-20 you@example.com

Each line is the version’s number, its status, the day it was made, who made it, and (live) for the one serving now. Newest is first.

Status Meaning
deployed It went live. It can be put live again.
failed It was made, but couldn’t be put live. The version before it kept serving.
uploaded It was made, and isn’t live yet.
pruned Too old to go back to. Only its number, hash and author are kept.

--json gives each version’s number, sha256, size_bytes, status, active, created_by and created_at. jiayang deploy --json prints the same fields for the version it made, with the app’s url beside them.

The app’s Versions tab in the dashboard lists the same, with Put this live beside each version that can go live again.

Give the version’s number:

Terminal window
jiayang rollback acme/hello 2
Version 2 is live again.

It replaces the live version for everyone using the app, once it has reached every location. For a container app that’s a rollout, the same as a deploy: the running container stops and the old version’s image starts in its place. Cloudflare runs one rollout at a time, so a rollback, deploy or env set made while the last one is still going waits up to 20 seconds for it, then stops with This app's last change is still rolling out to its container. Try again in a minute. A rollback doesn’t make a new version: version 2 is live again under its own number. The next jiayang deploy makes version 5, and you can go forward to 4 the same way you went back.

A version is what was deployed: a Worker’s code and compatibility settings, a site’s files, or a container’s image, port and size. Everything else belongs to the app and stays as it is now:

So a rollback to a version that expected a variable you’ve since removed runs without it. Set it again with jiayang env set.

The newest 20 versions keep what they were made of, and so does the live one. Older versions are pruned: listed for the record, and refused by rollback:

error: Version 3 is too old to go back to: only the newest 20 keep what they were made of. Deploy it again from the source it came from.

Only a version that went live can go live again:

error: Only a version that deployed successfully can be rolled back to.

A number that isn’t there:

error: not found: acme/hello has no such version (`jiayang versions acme/hello` lists them), or it isn't an app you can see

A version goes through today’s checks on its way back. A site with a file a newer rule refuses can’t be put live again, and a container version can’t go live on a plan that doesn’t run containers.

Listing versions and rolling back take an editor or owner of the app, or a workspace admin or owner. Every deploy, failed deploy and rollback goes in the audit log.