n8n-io/n8n · error
OPENAI_STRUCTURED_OUTPUT_IGNORED
OPENAI_STRUCTURED_OUTPUT_IGNORED
Error message
OpenAI node stores textFormat.textOptions as an ARRAY. At runtime the node reads that path as an object, so the JSON Schema output format is silently ignored and the node returns plain text. Store textOptions as a single object: textFormat: { textOptions: { type: "json_schema", name, schema } }. What it means
Error "OpenAI node stores textFormat.textOptions as an ARRAY. At runtime the node reads that path as an object, so the JSON Schema output format is silently ignored and the node returns plain text. Store textOptions as a single object: textFormat: { textOptions: { type: "json_schema", name, schema } }." thrown in n8n-io/n8n.
Source
Thrown at packages/@n8n/instance-ai/src/tools/workflows/detect-unparseable-openai-schema.ts:51
* - non-string schema values and unparseable JSON: the node passes the raw
* value through `jsonParse` per item and throws "Failed to parse schema";
* - non-object schema roots: the OpenAI API rejects them for structured output.
* All three are defects the builder never sees at build time otherwise.
*/
export function detectUnparseableOpenAiSchema(json: WorkflowJSON): ValidationWarning[] {
const warnings: ValidationWarning[] = [];
for (const node of json.nodes ?? []) {
if (node.type !== OPENAI_NODE_TYPE) continue;
const params = node.parameters;
if (!isRecord(params)) continue;
const resolved = getTextOptions(params);
if (!resolved || resolved.options.type !== 'json_schema') continue;
const nodeName = typeof node.name === 'string' ? node.name : undefined;
if (resolved.storedAsArray) {
warnings.push({
code: 'OPENAI_STRUCTURED_OUTPUT_IGNORED',
nodeName,
message:
'OpenAI node stores textFormat.textOptions as an ARRAY. At runtime the node reads that path as an object, ' +
'so the JSON Schema output format is silently ignored and the node returns plain text. ' +
'Store textOptions as a single object: textFormat: { textOptions: { type: "json_schema", name, schema } }.',
});
continue;
}
const schema = resolved.options.schema;
if (schema === undefined || schema === null) continue;
// n8n treats a value as an expression only when its FIRST character is '='.
if (typeof schema === 'string' && schema.startsWith('=')) continue;
if (typeof schema === 'string' && schema.trim().length === 0) continue;
if (typeof schema !== 'string') {
warnings.push({
code: 'OPENAI_STRUCTURED_OUTPUT_SCHEMA_INVALID',View on GitHub (pinned to 5ac6606e81)
When it happens
Trigger: Thrown at packages/@n8n/instance-ai/src/tools/workflows/detect-unparseable-openai-schema.ts:51 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/d623cbb061e6a26c.
Report an issue: GitHub.