Query n8n credentials with AI SQL agent
Needs changesWhat this workflow does
This AI workflow has 9 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects OpenAI Chat Model.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- n8n: uses n8n
- Workflow Credentials Helper Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 1 tool (Query Workflow Credentials Database); memory: Window Buffer Memory
- Map Workflows & Credentials (Edit Fields (Set)): sets 3 fields: workflow_id, workflow_name, credentials
- Save to Database (Code): runs custom Python code
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Workflow Credentials Helper Agent (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2024 — 25% of templates published before 2025 need changes for 3.0. See how template age affects 3.0 readiness →
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Workflow Credentials Helper Agent (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (9)
- Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Code Tool
@n8n/n8n-nodes-langchain.toolCode - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - AI Agent
@n8n/n8n-nodes-langchain.agent - n8n
n8n-nodes-base.n8n
From the author
This n8n workflow is a fun way to query and search over your credentials on your n8n instance. Good to know Your credentials should remain safe as this workflow does not decrypt or use any decrypted data. Example Usage "Which workflows are using Slack and…