n8n-io/n8n · error · NodeOperationError

No data source found, please configure data source

Error message

No data source found, please configure data source

What it means

Thrown by the SQL Agent when none of the dataSource branches (sqlite/postgres/mysql) produced a non-null DataSource. This indicates an unhandled dataSource value or a connection loader silently returning null — effectively a configuration/contract violation.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts:133

						this.getNode(),
						'No binary data found, please connect a binary to the input if you want to use SQLite as data source',
					);
				}

				const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i, 'data');
				dataSource = await getSqliteDataSource.call(this, item.binary, binaryPropertyName);
			}

			if (selectedDataSource === 'postgres') {
				dataSource = await getPostgresDataSource.call(this);
			}

			if (selectedDataSource === 'mysql') {
				dataSource = await getMysqlDataSource.call(this);
			}

			if (!dataSource) {
				throw new NodeOperationError(
					this.getNode(),
					'No data source found, please configure data source',
				);
			}

			const agentOptions: SqlCreatePromptArgs = {
				topK: (options.topK as number) ?? 10,
				prefix: (options.prefixPrompt as string) ?? SQL_PREFIX,
				suffix: (options.suffixPrompt as string) ?? SQL_SUFFIX,
				inputVariables: ['chatHistory', 'input', 'agent_scratchpad'],
			};

			const dbInstance = await SqlDatabase.fromDataSourceParams({
				appDataSource: dataSource,
				includesTables: includedTablesArray.length > 0 ? includedTablesArray : undefined,
				ignoreTables: ignoredTablesArray.length > 0 ? ignoredTablesArray : undefined,
				sampleRowsInTableInfo: includedSampleRows ?? 3,
			});

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Re-open the SQL Agent node and re-select the Data Source dropdown (resets the parameter to a valid enum value).
  2. Verify the matching credential (Postgres / MySQL) is selected and valid.
  3. If using SQLite, ensure binary data is present (see error 643).
Defensive patterns

Strategy: validation

Validate before calling

const dataSource = this.getNodeParameter('dataSource', i, '') as string;
if (!['sqlite', 'postgres', 'mysql'].includes(dataSource)) {
  throw new NodeOperationError(this.getNode(), `Unsupported data source '${dataSource}'. Use sqlite, postgres, or mysql.`);
}

Type guard

function isDataSource(value: unknown): value is 'sqlite' | 'postgres' | 'mysql' {
  return typeof value === 'string' && ['sqlite', 'postgres', 'mysql'].includes(value);
}

Prevention

When it happens

Trigger: dataSource parameter set to a value other than 'sqlite' | 'postgres' | 'mysql'; or one of getSqliteDataSource/getPostgresDataSource/getMysqlDataSource returning null without throwing.

Common situations: Workflow JSON was hand-edited and dataSource holds an invalid enum value; a credential loader returned null due to a missing or malformed credential; a future dataSource option was added to the UI but not wired into execute.ts.

Related errors


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