AI responses are easiest to automate when the model returns a small,
schema-defined object instead of prose.
A typical workflow sends a message, document, or image to OpenAI Chat with
Structured Output enabled. The resulting typed properties can drive
conditions, storage, and service actions.
Design the schema around decisions
Start from what later actions need. For an intake workflow, that might be:
Use enums for values that control a branch. Use nullable fields when the source
may legitimately omit a value. Avoid collecting fields no downstream action
uses.
- Add OpenAI Chat.
- Connect the source text to Prompt.
- Add images or PDFs under Files when the model must inspect them.
- Turn on Structured Output.
- Paste the JSON schema.
- Expose the detected properties you need as outputs.
Enabling Structured Output replaces the normal text Response with
Structured Response. Review existing connections when changing this
setting.
Route and validate
Connect enum outputs to conditions or case selection. Connect extracted text
only to actions that accept missing or nullable values when the schema permits
them.
For high-impact work, add deterministic validation after the model:
- check that an email address is valid,
- confirm a number is in the allowed range,
- require human review before sending or deleting,
- reject categories outside the schema,
- preserve the original source for audit and correction.
Handle failure deliberately
Enable the Chat action’s Succeeded? and Error meta outputs. Use them to
send failures to a recovery branch without treating invented fallback data as
real extraction.
A valid schema controls the response shape, not the truth of its contents.
Treat model-produced values as untrusted whenever they can spend money, modify
access, send external messages, or make irreversible changes.
Use Files and structured data for
downstream object and file handling, and
Troubleshoot workflow runs when a model or
provider request fails.