﻿# AI SDK batch output: preserve the schema from submission to parsed results

How startBatch output and getBatchResults parsing in ai@7.0.174 should preserve schema identity, item status and the distinction between missing and valid empty values.

Author: Retrivium editorial team
Updated: 2026-11-18
Canonical URL: https://retrivium.ai/journal/daily-20261118-agent-aisdk-batch-structured-output/
Language: en

## A batch request and its parsed output form one contract

AI SDK ai@7.0.174, published on 17 November 2026 at 18:39:35 UTC, adds output support to startBatch and parsing in getBatchResults. This article is published on 18 November. The delivered feature connects a requested output shape to later batch results. It does not mean that accepting a batch establishes success for every item, or that a transport-level completion can replace checking whether the requested structure was actually produced.

## Preserve the intended schema when submitting work

A batch often leaves the immediate request lifecycle and is retrieved by another process later. The application should therefore retain the output contract alongside the submission identity. Otherwise a consumer may parse results using whichever schema happens to be current when retrieval occurs. A small field rename or a changed required property can turn a model response from the earlier request into an apparent failure of the new version. Schema identity and SDK version belong in the same bounded acceptance record.

## Distinguish item status from parsed value

An individual result can fail independently of other items in the batch. It can also return content that does not satisfy the requested output. Those are different observations from a valid parsed object. A consumer should preserve the status and error information it needs before reducing the result to an application value. A missing parsed value must not silently become an empty successful record. Equally, a valid empty or false-like value should not be mistaken for a missing result merely because a convenience condition treats it as false.

## Exercise retrieval with mixed controlled cases

A proposed fixture can submit several harmless tasks under one fixed schema and return controlled examples representing a valid object, invalid structure and an item-level failure. Compare the requested output configuration with the actual parsed results and their item identities. Then repeat retrieval using the application's real persistence and handoff path. This checks whether schema and result correspondence survives the asynchronous boundary. The proposal uses synthetic data and is not an assertion that Retrivium ran a batch service or measured a success rate.

## Treat retries and upgrades as separate decisions

Before repeating a failed item, establish what happened to that item and which output contract the repeat should use. Replaying an entire batch to repair one parse failure can duplicate unrelated work. An SDK update also needs a bounded compatibility check rather than an assumption that every provider implements the same structured-output surface. The useful result is a traceable connection between submission, item outcome and parsed value. It supports deliberate consumer behavior without promising universal provider support, exactly-once batch execution or a measured improvement in model accuracy.

## Sources

- [Primary source 1](https://github.com/vercel/ai/releases/tag/ai%407.0.174)
- [Primary source 2](https://github.com/vercel/ai/commit/3bea041)

## Related reading

- [Structured output at a handoff](/journal/guide-openhands-structured-output-reparse/)
- [Result completion contracts](/journal/provider-final-usage-frame-contract/)
