Animated data flow diagram

AI Agent for Querying n8n Workflow Credentials

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

OpenAI SQLite Langchain

Overview

Unlock Full Visibility into Your n8n Integration Dependencies with this AI Agent

This n8n workflow empowers you to effortlessly understand and manage how integrations are used across your automations. It operates in two stages: First, it scans your n8n instance, identifying which workflows utilize specific credential types (e.g., 'OpenAI API', 'Slack Bot Token') – rest assured, your actual secret values are never accessed or stored. This metadata is then cataloged in a temporary, local SQLite database. Second, it deploys a sophisticated AI agent, powered by OpenAI and Langchain. This agent allows you to query the cataloged information using simple, natural language questions through a chat interface, making it easy to find the workflows you need.

Key Features & Benefits

  • Automated Credential Usage Mapping: Automatically discovers and lists which credential types are used in which of your n8n workflows, providing a clear overview of your integration landscape.
  • AI-Powered Natural Language Queries: Ask questions like 'Which workflows use my Gmail account?' or 'Show me automations connecting to HubSpot and Stripe' and get instant, precise answers.
  • Effortless Dependency Tracking: Quickly identify all workflows reliant on a specific application or service. This is invaluable for managing API updates, planning migrations, or conducting security audits.
  • Streamlined Workflow Management: Saves significant time and effort compared to manually inspecting each workflow for its integrated services.
  • Intelligent & Context-Aware: The agent understands app names and can even provide direct links to the relevant n8n workflows within your instance if requested.
  • Leverages OpenAI & Langchain: Utilizes advanced Language Models for sophisticated query understanding and Langchain for robust, tool-augmented agent capabilities.
  • Secure, Temporary Catalog: Credential usage metadata is stored in a temporary SQLite database that is cleared when your n8n instance restarts. This ensures operational efficiency without long-term storage of this specific metadata.

Use Cases

  • Finding all workflows that use a 'Slack' credential before an API change.
  • Identifying automations connected to 'Google Sheets' and 'Airtable' for consolidation.
  • Quickly understanding which workflows would be impacted if an 'OpenAI' API key is revoked.
  • Auditing third-party service usage across all your n8n workflows.
  • Getting a list of workflows that use a credential named 'My Main Gmail Account'.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • An n8n API Key with permissions to read workflows. The workflows discoverable will be scoped to this key's permissions.
  • OpenAI API Key with access to a suitable model (e.g., gpt-3.5-turbo, gpt-4).
  • The n8n instance must have Python available for the Code nodes (typically standard).

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Configure the 'n8n' node: update the credential to use your n8n API Key.
  4. Configure the 'OpenAI Chat Model' node: set up your OpenAI API Key.
  5. Crucial First Step: Populate the Database. Manually execute the workflow starting from the 'When clicking "Test workflow"' trigger. This scans your workflows and builds the temporary credential usage catalog. Wait for it to complete successfully.
  6. Engage the AI Agent. Activate the 'Chat Trigger' (e.g., via its webhook URL or by using the n8n chat interface if your n8n version supports it directly with Langchain agents).
  7. Ask your questions! For example: 'Which workflows are using Slack and Airtable?', 'Find workflows with AI in their name not using OpenAI credentials', or 'List workflows that use my Stripe key'. The agent can also provide direct links to workflows in your n8n instance if you ask.
  8. Important Note: The credential catalog is stored in a temporary SQLite database. If your n8n instance restarts or the execution data is cleared, you'll need to repeat Step 5 to rebuild the catalog.

Tags:

AI AgentOpenAILangchainWorkflow ManagementAutomation AuditDeveloper ToolCredential MappingSolopreneur ToolStartup Automation

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation