Salesforce  |  Spring '26 Feature Brief

Prompt Builder Structured Outputs: platform-enforced JSON for AI automations

The shift: stop asking the model for JSON. Declare a Lightning type and the platform guarantees parseable JSON in that shape every time.

How it works

Enable and declare the shape

Flip Response Format from Default to JSON on the prompt template.

Assign an Object-based Lightning type that declares the return fields — String, Boolean, Integer, Date, DateTime.

The platform enforces the shape. No prompt gymnastics, no stripping Markdown fences.

Where it plugs in

Flow and Apex, less plumbing

Flow: add the template as an Action — structured fields surface as variables you can map to records, Decision elements, or subflows. Zero code.

Apex: cast structuredResponse via the generated LightningTypes class. No JSON.deserialize, no wrapper classes, no try/catch for malformed strings.

Watch out for

Limits to design around

No nested objects or arrays — return lists as JSON strings, parse in Apex.

Picklists aren't native — the model can hallucinate; validate in Flow or Apex.

Types aren't versioned — editing a live type silently breaks downstream. Clone, don't mutate.

Structured ≠ accurate — always add business validation.