Use this file to discover all available pages before exploring further.
Structured output enables your agents to return data in a predefined schema instead of free-form text. This is essential for integrating agents with databases, APIs, or any system that requires consistent data formats.
When you enable structured output, your agent will:
Process the input normally
Extract information according to your schema
Return validated, typed data matching your specification
Ensure type safety and consistency
Structured output uses runtime schema generation and validation to ensure your agents return properly formatted data.
Important: Structured output is NOT included in the conversation history array. This means structured output from previous agents is only accessible through template variables in prompts (e.g., {{ agent_name.output.field }}) and will not appear in the {{ history }} or {{ history[N] }} variables.
Enum types are not currently supported. Use str type with clear descriptions for fields that should have restricted values. Guide the LLM via your system prompt to output specific allowed values.
Use structured output to pass typed data between agents in workflows. Downstream agents can access structured outputs from previous agents using template variables in their system prompts.
{{ variables.name }} — Access custom variables (see Variables System)
{{ user_input }} — Latest user message
{{ history[N] }} — Last N messages from conversation (structured output NOT included)
Critical: Structured output is excluded from history variables. Use the specific {{ agent_name.output.field }} template variables to access structured data from previous agents.
Complex data types (lists, dicts) are automatically serialized to JSON when injected into prompts.
Clear Descriptions: Always provide detailed descriptions for each field. The agent uses these to understand what to extract.
Appropriate Types: Choose the most specific type possible. For fields with restricted values, use str type and specify allowed values in the description and system prompt.
System Prompt Alignment: Ensure your system prompt explicitly mentions the structured output requirements.
Type Validation: All output is validated against your schema. Invalid data will cause errors. Test your schemas thoroughly.
Nested Structures: For complex nested objects, consider breaking them into multiple agents or using dict types with clear descriptions.
Enable or disable structured output for this agentWhen true, the agent will return data matching the defined schema instead of free-form text.Default: true
Schema definition mapping field names to field specificationsEach key is a field name, and each value is an object with type and optional description.Required whenenabled: true
Type notation for the fieldSee Type Notation Reference for all supported types.Supported types: str, int, float, bool, list[T], dict[K, V], T | None, Optional[T], Any
Human-readable description of what this field represents (optional but strongly recommended).The agent uses this description to understand what data to extract. Be specific and clear. Fields without descriptions may produce less accurate results.
Structured output fields can be automatically mapped to system variables using variable_assignments. This creates a data pipeline: structured output → variables → downstream prompt substitution.
Variable assignments also support static values and non-structured output. The system applies automatic type coercion during variable assignment, converting strings to types like integers, booleans, or JSON arrays to ensure they match the variable’s defined type. See Variables System for details.