AI Model Usage Auditor for Internal Workflows - n8n Workflow

Use this powerful n8n workflow to audit all your active workflows, identify which AI models are in use across every n8n node, and centralize the data in Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Technical Administrators managing a large n8n instance.

  • Automation Specialists needing to track AI consumption (e.g., GPT-4 vs. Llama).

  • Teams evaluating the performance and cost associated with different AI models across their active n8n workflow templates.

  • Users looking for advanced examples of using the n8n API to manage their self-hosted n8n instance.

Overview

Managing numerous automation flows can make it difficult to track the specific AI models utilized within each n8n node configuration. This n8n workflow solves this problem by leveraging the n8n API to systematically inspect the JSON structure of every deployed workflow. By filtering for the presence of 'modelId' or 'model' parameters, this n8n template accurately captures which AI services (like OpenAI, LocalAI, etc.) are in use, down to the individual n8n node. The consolidated results—including the workflow name, node name, and the specific model—are then neatly organized and saved into a Google Sheet for easy monitoring and reporting. This ensures comprehensive oversight of your AI automation environment.

How it Works

The process begins with a manual n8n trigger, initiating the automation. First, the Google Sheets node clears the output sheet to ensure fresh data collection. Next, the dedicated n8n node uses the internal n8n API credential to retrieve all active workflows within the instance. A subsequent Filter node checks the raw workflow JSON to identify only those workflows that contain any reference to 'modelId'—a common indicator of an AI n8n node. These filtered workflows are then passed to the Split in Batches node, processing them individually. Inside the loop, the Split Out node breaks down the workflow structure into individual n8n node items. The next Filter node specifically targets each n8n node item, looking for the existence of parameters.modelId or parameters.model. If an AI model reference is found, the Set node meticulously extracts key information: the specific n8n node name, the extracted AI model name/ID, the parent workflow name, and a constructed direct link (which must be updated with your n8n domain). Finally, this detailed audit data is appended row-by-row to the specified Google Sheet using the Google Sheets node, completing the execution of this crucial n8n workflow.

Installation Guide


  1. Import: Download this n8n workflow JSON and import it into your n8n instance via the 'Workflows' screen.

  2. Credentials: You need two sets of credentials:

a. n8n API Credential: Configure an n8n API credential to allow this workflow to read data from other workflows on the same instance.
b. Google Sheets Credential: Set up a Google Sheets OAuth2 credential, ensuring it has access to the spreadsheet where the results will be saved.

  1. Google Sheet Setup: Create a new Google Sheet document. Update the Document ID and Sheet Name parameters in both Google Sheets n8n node configurations (Google Sheets-Clear Sheet Data and Google Sheets-Save node and workflow data).

  2. Domain Update (Crucial): Open the Edit Fields-setmodeldata n8n node. Review the workflow_url expression. You must replace {Your-n8n-domain} with your actual n8n instance URL (e.g., https://my.n8n.app).

  3. Execution: Run the n8n workflow by clicking the 'Test workflow' button on the Manual n8n trigger.

Node Details

When clicking ‘Test workflow’ (Manual Trigger): The starting n8n trigger. This allows manual initiation of the n8n workflow to run the audit.
n8n-get all workflow (n8n Node): Function: Connects to the local n8n API to retrieve a list of all current workflows and their underlying JSON structures.
Filter-get workflow contain modelid (Filter Node): Function: Filters the retrieved workflows. It uses a conditional expression ($json.nodes.toJsonString() contains 'modelId') to quickly identify potential AI workflows. It also excludes this audit n8n workflow itself.
Loop Over Items (Split In Batches Node): Function: Prepares the filtered list of workflows for sequential processing.
Split Out-nodes (Split Out Node): Function: Splits the JSON object for a single workflow into individual items, one for each n8n node defined within that workflow.
Filter-node contain modelId (Filter Node): Function: Isolates individual n8n nodes that contain model configuration parameters (parameters.modelId or parameters.model). This is essential for locating the AI model name used by that specific n8n node.
Edit Fields-setmodeldata (Set Node): Function: Formats the output data. It constructs fields like nodename, workflowname, and extracts the model parameter value, using fallbacks ($json?.parameters?.model?.value || $json?.parameters?.model) to handle variations in n8n node configuration.
Google Sheets-Clear Sheet Data & Google Sheets-Save node and workflow data (Google Sheets Node): Function: Manages the output data storage. The first instance clears the target spreadsheet; the second appends the model usage data collected by the n8n workflow.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by

Martech Engineer with automation. here is my website: https://www.darrelltw.com/

Featured*