{"record":{"id":"eb7a49b174c006e4","repo":"n8n-io/n8n","slug":"input-item-is-missing","errorCode":null,"errorMessage":"Input item is missing","messagePattern":"Input item is missing","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/tools/ToolSearXng/ToolSearXng.node.ts","lineNumber":201,"sourceCode":"\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\treturn {\n\t\t\tresponse: logWrapper(await getTool(this, itemIndex), this),\n\t\t};\n\t}\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst result: INodeExecutionData[] = [];\n\t\tconst input = this.getInputData();\n\t\tfor (let i = 0; i < input.length; i++) {\n\t\t\tconst item = input[i];\n\t\t\tconst tool = await getTool(this, i);\n\n\t\t\tconst query = item.json.input;\n\t\t\tif (typeof query !== 'string' || query === '') {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Input item is missing', {\n\t\t\t\t\titemIndex: i,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tresult.push({\n\t\t\t\tjson: {\n\t\t\t\t\tresponse: await tool.invoke(query),\n\t\t\t\t},\n\t\t\t\tpairedItem: {\n\t\t\t\t\titem: i,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\treturn [result];\n\t}\n}\n","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/tools/ToolSearXng/ToolSearXng.node.ts#L183-L219","documentation":"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.","triggerScenarios":"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.","commonSituations":"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').","solutions":["Ensure every input item has a non-empty string in the 'input' field (e.g. map the upstream field to 'input').","Add a Set/Edit Fields node before the tool to populate 'input' from the real query field.","If the agent is the source, verify the tool description makes clear the input is a search string.","Filter or skip empty items upstream."],"exampleFix":"// before: upstream item { json: { query: 'cats' } } → no 'input' field → throws\n// after: rename/map the field\n{ json: { input: 'cats' } }\n// or use a Set node: input = {{ $json.query }}","handlingStrategy":"type-guard","validationCode":"const query = item.json.input;\nif (typeof query !== 'string' || query.trim() === '') {\n  throw new Error('Provide a non-empty search query in the \"input\" field of each item');\n}","typeGuard":"function isNonEmptyString(v: unknown): v is string {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Ensure the upstream node emits an 'input' string field.","Add a Set node to map the query field to 'input'.","Filter empty items before they reach the SearXNG tool."],"tags":["searxng","ai-tool","input-validation","search"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}