Format output_schema for partial results: nullable and primary key
How to design a Sume Format output_schema so a run that makes the video but misses a caption still passes: nullable fields, no minItems, and primary_output_key.

A strict output schema fails the run when the object cannot be filled, so design for partial success. Make every optional field a nullable union, avoid minItems on arrays that the run might legitimately leave empty, and set primary_output_key to the one field you cannot ship without. Sume then validates the object against the schema and checks that the primary output exists.
Sume requires every property to be listed in required and additionalProperties: false on every object, so "optional" is expressed as ["string","null"] or an anyOf with null, never as an omitted key.
A schema that tolerates a missing caption
{
"type": "object",
"additionalProperties": false,
"required": ["video_url", "caption", "duration_ms"],
"properties": {
"video_url": { "type": "string" },
"caption": { "type": ["string", "null"] },
"duration_ms": { "type": "integer" }
}
}What fails the run
| Code | Meaning |
|---|---|
| output_schema_unsatisfied | Object does not match the schema |
| output_extraction_failed | No object could be extracted |
| unattended_blocked | Run needed a human |
| deliverable_missing | No deliverable produced |
| primary_output_missing | primary_output_key field is empty |
| agent_reported_failure | The run reported it could not finish |
Send primary_output_key with the schema
Set "primary_output_key": "video_url" next to output_schema in the run body. It is capped at 64 characters. output_schema and response_format are alternatives: sending both is a 400.
Sources
Related posts
More in Formats
- Format run expires_at: 90 minutes from created_at, or sooner
How long a Sume Format run can live, which statuses are terminal, and how to poll the status_url without waiting on an event stream that does not exist.
- Format run retry: same key and body gives 200, changed body 409
Retrying POST /v1/formats/{handle}/{slug}/runs with the same idempotency_key and body returns the first run; a changed body or a parallel duplicate returns 409.
- Webhook or polling for Sume Format runs, and the 1 MiB payload rule
Pick between the signed terminal webhook and polling status_url for Sume Format runs: delivery limits, dedupe keys, and what a payload over 1 MiB looks like.
- Sume webhook missed? POST /v1/format-runs/{run_id}/webhook/redeliver
Replay a Format run webhook without rerunning: the redeliver endpoint, the formats:write scope, and the two 409 errors for no webhook or a run still going.
Written by Sume