
Overview
The Structured Output block allows you to define a JSON response format that the AI model uses to structure its output. This is useful when you need the model to return data in a specific schema, such as for downstream processing, API responses, reliable data extraction, or integrations. The block returns the JSON object that matches the schema. You can specify a prompt describing the data you want, and provide a JSON Schema to enforce the structure of the output. The model attempts to generate a response that matches the schema.Common use cases
- Extracting structured data from unstructured text; for example, extracting entities, tables, or key-value pairs
- Generating API responses in a specific format
- Creating objects for further automation or integration
- Enforcing data validation on AI-generated output
How it works
- Prompt: Describe the data you want the model to generate.
- JSON Schema: Define the required structure for the output. See JSON Schema for more information about how to write a JSON Schema.
- Model: Select the model to use for generation.
- Max output tokens: Set the maximum length of the output.
Examples
Data extraction from documents
This example shows how to extract structured data from unstructured documents using AI. Blueprint Flow:- UI Trigger → User selects a document from the interface
- Parse PDF tool → Extracts text from document. Note: the document must already be uploaded to the Writer cloud.
- Structured output → Extracts specific data fields
- HTTP Request → Sends structured data to external API
- Prompt: “Extract the following information from the document. Document content: @. Return the data in the following format: company name, contact person, email, phone number, and address.”
-
JSON Schema:
-
Model:
palmyra-x5

Fields
Name | Type | Control | Default | Description | Options | Validation |
---|---|---|---|---|---|---|
Prompt | Text | Textarea | - | Description of a JSON object to be created. | - | - |
Model | Model Id | - | palmyra-x5 | - | - | - |
JSON Schema | JSON | - | JSON schema that defines the structure of the response. For example, {"type": "object", "properties": {...}, "required": [...]} . | - | - | |
Max output tokens | Number | - | 1024 | - | - | Range: 1 to 16384 |
End states
Below are the possible end states of the block call.Name | Field | Type | Description |
---|---|---|---|
Success | - | success | If the function doesn’t raise an Exception. |
Error | - | error | If the function raises an Exception. |
@{result}
.