feat: add folder support for workflows (fixes #70)
This commit is contained in:
@@ -0,0 +1,167 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "d08a2559-17fd-4bdb-a976-795c3823a88a",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-520,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## Try me out\nClick the 'chat' button at the bottom of the canvas and paste in:\n\n_Which tables are available?_"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3019b559-6100-4ead-8e1a-a7dece2a6982",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 677,
|
||||
"height": 505,
|
||||
"content": "This workflow uses a Postgres DB, but you could swap it for a MySQL or SQLite one"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "73786411-5383-4921-82ee-06b3b582bab7",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-320,
|
||||
40
|
||||
],
|
||||
"webhookId": "1c0d08f0-abd0-4bdc-beef-370c27aae1a0",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "e65a1558-e0c0-4c4a-a306-90dc6dcb618a",
|
||||
"name": "Postgres",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
140,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"query": "{{ $fromAI('sql_statement') }}",
|
||||
"options": {},
|
||||
"operation": "executeQuery"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "elRn5sxKOfCdlEs6",
|
||||
"name": "Postgres account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "9df537e7-3ca2-4e72-bc85-ae0d944fbdd1",
|
||||
"name": "Simple Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
0,
|
||||
260
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "57b2b959-9f25-475f-b6bb-842139725411",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-100,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.8
|
||||
},
|
||||
{
|
||||
"id": "f21ac2dc-56ff-4ea6-a29e-168e7dfaf3fa",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-160,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Postgres": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simple Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "0a4e65b7-39be-44eb-8c66-913ebfe8a87a",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1140,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 215,
|
||||
"height": 80,
|
||||
"content": "**Replace password and username for Supabase**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2cea21fc-f3fe-47b7-a7b6-12acb0bc03ac",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-160,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 280.2462120317618,
|
||||
"height": 545.9087885077763,
|
||||
"content": "### Set up steps\n\n#### Preparation\n1. **Create Accounts**:\n - [N8N](https://n8n.partnerlinks.io/2hr10zpkki6a): For workflow automation.\n - [Supabase](https://supabase.com/): For database hosting and management.\n - [OpenAI](https://openai.com/): For building the conversational AI agent.\n2. **Configure Database Connection**:\n - Set up a PostgreSQL database in Supabase.\n - Use appropriate credentials (`username`, `password`, `host`, and `database` name) in your workflow.\n\n#### N8N Workflow\n\nAI agent with tools:\n\n1. **Code Tool**:\n - Execute SQL queries based on user input.\n2. **Database Schema Tool**:\n - Retrieve a list of all tables in the database.\n - Use a predefined SQL query to fetch table definitions, including column names, types, and references.\n3. **Table Definition**:\n - Retrieve a list of columns with types for one table."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eacc0c8c-11d5-44fb-8ff1-10533a233693",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-160,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 636.2128494576581,
|
||||
"height": 497.1532689930921,
|
||||
"content": "\n## AI Agent to chat with Supabase/PostgreSQL DB\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\n\nAccessing and analyzing database data often requires SQL expertise or dedicated reports, which can be time-consuming. This workflow empowers users to interact with a database conversationally through an AI-powered agent. It dynamically generates SQL queries based on user requests, streamlining data retrieval and analysis.\n\nThis workflow integrates OpenAI with a Supabase database, enabling users to interact with their data via an AI agent. The agent can:\n- Retrieve records from the database.\n- Extract and analyze JSON data stored in tables.\n- Provide summaries, aggregations, or specific data points based on user queries.\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "be1559ea-1f75-4e7c-9bdd-3add8d8be70b",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
140,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 330.5152611046425,
|
||||
"height": 239.5888196628349,
|
||||
"content": "### ... or watch set up video [20 min]\n[](https://www.youtube.com/watch?v=-GgKzhCNxjk)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4ea87754-dead-49ea-848c-ed86c98e217b",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
720,
|
||||
400
|
||||
],
|
||||
"webhookId": "6e95bc27-99a6-417c-8bf7-2831d7f7a4be",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "c20d6e57-eb41-4682-a7f5-5bb4323df476",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
760,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "zJhr5piyEwVnWtaI",
|
||||
"name": "OpenAi club"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8d3b1faf-643c-4070-996d-a59cb06e1827",
|
||||
"name": "DB Schema",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1180,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT table_schema, table_name\nFROM information_schema.tables\nWHERE table_type = 'BASE TABLE' AND table_schema = 'public';",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get list of all tables in database"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "d9346ade-79d1-44c2-8fa6-b337ad8b0544",
|
||||
"name": "Get table definition",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1340,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT \n c.column_name,\n c.data_type,\n c.is_nullable,\n c.column_default,\n tc.constraint_type,\n ccu.table_name AS referenced_table,\n ccu.column_name AS referenced_column\nFROM \n information_schema.columns c\nLEFT JOIN \n information_schema.key_column_usage kcu \n ON c.table_name = kcu.table_name \n AND c.column_name = kcu.column_name\nLEFT JOIN \n information_schema.table_constraints tc \n ON kcu.constraint_name = tc.constraint_name\n AND tc.constraint_type = 'FOREIGN KEY'\nLEFT JOIN\n information_schema.constraint_column_usage ccu\n ON tc.constraint_name = ccu.constraint_name\nWHERE \n c.table_name = '{{ $fromAI(\"table_name\") }}' -- Your table name\n AND c.table_schema = 'public' -- Ensure it's in the right schema\nORDER BY \n c.ordinal_position;\n",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get table definition to find all columns and types."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "b88a21e0-d2ff-4431-bd84-dfd43edeb5c4",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
960,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"width": 215,
|
||||
"height": 80,
|
||||
"content": "**Finetune the prompt of assistant**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fbe9eb68-5990-485c-820f-08234ea33194",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
940,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $('When chat message received').item.json.chatInput }}",
|
||||
"agent": "openAiFunctionsAgent",
|
||||
"options": {
|
||||
"systemMessage": "You are DB assistant. You need to run queries in DB aligned with user requests.\n\nRun custom SQL query to aggregate data and response to user.\n\nFetch all data to analyse it for response if needed.\n"
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "7f82d6d9-d7d6-4443-bbaa-c9b276a376e3",
|
||||
"name": "Run SQL Query",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1040,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "{{ $fromAI(\"query\",\"SQL query for PostgreSQL DB in Supabase\") }}",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Run custom SQL queries using knowledge about Output structure to provide needed response for user request.\nUse ->> operator to extract JSON data."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"DB Schema": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Run SQL Query": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get table definition": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "0a4e65b7-39be-44eb-8c66-913ebfe8a87a",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1140,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 215,
|
||||
"height": 80,
|
||||
"content": "**Replace password and username for Supabase**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2cea21fc-f3fe-47b7-a7b6-12acb0bc03ac",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-160,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 280.2462120317618,
|
||||
"height": 545.9087885077763,
|
||||
"content": "### Set up steps\n\n#### Preparation\n1. **Create Accounts**:\n - [N8N](https://n8n.partnerlinks.io/2hr10zpkki6a): For workflow automation.\n - [Supabase](https://supabase.com/): For database hosting and management.\n - [OpenAI](https://openai.com/): For building the conversational AI agent.\n2. **Configure Database Connection**:\n - Set up a PostgreSQL database in Supabase.\n - Use appropriate credentials (`username`, `password`, `host`, and `database` name) in your workflow.\n\n#### N8N Workflow\n\nAI agent with tools:\n\n1. **Code Tool**:\n - Execute SQL queries based on user input.\n2. **Database Schema Tool**:\n - Retrieve a list of all tables in the database.\n - Use a predefined SQL query to fetch table definitions, including column names, types, and references.\n3. **Table Definition**:\n - Retrieve a list of columns with types for one table."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eacc0c8c-11d5-44fb-8ff1-10533a233693",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-160,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 636.2128494576581,
|
||||
"height": 497.1532689930921,
|
||||
"content": "\n## AI Agent to chat with Supabase/PostgreSQL DB\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\n\nAccessing and analyzing database data often requires SQL expertise or dedicated reports, which can be time-consuming. This workflow empowers users to interact with a database conversationally through an AI-powered agent. It dynamically generates SQL queries based on user requests, streamlining data retrieval and analysis.\n\nThis workflow integrates OpenAI with a Supabase database, enabling users to interact with their data via an AI agent. The agent can:\n- Retrieve records from the database.\n- Extract and analyze JSON data stored in tables.\n- Provide summaries, aggregations, or specific data points based on user queries.\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "be1559ea-1f75-4e7c-9bdd-3add8d8be70b",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
140,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 330.5152611046425,
|
||||
"height": 239.5888196628349,
|
||||
"content": "### ... or watch set up video [20 min]\n[](https://www.youtube.com/watch?v=-GgKzhCNxjk)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4ea87754-dead-49ea-848c-ed86c98e217b",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
720,
|
||||
400
|
||||
],
|
||||
"webhookId": "6e95bc27-99a6-417c-8bf7-2831d7f7a4be",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "c20d6e57-eb41-4682-a7f5-5bb4323df476",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
760,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "zJhr5piyEwVnWtaI",
|
||||
"name": "OpenAi club"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8d3b1faf-643c-4070-996d-a59cb06e1827",
|
||||
"name": "DB Schema",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1180,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT table_schema, table_name\nFROM information_schema.tables\nWHERE table_type = 'BASE TABLE' AND table_schema = 'public';",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get list of all tables in database"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "d9346ade-79d1-44c2-8fa6-b337ad8b0544",
|
||||
"name": "Get table definition",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1340,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT \n c.column_name,\n c.data_type,\n c.is_nullable,\n c.column_default,\n tc.constraint_type,\n ccu.table_name AS referenced_table,\n ccu.column_name AS referenced_column\nFROM \n information_schema.columns c\nLEFT JOIN \n information_schema.key_column_usage kcu \n ON c.table_name = kcu.table_name \n AND c.column_name = kcu.column_name\nLEFT JOIN \n information_schema.table_constraints tc \n ON kcu.constraint_name = tc.constraint_name\n AND tc.constraint_type = 'FOREIGN KEY'\nLEFT JOIN\n information_schema.constraint_column_usage ccu\n ON tc.constraint_name = ccu.constraint_name\nWHERE \n c.table_name = '{{ $fromAI(\"table_name\") }}' -- Your table name\n AND c.table_schema = 'public' -- Ensure it's in the right schema\nORDER BY \n c.ordinal_position;\n",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get table definition to find all columns and types."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "b88a21e0-d2ff-4431-bd84-dfd43edeb5c4",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
960,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"width": 215,
|
||||
"height": 80,
|
||||
"content": "**Finetune the prompt of assistant**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fbe9eb68-5990-485c-820f-08234ea33194",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
940,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $('When chat message received').item.json.chatInput }}",
|
||||
"agent": "openAiFunctionsAgent",
|
||||
"options": {
|
||||
"systemMessage": "You are DB assistant. You need to run queries in DB aligned with user requests.\n\nRun custom SQL query to aggregate data and response to user.\n\nFetch all data to analyse it for response if needed.\n"
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "7f82d6d9-d7d6-4443-bbaa-c9b276a376e3",
|
||||
"name": "Run SQL Query",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1040,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "{{ $fromAI(\"query\",\"SQL query for PostgreSQL DB in Supabase\") }}",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Run custom SQL queries using knowledge about Output structure to provide needed response for user request.\nUse ->> operator to extract JSON data."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"DB Schema": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Run SQL Query": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get table definition": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
{
|
||||
"id": "eOUewYsEzJmQixI6",
|
||||
"meta": {
|
||||
"instanceId": "77c4feba8f41570ef06dc76ece9a6ded0f0d44f7f1477a64c2d71a8508c11faa",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Chat with Postgresql Database",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "6501a54f-a68c-452d-b353-d7e871ca3780",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-300,
|
||||
-80
|
||||
],
|
||||
"webhookId": "cf1de04f-3e38-426c-89f0-3bdb110a5dcf",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "cd32221b-2a36-408d-b57e-8115fcd810c9",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
0,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"agent": "openAiFunctionsAgent",
|
||||
"options": {
|
||||
"systemMessage": "You are DB assistant. You need to run queries in DB aligned with user requests.\n\nRun custom SQL query to aggregate data and response to user. Make sure every table has schema prefix to it in sql query which you can get from `Get DB Schema and Tables List` tool.\n\nFetch all data to analyse it for response if needed.\n\n## Tools\n\n- Execute SQL query - Executes any sql query generated by AI\n- Get DB Schema and Tables List - Lists all the tables in database with its schema name\n- Get Table Definition - Gets the table definition from db using table name and schema name"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "8accbeeb-7eaf-4e9e-aabc-de8ab3a0459b",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-60,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "48uG61Ilo8jndw3r",
|
||||
"name": "Your OpenAI Account Credentials"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "11f2013f-a080-4c9e-8773-c90492e2c628",
|
||||
"name": "Get Table Definition",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
780,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"query": "select\n c.column_name,\n c.data_type,\n c.is_nullable,\n c.column_default,\n tc.constraint_type,\n ccu.table_name AS referenced_table,\n ccu.column_name AS referenced_column\nfrom\n information_schema.columns c\nLEFT join\n information_schema.key_column_usage kcu\n ON c.table_name = kcu.table_name\n AND c.column_name = kcu.column_name\nLEFT join\n information_schema.table_constraints tc\n ON kcu.constraint_name = tc.constraint_name\n AND tc.constraint_type = 'FOREIGN KEY'\nLEFT join\n information_schema.constraint_column_usage ccu\n ON tc.constraint_name = ccu.constraint_name\nwhere\n c.table_name = '{{ $fromAI(\"table_name\") }}'\n AND c.table_schema = '{{ $fromAI(\"schema_name\") }}'\norder by\n c.ordinal_position",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get table definition to find all columns and types"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "nGI61D0TEEZz18rr",
|
||||
"name": "Your Postgresql Database Credentials"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "760bc9bc-0057-4088-b3f0-3ee37b3519df",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-300,
|
||||
-240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 560,
|
||||
"height": 120,
|
||||
"content": "### \ud83d\udc68\u200d\ud83c\udfa4 Setup\n1. Add your **postgresql** and **OpenAI** credentials.\n2. Click **Chat** button and start asking questions to your database.\n3. Activate the workflow and you can make the chat publicly available."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0df33341-c859-4a54-b6d9-a99670e8d76d",
|
||||
"name": "Chat History",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
120,
|
||||
160
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "4938b22e-f187-4ca0-b9f1-60835e823799",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
360,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 562,
|
||||
"height": 156,
|
||||
"content": "\ud83d\udee0\ufe0f Tools Used:\n1. Execute SQL Query: Used to execute any query generated by the agent.\n2. Get DB Schema and Tables List: It returns the list of all the tables with its schema name.\n3. Get Table Definition: It returns table details like column names, foreign keys and more of a particular table in a schema."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "39780c78-4fbc-403e-a220-aa6a4b06df8c",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-100,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 162,
|
||||
"height": 99,
|
||||
"content": "\ud83d\udc46 You can exchange this with any other chat model of your choice."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "28a5692c-5003-46cb-9a09-b7867734f446",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
100,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 162,
|
||||
"height": 159,
|
||||
"content": "\ud83d\udc46 You can change how many number of messages to keep using `Context Window Length` option. It's 5 by default."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c18ced71-6330-4ba0-9c52-1bb5852b3039",
|
||||
"name": "Execute SQL Query",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
380,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"query": "{{ $fromAI(\"sql_query\", \"SQL Query\") }}",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get all the data from Postgres, make sure you append the tables with correct schema. Every table is associated with some schema in the database."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "nGI61D0TEEZz18rr",
|
||||
"name": "Your Postgresql Database Credentials"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "557623c6-e499-48a6-a066-744f64f8b6f3",
|
||||
"name": "Get DB Schema and Tables List",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
580,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT \n table_schema,\n table_name\nFROM information_schema.tables\nWHERE table_type = 'BASE TABLE'\n AND table_schema NOT IN ('pg_catalog', 'information_schema')\nORDER BY table_schema, table_name;",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get list of all tables with their schema in the database"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "nGI61D0TEEZz18rr",
|
||||
"name": "Your Postgresql Database Credentials"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "10c7c74e-b383-4ac7-8cb2-c9a15a2818fe",
|
||||
"connections": {
|
||||
"Chat History": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute SQL Query": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Table Definition": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get DB Schema and Tables List": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
{
|
||||
"id": "eOUewYsEzJmQixI6",
|
||||
"meta": {
|
||||
"instanceId": "77c4feba8f41570ef06dc76ece9a6ded0f0d44f7f1477a64c2d71a8508c11faa",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Chat with Postgresql Database",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "6501a54f-a68c-452d-b353-d7e871ca3780",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-300,
|
||||
-80
|
||||
],
|
||||
"webhookId": "cf1de04f-3e38-426c-89f0-3bdb110a5dcf",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "cd32221b-2a36-408d-b57e-8115fcd810c9",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
0,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"agent": "openAiFunctionsAgent",
|
||||
"options": {
|
||||
"systemMessage": "You are DB assistant. You need to run queries in DB aligned with user requests.\n\nRun custom SQL query to aggregate data and response to user. Make sure every table has schema prefix to it in sql query which you can get from `Get DB Schema and Tables List` tool.\n\nFetch all data to analyse it for response if needed.\n\n## Tools\n\n- Execute SQL query - Executes any sql query generated by AI\n- Get DB Schema and Tables List - Lists all the tables in database with its schema name\n- Get Table Definition - Gets the table definition from db using table name and schema name"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "8accbeeb-7eaf-4e9e-aabc-de8ab3a0459b",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-60,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "48uG61Ilo8jndw3r",
|
||||
"name": "Your OpenAI Account Credentials"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "11f2013f-a080-4c9e-8773-c90492e2c628",
|
||||
"name": "Get Table Definition",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
780,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"query": "select\n c.column_name,\n c.data_type,\n c.is_nullable,\n c.column_default,\n tc.constraint_type,\n ccu.table_name AS referenced_table,\n ccu.column_name AS referenced_column\nfrom\n information_schema.columns c\nLEFT join\n information_schema.key_column_usage kcu\n ON c.table_name = kcu.table_name\n AND c.column_name = kcu.column_name\nLEFT join\n information_schema.table_constraints tc\n ON kcu.constraint_name = tc.constraint_name\n AND tc.constraint_type = 'FOREIGN KEY'\nLEFT join\n information_schema.constraint_column_usage ccu\n ON tc.constraint_name = ccu.constraint_name\nwhere\n c.table_name = '{{ $fromAI(\"table_name\") }}'\n AND c.table_schema = '{{ $fromAI(\"schema_name\") }}'\norder by\n c.ordinal_position",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get table definition to find all columns and types"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "nGI61D0TEEZz18rr",
|
||||
"name": "Your Postgresql Database Credentials"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "760bc9bc-0057-4088-b3f0-3ee37b3519df",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-300,
|
||||
-240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 560,
|
||||
"height": 120,
|
||||
"content": "### 👨🎤 Setup\n1. Add your **postgresql** and **OpenAI** credentials.\n2. Click **Chat** button and start asking questions to your database.\n3. Activate the workflow and you can make the chat publicly available."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0df33341-c859-4a54-b6d9-a99670e8d76d",
|
||||
"name": "Chat History",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
120,
|
||||
160
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "4938b22e-f187-4ca0-b9f1-60835e823799",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
360,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 562,
|
||||
"height": 156,
|
||||
"content": "🛠️ Tools Used:\n1. Execute SQL Query: Used to execute any query generated by the agent.\n2. Get DB Schema and Tables List: It returns the list of all the tables with its schema name.\n3. Get Table Definition: It returns table details like column names, foreign keys and more of a particular table in a schema."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "39780c78-4fbc-403e-a220-aa6a4b06df8c",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-100,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 162,
|
||||
"height": 99,
|
||||
"content": "👆 You can exchange this with any other chat model of your choice."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "28a5692c-5003-46cb-9a09-b7867734f446",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
100,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 162,
|
||||
"height": 159,
|
||||
"content": "👆 You can change how many number of messages to keep using `Context Window Length` option. It's 5 by default."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c18ced71-6330-4ba0-9c52-1bb5852b3039",
|
||||
"name": "Execute SQL Query",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
380,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"query": "{{ $fromAI(\"sql_query\", \"SQL Query\") }}",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get all the data from Postgres, make sure you append the tables with correct schema. Every table is associated with some schema in the database."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "nGI61D0TEEZz18rr",
|
||||
"name": "Your Postgresql Database Credentials"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "557623c6-e499-48a6-a066-744f64f8b6f3",
|
||||
"name": "Get DB Schema and Tables List",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
580,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT \n table_schema,\n table_name\nFROM information_schema.tables\nWHERE table_type = 'BASE TABLE'\n AND table_schema NOT IN ('pg_catalog', 'information_schema')\nORDER BY table_schema, table_name;",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get list of all tables with their schema in the database"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "nGI61D0TEEZz18rr",
|
||||
"name": "Your Postgresql Database Credentials"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "10c7c74e-b383-4ac7-8cb2-c9a15a2818fe",
|
||||
"connections": {
|
||||
"Chat History": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute SQL Query": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Table Definition": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get DB Schema and Tables List": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user