Overview
Nadoo AI provides two database node types for accessing structured data within workflows:- Database Node (
database-node) — Execute SQL queries directly against connected relational databases. - Database Semantic RAG Node (
database-semantic-rag-node) — Translate natural language questions into SQL queries using LLM-powered semantic understanding.
Database Node
The Database Node executes parameterized SQL queries against a connected database and returns the results as structured data in the workflow context.Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
connection_id | string | — | ID of the database connection configured in the platform (required) |
query | string | — | SQL query with named parameters using :param syntax |
parameters | object | {} | Parameter values, supports workflow variable references |
output_variable | string | "query_results" | Context variable to store the results |
timeout_seconds | number | 30 | Maximum execution time before the query is cancelled |
Output
Parameterized Queries
Parameters can reference workflow context variables:Supported Operations
The Database Node supports read-only queries by default for safety:| Operation | Supported | Notes |
|---|---|---|
SELECT | Yes | Full query support with joins, aggregations, subqueries |
INSERT | Configurable | Must be explicitly enabled in connection settings |
UPDATE | Configurable | Must be explicitly enabled in connection settings |
DELETE | Configurable | Must be explicitly enabled in connection settings |
DDL | No | Schema modifications are never permitted through workflow nodes |
Database Semantic RAG Node
The Database Semantic RAG Node translates natural language questions into SQL queries using an LLM, executes the generated SQL, and returns the results. This enables non-technical users to query databases using plain English.How It Works
Schema Retrieval
The node retrieves the database schema (tables, columns, types, relationships) for the connected database.
Natural Language to SQL
The user’s question and the database schema are sent to an LLM, which generates a SQL query.
Query Validation
The generated SQL is validated for safety (no destructive operations) and syntactic correctness.
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
connection_id | string | — | Database connection ID (required) |
question | string | — | Natural language question to translate to SQL |
model | string | "gpt-4o" | LLM model used for SQL generation |
schema_filter.include_tables | string[] | all tables | Restrict which tables the LLM can query |
schema_filter.exclude_columns | string[] | [] | Hide sensitive columns from the LLM |
max_rows | number | 100 | Maximum number of rows to return |
output_variable | string | "semantic_results" | Context variable for the results |
Output
generated_sql so downstream nodes (or the user) can inspect exactly what query was executed.
Schema Filtering
Useschema_filter to control what the LLM sees:
include_tables— Only expose specific tables. This improves SQL generation accuracy by reducing noise and prevents the LLM from accessing tables with sensitive data.exclude_columns— Hide sensitive columns (passwords, API keys, PII) from the schema. The LLM will not reference these columns in generated queries.
Example: Data Analysis Workflow
A workflow that lets users ask questions about business data in natural language:- The user asks: “What were our top 5 products by revenue last quarter?”
- Semantic RAG Node generates and executes the SQL query.
- Condition Node checks if any results were returned.
- AI Agent Node summarizes the tabular results into a natural language response with insights.
Database Connections
Database connections are configured at the platform level and referenced byconnection_id in workflow nodes. Supported databases include:
| Database | Connection String Format |
|---|---|
| PostgreSQL | postgresql://user:pass@host:5432/dbname |
| MySQL | mysql://user:pass@host:3306/dbname |
| SQLite | sqlite:///path/to/database.db |
Database connections are managed in Settings > Database Connections in the platform UI. Connection credentials are encrypted at rest.
Best Practices
Always use parameterized queries
Always use parameterized queries
Never concatenate user input directly into SQL strings. Use the
:param syntax and the parameters object to prevent SQL injection.Filter schemas for Semantic RAG
Filter schemas for Semantic RAG
The fewer tables and columns the LLM sees, the more accurate the generated SQL will be. Always use
schema_filter to expose only the tables relevant to the workflow’s purpose.Set reasonable timeouts and row limits
Set reasonable timeouts and row limits
Prevent runaway queries with
timeout_seconds and max_rows. A query that returns 10,000 rows will overwhelm the workflow context and downstream LLM processing.Validate Semantic RAG output
Validate Semantic RAG output
The generated SQL may not always be correct. For critical workflows, add a review step where the user can confirm the generated query before execution, or use a Condition Node to verify result reasonableness.