n8n

How to Audit n8n with OpenAI Credential Usage?

Find which n8n workflows use which app credentials with a simple chat. Ask plain questions and get fast answers, like which flows use Slack and Google Sheets. This helps IT and operations teams review tool usage, reduce risk, and speed up troubleshooting.

The system runs in two parts. First, a manual run pulls all workflows from the n8n API, maps each workflow id, name, and the credentials referenced in its nodes, and saves that list to a local SQLite database. Second, a chat endpoint lets you ask questions in natural language. An AI agent uses the OpenAI model and converts your question into SQL, runs it against the database, and returns a clear reply. A memory buffer keeps context across messages so follow up questions work.

You need an n8n API key and an OpenAI API key. Run the first step to build the database, then open the chat link to search your inventory. Teams can cut audit time from hours to minutes and find gaps quickly. Common uses include checking which apps are used across all flows, locating workflows with risky tools, and confirming naming and credential standards.

What are the key features?

  • Manual trigger builds a fresh inventory of all workflows on demand.
  • n8n API node lists workflows and exposes node level credential references.
  • Set node maps workflow id, name, and credentials into a clean schema.
  • Code node writes the records into a local SQLite database file.
  • Chat Trigger opens a chat endpoint to accept natural language questions.
  • OpenAI Chat Model interprets questions and drafts SQL queries.
  • Agent uses window memory to keep context for follow up questions.
  • Tool node executes SELECT queries on the credential database and returns results.

What are the benefits?

  • Reduce manual audit work from 4 hours to 10 minutes
  • Improve accuracy by 90 percent by querying a single source of truth
  • Handle 10 times more workflows than a manual review
  • Cut troubleshooting time by 50 percent by locating affected credentials fast
  • Unify credential usage data across all workflows in one place

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with OpenAI and n8n. See the Tools Required section above for links to create accounts with these services.
  3. Create an n8n API key: In your n8n user settings, generate a personal API key. Copy the base URL of your n8n instance.
  4. Open the n8n node in the canvas, choose the credential dropdown, click Create new credential, enter your base URL and API key, then save.
  5. Create OpenAI credentials: In your OpenAI account, create an API key. In n8n, open the OpenAI Chat Model node, choose the credential dropdown, click Create new credential, paste the API key, then save.
  6. Prepare the database: Click the manual Test button to run the first branch. Ensure the n8n node fetches workflows, then confirm the Save to Database node finishes without errors.
  7. Validate indexing: Use the chat later to ask How many workflows are indexed to confirm records exist.
  8. Start the chat: Open the Chat Trigger node, click Test, then open the provided URL. Ask a question like Which workflows use Slack and Google Sheets.
  9. Tune results: If matches seem low, rerun the manual step to refresh the database after recent workflow changes.
  10. Troubleshoot: If queries return empty, check that the n8n credential has the correct base URL and API key, confirm your OpenAI key is active, and verify the database file is created. After a server restart, rebuild the database with the manual step.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

n8n API

Sign up

Community Edition (self-hosted): $0 (public REST API available). Cloud Starter: $20 / mo billed annually ($24 monthly); API unavailable during free trial.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.