n8n-io/n8n · error · NodeOperationError
The ‘prompt’ parameter is empty.
Error message
The ‘prompt’ parameter is empty.
What it means
Thrown by the SQL Agent when the resolved prompt ('input' for v1.2, or getPromptInputByType for newer) is undefined. The label says 'prompt' rather than 'text', but the underlying condition is identical to 640/641. The getPromptInputByType helper throws 'No prompt specified' first for typeVersion > 1.2, so this message is primarily reachable on the legacy branch.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts:96
const returnData: INodeExecutionData[] = [];
for (let i = 0; i < items.length; i++) {
try {
const item = items[i];
let input;
if (this.getNode().typeVersion <= 1.2) {
input = this.getNodeParameter('input', i) as string;
} else {
input = getPromptInputByType({
ctx: this,
i,
inputKey: 'text',
promptTypeKey: 'promptType',
});
}
if (input === undefined) {
throw new NodeOperationError(this.getNode(), 'The ‘prompt’ parameter is empty.');
}
const options = this.getNodeParameter('options', i, {}) as IDataObject & {
tracingMetadata?: { values?: TracingMetadataEntry[] };
};
const selectedDataSource = this.getNodeParameter('dataSource', i, 'sqlite') as
| 'mysql'
| 'postgres'
| 'sqlite';
const includedSampleRows = options.includedSampleRows as number;
const includedTablesArray = parseTablesString((options.includedTables as string) ?? '');
const ignoredTablesArray = parseTablesString((options.ignoredTables as string) ?? '');
let dataSource: DataSource | null = null;
if (selectedDataSource === 'sqlite') {
if (!item.binary) {
throw new NodeOperationError(View on GitHub (pinned to 5ac6606e81)
Solutions
- Set the prompt parameter to a non-empty natural-language question.
- Upgrade the SQL Agent node typeVersion to receive the more descriptive helper error.
- If the prompt is an expression, confirm the referenced upstream field exists.
Defensive patterns
Strategy: validation
Validate before calling
const raw = this.getNodeParameter('input', i, '') as string;
if (!raw || raw.trim() === '') {
throw new NodeOperationError(this.getNode(), 'SQL prompt is empty — provide a natural-language question.');
} Type guard
function hasPrompt(value: unknown): value is string {
return typeof value === 'string' && value.trim().length > 0;
} Try / catch
try {
input = getPromptInputByType({ ctx: this, i, inputKey: 'text', promptTypeKey: 'promptType' });
} catch (e) {
throw new NodeOperationError(this.getNode(), 'SQL prompt could not be resolved', { itemIndex: i, cause: e });
} Prevention
- Default the prompt parameter to an example question.
- Confirm upstream output schema if using an expression.
- Upgrade SQL Agent typeVersion for the descriptive helper error.
When it happens
Trigger: SQL Agent with empty 'input' parameter (v1.2) or empty text/prompt parameter (newer); expression resolving to undefined.
Common situations: SQL Agent wired to a trigger whose output schema changed; user cleared the prompt field while configuring the data source.
Related errors
- The ‘text‘ parameter is empty.
- The ‘text‘ parameter is empty.
- No binary data found, please connect a binary to the input i
- No data source found, please configure data source
- No binary data received.
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/f2b5e3cc3fde7994.
Report an issue: GitHub.