{"record":{"id":"504444e954fbe24d","repo":"n8n-io/n8n","slug":"the-text-parameter-is-empty-504444","errorCode":null,"errorMessage":"The ‘text‘ parameter is empty.","messagePattern":"The ‘text‘ parameter is empty\\.","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts","lineNumber":103,"sourceCode":"\n\tconst items = this.getInputData();\n\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\ttry {\n\t\t\tlet input;\n\n\t\t\tif (this.getNode().typeVersion <= 1.2) {\n\t\t\t\tinput = this.getNodeParameter('text', itemIndex) as string;\n\t\t\t} else {\n\t\t\t\tinput = getPromptInputByType({\n\t\t\t\t\tctx: this,\n\t\t\t\t\ti: itemIndex,\n\t\t\t\t\tinputKey: 'text',\n\t\t\t\t\tpromptTypeKey: 'promptType',\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (input === undefined) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'The ‘text‘ parameter is empty.');\n\t\t\t}\n\n\t\t\tif (prompt) {\n\t\t\t\tinput = (await prompt.invoke({ input })).value;\n\t\t\t}\n\n\t\t\tconst response = await agentExecutor\n\t\t\t\t.withConfig(tracingConfig)\n\t\t\t\t.invoke({ input, outputParser });\n\n\t\t\tif (outputParser) {\n\t\t\t\tresponse.output = await extractParsedOutput(this, outputParser, response.output as string);\n\t\t\t}\n\n\t\t\treturnData.push({ json: response });\n\t\t} catch (error) {\n\t\t\tthrowIfToolSchema(this, error);\n\t\t\tconst executionError = wrapLangChainParserError(error, this.getNode(), itemIndex);","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts#L85-L121","documentation":"Thrown by the ReAct Agent under the same conditions as 640: the prompt input resolved to undefined. Like 640, for typeVersion > 1.2 the getPromptInputByType helper throws its own 'No prompt specified' error first, so this exact message is effectively only reachable on the legacy v1.2 branch.","triggerScenarios":"ReAct Agent node (typeVersion <= 1.2) with empty 'text' parameter; expression evaluating to undefined; or a stale imported workflow missing the prompt value.","commonSituations":"Legacy workflow migrated between n8n versions; prompt bound to an upstream field that no longer exists; testing with a cleared prompt.","solutions":["Populate the 'text' parameter with a literal string or a resolvable expression.","Upgrade the ReAct Agent node to the current typeVersion to get the more actionable 'No prompt specified' message.","Verify upstream node output shape if the prompt uses an expression."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const raw = this.getNodeParameter('text', itemIndex, '') as string;\nif (!raw || raw.trim() === '') {\n  throw new NodeOperationError(this.getNode(), 'Prompt is empty — please provide input text.');\n}","typeGuard":"function hasPrompt(value: unknown): value is string {\n  return typeof value === 'string' && value.trim().length > 0;\n}","tryCatchPattern":"try {\n  input = getPromptInputByType({ ctx: this, i: itemIndex, inputKey: 'text', promptTypeKey: 'promptType' });\n} catch (e) {\n  throw new NodeOperationError(this.getNode(), 'Prompt could not be resolved for this item', { itemIndex, cause: e });\n}","preventionTips":["Provide a default value for the prompt parameter.","Verify upstream expression targets exist.","Upgrade the ReAct Agent node typeVersion."],"tags":["langchain","agent","prompt","configuration","react"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}