n8n-io/n8n · error · NodeOperationError

Input item is missing

Error message

Input item is missing

What it means

Thrown by the SearXNG tool's execute() when an input item's 'input' field is missing, not a string, or an empty string. The tool needs a search query to forward to the SearXNG instance.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/tools/ToolSearXng/ToolSearXng.node.ts:201

		],
	};

	async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {
		return {
			response: logWrapper(await getTool(this, itemIndex), this),
		};
	}

	async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
		const result: INodeExecutionData[] = [];
		const input = this.getInputData();
		for (let i = 0; i < input.length; i++) {
			const item = input[i];
			const tool = await getTool(this, i);

			const query = item.json.input;
			if (typeof query !== 'string' || query === '') {
				throw new NodeOperationError(this.getNode(), 'Input item is missing', {
					itemIndex: i,
				});
			}

			result.push({
				json: {
					response: await tool.invoke(query),
				},
				pairedItem: {
					item: i,
				},
			});
		}

		return [result];
	}
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Ensure every input item has a non-empty string in the 'input' field (e.g. map the upstream field to 'input').
  2. Add a Set/Edit Fields node before the tool to populate 'input' from the real query field.
  3. If the agent is the source, verify the tool description makes clear the input is a search string.
  4. Filter or skip empty items upstream.

Example fix

// before: upstream item { json: { query: 'cats' } } → no 'input' field → throws
// after: rename/map the field
{ json: { input: 'cats' } }
// or use a Set node: input = {{ $json.query }}
Defensive patterns

Strategy: type-guard

Validate before calling

const query = item.json.input;
if (typeof query !== 'string' || query.trim() === '') {
  throw new Error('Provide a non-empty search query in the "input" field of each item');
}

Type guard

function isNonEmptyString(v: unknown): v is string {
  return typeof v === 'string' && v.trim().length > 0;
}

Prevention

When it happens

Trigger: Feeding the SearXNG tool an item whose json has no 'input' key, or where input is a number/object/empty string; an upstream node producing items without the expected 'input' field.

Common situations: Wiring a non-agent source (e.g. a Set node) into the tool without setting an 'input' field; the agent emitting an empty query; field name mismatch (using 'query' instead of 'input').

Related errors


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