{"record":{"id":"075ba54941ec8b24","repo":"n8n-io/n8n","slug":"error-message-075ba5","errorCode":null,"errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.ts","lineNumber":319,"sourceCode":"\t\t\t\t});\n\t\t\t\tresponse.usage = threadRun.usage;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\toptions.preserveOriginalTools !== false &&\n\t\t\tnodeVersion >= 1.3 &&\n\t\t\t(assistantTools ?? [])?.length\n\t\t) {\n\t\t\tawait client.beta.assistants.update(assistantId, {\n\t\t\t\ttools: assistantTools,\n\t\t\t});\n\t\t}\n\t\t// Remove configuration properties and runId added by Langchain that are not relevant to the user\n\t\tfilteredResponse = omit(response, ['signal', 'timeout', 'content', 'runId']) as IDataObject;\n\t} catch (error) {\n\t\tif (!(error instanceof BaseError)) {\n\t\t\tthrow new NodeOperationError(this.getNode(), error.message, { itemIndex: i });\n\t\t}\n\t}\n\n\treturn [{ json: filteredResponse, pairedItem: { item: i } }];\n}\n","sourceCodeStart":301,"sourceCodeEnd":325,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.ts#L301-L325","documentation":"During the Assistant Message operation (v1), errors from the LangChain/OpenAI client are caught. If the error is not an instance of BaseError (OpenAI SDK's base error class), it is rethrown as a NodeOperationError with the raw error.message. This is a catch-all for non-SDK errors that bubble up during assistant run execution.","triggerScenarios":"The assistant message/run operation encounters an error that is not an OpenAI SDK BaseError — e.g. a network error, a serialization error, a LangChain internal error, or a timeout from the client library. The catch block wraps the raw message into a NodeOperationError with itemIndex context.","commonSituations":"Network connectivity issues during long assistant runs; LangChain tool execution failures that throw non-BaseError exceptions; JSON serialization errors in tool output; client-side timeout before the API returns.","solutions":["Inspect the full error.message to identify the root cause — it is the raw underlying error text","Check network connectivity and OpenAI API status","Simplify the assistant's tool configuration to isolate which tool is failing","If the error is a timeout, increase the maxToolsIterations or reduce prompt complexity"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"import { BaseError } from 'openai/error';\n\nfunction isOpenAiBaseError(error: unknown): error is BaseError {\n  return error instanceof BaseError;\n}","tryCatchPattern":"try {\n  await runAssistantMessage(this, i);\n} catch (error) {\n  if (error instanceof NodeOperationError) {\n    // Inspect error.message for root cause — it is the raw underlying error\n    console.error(`Item ${i} failed: ${error.message}`);\n    if (this.continueOnFail()) {\n      returnData.push({ json: { error: error.message }, pairedItem: { item: i } });\n      continue;\n    }\n  }\n  throw error;\n}","preventionTips":["Enable continueOnFail to collect all errors across items instead of stopping","Inspect the raw error.message for root cause identification","Test assistant tools individually to isolate which tool causes failures","Check OpenAI API status for service-side issues"],"tags":["openai","assistant","message","error-passthrough","v1"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}