---
title: Structured Output
description: Folded into How It Works.
---

This material is now in [How It Works](/how-it-works#tasks-three-modes).

Schema-validation failures trigger up to 3 in-attempt repair prompts (`MAX_SCHEMA_RETRIES = 3`, with the Zod errors appended) before the attempt itself fails, so `retries={2}` (3 attempts, each 1 initial generation plus up to 3 repairs) effectively gives you up to 12 chances at valid JSON. `runId`, `nodeId`, and `iteration` are stripped from agent responses before validation and auto-populated on write.
