A failed Format run still lists its media: read artifacts[], continue
A Sume Format run that ends failed still lists its media in artifacts[], and you can continue it with previous_run_id. Here is when that works.

A Sume Format run that ends failed still lists every durable file it made in artifacts[], so a failure does not mean the media is lost. If the run left work and has a thread, you can continue it with previous_run_id instead of starting over,.
What the receipt keeps
The docs say it in two places. In the status table, failed means finished with an error, error gives the cause, and artifacts[] still holds all the media that the run made. And in the continue section, a failed run that left work can be continued, while a run that left nothing cannot.
Failure is honest
An unfinishable run comes back failed, for example with unattended_blocked, and never as a half-finished completed. That is a deliberate choice. It means your code can trust completed as a sign that the deliverable exists, and it means you should look at artifacts[] on every failure before you decide to re-run.
When you can continue
A continuation is only possible under two conditions: the receipt's thread_id is not null, and the run either completed or has a non-empty artifacts[]. Each refusal has its own code.
| Code | Meaning | What to do |
|---|---|---|
| 404 previous_run_not_found | Unknown id, or another owner's run | Check the id and the key |
| 400 previous_run_format_mismatch | The run started on a different Format | Continue on the original Format |
| 409 previous_run_not_terminal | The run has not finished | Poll, then call again |
| 400 previous_run_not_resumable | No thread, or not completed with no artifacts | Start a new run |
What a continuation is
A continuation is a new run with its own id, its own receipt, its own spend cap and its own single webhook. The original run never changes. Bind the same output_schema again, because it is per run and is not inherited, and remember that usage stays per run even though artifacts[] on the continued run lists all the media of the whole conversation.
List what survived
The script below reads a failed run's artifacts and prints what survived. It needs RUN_ID and SUME_API_KEY, and it only reads.
import json, os, urllib.request
req = urllib.request.Request(
"https://api.sume.com/v1/format-runs/" + os.environ["RUN_ID"],
headers={"Authorization": "Bearer " + os.environ["SUME_API_KEY"]},
)
with urllib.request.urlopen(req) as r:
run = json.load(r)["data"]
print(run["status"], (run.get("error") or {}))
for a in run.get("artifacts") or []:
print(a["type"], a["content_type"], a["url"])A rule of thumb
Decide on the number of artifacts before you decide on a retry. Zero artifacts means a fresh run. A few artifacts and a clear error mean a continuation with a narrow instruction, such as redoing one scene. The continuation has its own spend cap, so you set the limit for the retry yourself.
Sources
Related posts
More in Formats
- Five ad variants in one Format run: a variants[] output schema
Bind a schema with a variants array, a nullable video_url per variant and maxItems 5, so a partial run still returns the variants it finished.
- Format grant 404 workspace_not_found: only team handles resolve
workspace_not_found on POST .../grants means the handle matches no team workspace. User handles are not grantable, so pass a team handle or an org_ id.
- Format grant 409: exists, self, or workspace_required
A 409 on POST .../grants is format_grant_exists, format_grant_self or format_workspace_required. Each has its own fix, and none is a retry.
- Format run spend caps: the $500 ceiling and the null trap
A Sume Format run cannot spend past its cap. Omit it to inherit the Format's cap, send up to 500 to set one, and know null means $500, not no limit.
Written by Sume