{"record":{"id":"b981bf2d51942dfe","repo":"n8n-io/n8n","slug":"error-during-parsing-of-llm-output-please-check-y","errorCode":null,"errorMessage":"Error during parsing of LLM output, please check your LLM model and configuration","messagePattern":"Error during parsing of LLM output, please check your LLM model and configuration","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.ts","lineNumber":418,"sourceCode":"\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (sentimentIndex !== -1) {\n\t\t\t\t\t\t\tconst resultItem = { ...items[i] };\n\t\t\t\t\t\t\tconst sentimentAnalysis: IDataObject = {\n\t\t\t\t\t\t\t\tcategory: output.sentiment,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (options.includeDetailedResults) {\n\t\t\t\t\t\t\t\tsentimentAnalysis.strength = output.strength;\n\t\t\t\t\t\t\t\tsentimentAnalysis.confidence = output.confidence;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresultItem.json = {\n\t\t\t\t\t\t\t\t...resultItem.json,\n\t\t\t\t\t\t\t\tsentimentAnalysis,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturnData[sentimentIndex].push(resultItem);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t'Error during parsing of LLM output, please check your LLM model and configuration',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemIndex: i,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (this.continueOnFail()) {\n\t\t\t\t\t\tconst executionErrorData = this.helpers.constructExecutionMetaData(\n\t\t\t\t\t\t\tthis.helpers.returnJsonArray({ error: error.message }),\n\t\t\t\t\t\t\t{ itemData: { item: i } },\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturnData[0].push(...executionErrorData);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t}","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.ts#L400-L436","documentation":"A generic NodeOperationError thrown by the Sentiment Analysis node's catch block when the inner try (LLM call + structured-output parsing) throws for any reason. It masks the underlying cause with a generic 'check your LLM model and configuration' message, recorded with itemIndex.","triggerScenarios":"Any exception inside the sentiment-analysis per-item block: the LLM call fails, the StructuredOutputParser cannot coerce the output, a network/auth error occurs, or the model returns malformed text. The outer catch wraps it as this generic NodeOperationError.","commonSituations":"LLM API key invalid or rate-limited; model does not support the requested output schema; weak model returns free text; transient network error; temperature too high producing unparseable output.","solutions":["Enable Continue On Fail so the failing item returns an error JSON without aborting the run.","Check the underlying error by temporarily removing the outer try/catch or logging response.reason before the rethrow.","Verify the connected chat model is valid, has valid credentials, and supports structured output.","Use a stronger instruction-following model and/or lower temperature.","Retry on transient network errors using the node's retry settings."],"exampleFix":"// before — original cause is lost\n} catch (error) {\n  throw new NodeOperationError(this.getNode(), 'Error during parsing of LLM output, please check your LLM model and configuration', { itemIndex: i });\n}\n\n// after — preserve the cause for diagnosis\n} catch (error) {\n  throw new NodeOperationError(this.getNode(), {\n    message: 'Error during parsing of LLM output, please check your LLM model and configuration',\n    itemIndex: i,\n    cause: error,\n  });\n}","handlingStrategy":"try-catch","validationCode":"// Pre-flight: verify model + credentials\nif (!llm) throw new Error('Connect a chat model with valid credentials');","typeGuard":null,"tryCatchPattern":"try {\n  const out = await parser.parse(llmResult);\n} catch (e) {\n  // Preserve the cause and continue per-item rather than aborting\n  resultData.push({ json: { error: (e as Error).message }, pairedItem: { item: i } });\n}","preventionTips":["Enable Continue On Fail so one bad item does not abort the run.","Use a model that follows JSON schema reliably.","Keep credentials and API access valid; handle rate limits.","Lower temperature to reduce output variability."],"tags":["llm-output","parsing","sentiment-analysis","error-wrapping"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}