n8n workflow template · 9 nodes · OpenAI
Query n8n Credentials with AI SQL Agent is a free n8n workflow template that starts when a chat message is received and works with OpenAI and n8n API. It has 9 nodes, 5 of them AI nodes (Chat Trigger, Code Tool, OpenAI Chat Model and Window Buffer Memory). The notes inside the workflow say: “Instead of building a form interface like a regular person, we'll just use an AI tools agent who is given aaccess to perform queries on our database. You can ask it things like "which workflows are using slack + airtable + googlesheets?"” To run it, you add your own credentials for OpenAI API and n8n API.
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
Instead of building a form interface like a regular person, we'll just use an AI tools agent who is given aaccess to perform queries on our database. You can ask it things like "which workflows are using slack + airtable + googlesheets?"
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
We'll achieve this by querying n8n's built-in API to query all workflows, extract the credentials list from the nodes within and then store them in a SQLite database. Don't worry, the actual credential data won't be exposed! For the database, we'll abuse the fact that the code node is able to create Sqlite databases - however, this is created in memory and will be wiped if the n8n instance is restarted.
You'll need an n8n API key. Note: available workflows will be scoped to your key.
The 9 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:
Configure your own credentials after importing. Create each credential in n8n, then select it in the node.
Do you need somewhere to run it? Read our guide to self-hosted n8n.
We can adapt this workflow to your apps, data and process, then deploy and support it.
Contact Us