{"record":{"id":"3a30c7e998a74374","repo":"n8n-io/n8n","slug":"the-text-parameter-is-empty","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/ConversationalAgent/execute.ts","lineNumber":95,"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":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts#L77-L113","documentation":"Thrown by the Conversational Agent execute loop when the resolved input/prompt text is undefined. The node reads 'text' either directly (typeVersion <= 1.2) or via getPromptInputByType for newer versions; if the result is undefined there is no prompt to send to the agent, so execution aborts for that item.","triggerScenarios":"After resolving `input` (either getNodeParameter('text', itemIndex) or getPromptInputByType), `if (input === undefined)` throws NodeOperationError with the message 'The \\u2018text parameter is empty.' (note the literal curly quote). Fires when the text/prompt field is unset, references an expression that yields undefined, or the input key is misconfigured.","commonSituations":"Empty 'text' / prompt field on the node; an expression like {{$json.missingField}} that resolves to undefined; item without the field the prompt references; switching promptType without providing the corresponding input value.","solutions":["Provide a non-empty value (or a valid expression) in the node's text/prompt field.","Ensure referenced fields exist on the incoming item, or default them with a Set node upstream.","Use a fallback expression that yields a safe default instead of undefined, e.g. {{$json.prompt || 'default'}}."],"exampleFix":"// before: text = {{$json.nonExistent}}  -> undefined\n// after: text = {{$json.prompt || 'Summarize the following: ' + $json.input}}","handlingStrategy":"validation","validationCode":"const input = getPromptInputByType({ ctx, i, inputKey: 'text', promptTypeKey: 'promptType' });\nif (input === undefined || input === '') throw new Error('Provide a non-empty prompt');","typeGuard":"function hasPromptText(s): s is string { return typeof s === 'string' && s.length > 0; }","tryCatchPattern":null,"preventionTips":["Provide a literal or expression that always yields a non-empty string.","Default missing fields with a Set node upstream (e.g. {{$json.prompt || '...'}}).","Verify referenced fields exist on the incoming item."],"tags":["agent","conversational-agent","prompt","validation"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}