n8n-io/n8n · error · NodeOperationError

${error.message}

Error message

${error.message}

What it means

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.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.ts:319

				});
				response.usage = threadRun.usage;
			}
		}

		if (
			options.preserveOriginalTools !== false &&
			nodeVersion >= 1.3 &&
			(assistantTools ?? [])?.length
		) {
			await client.beta.assistants.update(assistantId, {
				tools: assistantTools,
			});
		}
		// Remove configuration properties and runId added by Langchain that are not relevant to the user
		filteredResponse = omit(response, ['signal', 'timeout', 'content', 'runId']) as IDataObject;
	} catch (error) {
		if (!(error instanceof BaseError)) {
			throw new NodeOperationError(this.getNode(), error.message, { itemIndex: i });
		}
	}

	return [{ json: filteredResponse, pairedItem: { item: i } }];
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Inspect the full error.message to identify the root cause — it is the raw underlying error text
  2. Check network connectivity and OpenAI API status
  3. Simplify the assistant's tool configuration to isolate which tool is failing
  4. If the error is a timeout, increase the maxToolsIterations or reduce prompt complexity
Defensive patterns

Strategy: try-catch

Type guard

import { BaseError } from 'openai/error';

function isOpenAiBaseError(error: unknown): error is BaseError {
  return error instanceof BaseError;
}

Try / catch

try {
  await runAssistantMessage(this, i);
} catch (error) {
  if (error instanceof NodeOperationError) {
    // Inspect error.message for root cause — it is the raw underlying error
    console.error(`Item ${i} failed: ${error.message}`);
    if (this.continueOnFail()) {
      returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
      continue;
    }
  }
  throw error;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/075ba54941ec8b24. Report an issue: GitHub.