n8n-io/n8n · error · Error

Input data must contain a "input" field with the search…

Error message

Input data must contain a "input" field with the search query

What it means

Input-validation error in handleRetrieveAsToolExecuteOperation, raised as NodeOperationError. It fires when the input item at itemIndex has no string `json.input` field, so there is no search query to run against the vector store. The node expects the query to arrive in the input data, not in node parameters.

Solutions

  1. Make the item's JSON contain a string field named "input" holding the search query.
  2. Check the upstream node output: a missing, null, or non-string input field triggers this error.
  3. Map the query field to "input" with a Set node before the vector store node.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/@n8n/ai-utilities/src/utils/vector-store/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.ts:38 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/745952ef1e819a44. Report an issue: GitHub.

Appendix: source

Thrown at packages/@n8n/ai-utilities/src/utils/vector-store/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.ts:38

	itemIndex: number,
): Promise<INodeExecutionData[]> {
	const filter = getMetadataFiltersValues(context, itemIndex);
	const vectorStore = await args.getVectorStoreClient(
		context,
		// We'll pass filter to similaritySearchVectorWithScore instead of getVectorStoreClient
		undefined,
		embeddings,
		itemIndex,
	);

	try {
		// Get the search parameters - query from input data, others from node parameters
		const inputData = context.getInputData();
		const item = inputData[itemIndex];
		const query = typeof item.json.input === 'string' ? item.json.input : undefined;

		if (!query || typeof query !== 'string') {
			throw new Error('Input data must contain a "input" field with the search query');
		}

		const topK = context.getNodeParameter('topK', itemIndex, 4);
		assertParamIsNumber('topK', topK, context.getNode());
		const useReranker = context.getNodeParameter('useReranker', itemIndex, false);
		assertParamIsBoolean('useReranker', useReranker, context.getNode());

		const includeDocumentMetadata = context.getNodeParameter(
			'includeDocumentMetadata',
			itemIndex,
			true,
		);
		assertParamIsBoolean('includeDocumentMetadata', includeDocumentMetadata, context.getNode());

		// Embed the query to prepare for vector similarity search
		const embeddedQuery = await embeddings.embedQuery(query);

		// Get the most similar documents to the embedded query

View on GitHub (pinned to 5ac6606e81)