{"record":{"id":"54c3de22131a0059","repo":"n8n-io/n8n","slug":"llm-doesn-t-support-withstructuredoutput","errorCode":null,"errorMessage":"LLM doesn't support withStructuredOutput","messagePattern":"LLM doesn't support withStructuredOutput","errorType":"exception","errorClass":"LLMServiceError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-workflow-builder.ee/src/chains/parameter-updater.ts","lineNumber":76,"sourceCode":"Current Parameters: {current_parameters}\n</selected_node>\n\n<requested_changes>\n{changes}\n</requested_changes>\n\nBased on the requested changes and the node's property definitions, return the complete updated parameters object.`;\n\n/**\n * Creates a parameter updater chain with dynamic prompt building\n */\nexport const createParameterUpdaterChain = (\n\tllm: BaseChatModel,\n\toptions: ParameterUpdaterOptions,\n\tlogger?: Logger,\n) => {\n\tif (typeof llm.withStructuredOutput !== 'function') {\n\t\tthrow new LLMServiceError(\"LLM doesn't support withStructuredOutput\", {\n\t\t\tllmModel: llm._llmType(),\n\t\t});\n\t}\n\n\t// Build context for registry lookups\n\tconst context = {\n\t\tnodeType: options.nodeType,\n\t\tnodeDefinition: options.nodeDefinition,\n\t\trequestedChanges: options.requestedChanges,\n\t\thasResourceLocatorParams: hasResourceLocatorParameters(options.nodeDefinition),\n\t};\n\n\t// Get matching guides and examples from registry\n\tconst guides = getMatchingGuides(context);\n\tconst examples = getMatchingExamples(context);\n\n\t// Build dynamic system prompt using PromptBuilder\n\tconst builder = createPromptBuilder()","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/src/chains/parameter-updater.ts#L58-L94","documentation":"Capability error in createParameterUpdaterChain, raised as LLMServiceError. It fires when the provided BaseChatModel does not implement withStructuredOutput (duck-typed function check), so the chain cannot extract the updated parameters object into a schema-constrained result. The model is incompatible with the chain, not malfunctioning.","triggerScenarios":"Thrown at packages/@n8n/ai-workflow-builder.ee/src/chains/parameter-updater.ts:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure a chat model that implements withStructuredOutput (most OpenAI/Anthropic/Mistral chat models do).","Check the connected model node's type — some wrappers or custom models lack structured output support.","Switch the parameter-estimation flow to a model that supports tool/structured calling."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","contentChangedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}