Schema-Validated LLM Workflows: A Benchmark Protocol and Comparative Evaluation Across Six Python Implementations

Sidney Shapiro, Sanad Al-Khatib, Aurora Pinzón Arzola, Emiliano Sebastian Gonzalez Venegas, Daniel PearsonarXiv 2026

Imagine you’ve spent your evening building a sleek LLM pipeline. You’re using "JSON Mode," the schema looks perfect, and your parser isn't throwing any errors. You head to bed feeling like a wizard, only to wake up to a Slack channel full of fire emojis because, while the LLM returned a perfectly formatted JSON object, the data inside was hallucinated nonsense.

This paper, Schema-Validated LLM Workflows, is the cold splash of water for that morning after. It tackles the dangerous assumption that "parseable" equals "correct."

TL;DR

Just because an LLM follows your JSON schema doesn't mean it’s telling the truth. This paper introduces a rigorous benchmark to separate structural validity (did it parse?) from task correctness (is the answer right?), revealing that while some Python frameworks are nearly perfect at formatting, others collapse entirely when the workflow gets complex.

What Problem Does This Paper Address?

In the world of AI engineering, we often talk about "Type Safety" or "Structured Outputs." We want LLMs to act like APIs—returning predictable objects that our code can actually use. However, there’s a gap in how we measure success.

Most benchmarks look at either raw text accuracy or simple schema adherence. But in a business workflow (like extracting data from an invoice or generating a SQL query), a "successful" response needs to pass two distinct gates:

  1. The Admission Gate: Does the output match the expected schema? (Structural Validity)
  2. The Truth Gate: Is the content actually correct based on the source document? (Task Correctness)

The authors argue that we’ve been conflating these two, leading to "false confidence" where a green dashboard for schema validity hides a mountain of factual errors.

Methods

The researchers developed a reproducible benchmark protocol that puts six different Python implementation conditions through the ringer: PydanticAI, LangGraph, DSPy, CrewAI, Agno, and a framework-free SDK reference (the baseline).

They visualized this as a layered evaluation path:

The layered evaluation path separates the implementation from the scoring.

The study used a "Lowest Common Denominator" (LCD) approach. They didn't let the frameworks use their fanciest "agentic" features initially; they forced them all to try and solve the same tasks using a shared model (GPT-4o-mini) and a shared schema. This allowed them to see how the "binding layer"—the way a library actually talks to the OpenAI API—affects the outcome.

Datasets

The benchmark consists of five "business-workflow" task families, using synthetic but realistic data:

  • Structured Extraction: Pulling fields from invoices and complaints.
  • SQL Generation: Turning natural language questions into SQLite queries.
  • Report Summarization: Distilling tabular and narrative reports.
  • Compliance QA: Answering questions based on synthetic policy documents.
  • Workflow Decision: Routing support requests to the right tools.

The final evaluation matrix was massive: 5,400 execution rows across 30 different implementation-task combinations.

Table 3: Task families in the current artifact.

Key Insights and Ideas

  • Separability is Real (H1): The authors proved that schema validity and task quality are distinct. You can have a 100% valid schema and still have a 60% accuracy rate. This is the "JSON Mode Trap."
  • The "Binding Path" Matters (H2): Even though every framework was talking to the exact same model (GPT-4o-mini), their performance varied wildly. How a library handles retries, prompts, and schema-passing isn't just "plumbing"—it's a critical part of the system's intelligence.
  • Task-Condition Interactions (H3): Failures aren't spread out evenly. Some frameworks might handle summarization fine but completely "collapse" (0% success) when asked to make a workflow decision.

Key Results

The results revealed a sharp "two-regime" pattern among the frameworks:

  1. The High Performers: PydanticAI, LangGraph, and DSPy were the stars. They achieved near-ceiling (100%) schema validity and high automated quality scores (0.91–0.94).
  2. The Strugglers: The Plain SDK, Agno, and CrewAI performed significantly worse in this specific configuration. For instance, the plain SDK only hit about 33-38% schema validity on several tasks.
  3. The Workflow Collapse: Most notably, CrewAI suffered a total structural collapse on the "Workflow Decision" task, failing to produce a valid schema in any of its attempts for that category.

The study also found that retries are not a silver bullet. While retries helped "fragile" adapters get a valid schema eventually, they didn't necessarily make the final answer more accurate.

Limitations and Future Work

The authors are careful to note that this isn't a "league table" to crown a permanent winner.

  • Synthetic Data: The tasks used synthetic data, which might be "cleaner" than the messy documents found in the real world.
  • Model Specificity: The results are tied to GPT-4o-mini. A different model might interact differently with these frameworks.
  • Version Sensitivity: Frameworks like CrewAI and Agno move fast; a version update could change these results tomorrow.
  • Human Adjudication: The "quality" scores were automated. The authors acknowledge that a full human audit is the next step to confirm these "metric-flagged" errors are truly semantic failures.

In short: if you're building LLM workflows, don't just trust the parser. Keep an SDK baseline, validate your schemas at the application boundary, and remember that a well-formatted lie is still a lie.

Summary updated

Abstract

Large language models are increasingly used to extract records, generate SQL, summarize reports, answer policy questions, and route operational work. At these software boundaries, parseable output is necessary but does not establish task correctness. We present a reproducible benchmark protocol, a public executable artifact, and a confirmatory live API evaluation that separate structural validity from task-specific correctness across five business workflow tasks and six Python implementation conditions: PydanticAI, LangGraph, DSPy, CrewAI, Agno, and a framework-free SDK reference. We hypothesize that (H1) schema validity and task quality are separable, (H2) structured-output binding paths are heterogeneous under a shared model and lowest-common-denominator contract, and (H3) condition-by-task interactions concentrate failures rather than shifting all tasks equally. Confirmatory analysis uses distinct task instances (100 extraction and 50 per other task, with three nested replicates) under a frozen analysis plan, yielding a 5400-row primary matrix with equivalence margins and Holm-adjusted contrasts against the SDK reference. In the eligible confirmatory run, overall schema validity was 0.684 and mean automated quality was 0.638. PydanticAI, LangGraph, and DSPy retained near-ceiling schema validity with mean quality 0.91-0.94, while the plain SDK, Agno, and CrewAI conditions were substantially lower in this package and model configuration. Schema-valid rows still produced many task-score flags, especially in extraction and compliance QA, and quality residuals show strong condition-by-task interactions (including a workflow collapse for CrewAI). Labelled ablations address retry budgets and feature-using mechanisms; primary contrasts remain system-configuration findings, not causal attributions to marketed library features.
BibTeX
@misc{shapiro2026schema,
  author = {Sidney Shapiro and Sanad Al-Khatib and Aurora Pinzón Arzola and Emiliano Sebastian Gonzalez Venegas and Daniel Pearson},
  title = {{Schema-Validated LLM Workflows: A Benchmark Protocol and Comparative Evaluation Across Six Python Implementations}},
  year = {2026},
  eprint = {2611.27106},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.27106},
}
Figure