Container snapshot restore: resume a Sume job from its job_id

Cloudflare Containers can snapshot a running container. Save the Sume job_id in it, and after a restore read the job's status_url instead of resubmitting.

4 min readSume
All posts

Cloudflare's changelog for Sep 30, 2026 adds the ability to create a snapshot from a running Container, restoring filesystem state after a restart or Durable Object handoff. If a Sume render is in flight when that happens, the snapshot only needs the job_id: after the restore, read the job's status_url and do not submit again.

What the changelog says

The entry reads "Create a snapshot from the running Container". The point, per the entry, is restoring filesystem state after a restart or a Durable Object handoff. The page as read does not say that running processes or memory are restored, so assume only files persist.

Cloudflare Containers snapshot entry (read 2026-10-03)
ItemDetail
DateSep 30, 2026
EntryCreate a snapshot from the running Container
RestoresFilesystem state after restart or Durable Object handoff

What to write into the filesystem

A Sume job runs on Sume's side, so it does not stop when your container does. What you lose is the handle. Write a small file the moment the create call returns: the job_id, the status_url, and the Idempotency-Key you used. Sume docs say the job envelope carries status_url, result_url, events_url and cancel_url.

Write it before you start waiting, not after. A snapshot taken between submit and write would restore a container that never knew about the job.

After the restore, read, do not resubmit

On startup, look for the file. If a job is recorded, poll its status until terminal is true, honoring next_poll_after_seconds when present, then fetch the result once result_ready is true. Sume's docs say not to submit a new paid job for the same intent; if you must retry the submit itself, reuse the same Idempotency-Key.

The sketch uses pip install requests.

import json, os, time, requests

H = {"Authorization": "Bearer " + os.environ["SUME_API_KEY"]}
state = json.load(open("/data/job.json"))  # {"job_id": "..."}
base = "https://api.sume.com/v1/jobs/" + state["job_id"]

while True:
    s = requests.get(base + "/status", headers=H, timeout=30).json()
    if s.get("terminal"):
        break
    time.sleep(s.get("next_poll_after_seconds") or 10)

if s.get("result_ready"):
    print(requests.get(base + "/result", headers=H, timeout=30).json())
else:
    print("terminal without a result:", s.get("status"))

Sources

Related posts

More in Developers

All Developers posts

Written by Sume