nl2sql
Configured with Agent, LM Chat Deep Seek, LM Chat Google Gemini, Memory Buffer Window, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- AI & models
- Web / API
- Trigger
- Code
- Data store
- Transform
- Routing
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| AI Agent | AI & models | Agent | See node parameters |
| DeepSeek Chat Model | AI & models | LM Chat Deep Seek | See node parameters |
| Return Final Response | Web / API | Respond To Webhook | See node parameters |
| Webhook | Trigger | Webhook | See node parameters |
| Format Success Result | Code | Code | See node parameters |
| Chat Memory Manager | Data store | Memory Manager | See node parameters |
| Format History | Code | Code | See node parameters |
| DeepSeek Chat Model1 | AI & models | LM Chat Deep Seek | See node parameters |
| Format Charts | Code | Code | See node parameters |
| Charts Agent | AI & models | Agent | See node parameters |
| Loop Entry | Transform | Edit Fields | See node parameters |
| If Can Retry | Routing | If | See node parameters |
| Format Error Prompt | Code | Code | See node parameters |
| If Error | Routing | If | See node parameters |
| Search Memory | Data store | Memory Buffer Window | See node parameters |
| Extract User Input | Code | Code | See node parameters |
| Get DB Schema | Data store | Postgres | executeQuery |
| Format Schema | Code | Code | See node parameters |
| Prepare Initial Prompt | Code | Code | See node parameters |
| Execute Generated SQL | Data store | Postgres | executeQuery |
| Insert Memory | Data store | Memory Buffer Window | See node parameters |
| If Charts | Routing | If | See node parameters |
| If Ai Error | Routing | If | See node parameters |
| Google Gemini Chat Model | AI & models | LM Chat Google Gemini | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
deepSeekApigooglePalmApipostgres
Workflow notes
自然语言 AI SQL查询
自然语言 AI SQL查询
- AI首次尝试生成SQL。
- 执行SQL,如果成功,则返回结果。
- 如果失败,将错误信息反馈给AI,让其修正。
- 最多重试3次,如果依然失败,则返回最终错误信息。
nl2sql
nl2sql
Purpose and structure
This folder contains the nl2sql workflow. Its executable nodes use agent, code, if, lmChatDeepSeek, lmChatGoogleGemini, memoryBufferWindow, memoryManager, postgres, respondToWebhook, set, webhook. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Webhook
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Wilsonoonn/n8n_nl2sql/blob/fa7c4204d690b1817aa4f916267d8a2f48c5c136/nl2sql.json Apache-2.0; preserve source notices.