LLM usage tracker & cost monitor with node-level analytics (v2)
LLM Cost Monitor & Usage Tracker for n8n > v2: Now it can read multiple types of LLM usages. Better dynamic approach for reading model usage. 🎯 What This Workflow Does This workflow provides comprehensive monitori...
Template notes
LLM Cost Monitor & Usage Tracker for n8n
> v2: Now it can read multiple types of LLM usages. Better dynamic approach for reading model usage.
🎯 What This Workflow Does
This workflow provides comprehensive monitoring and cost tracking for all LLM/AI agent usage across your n8n workflows. It extracts detailed token usage data from any workflow execution and calculates precise costs based on current model pricing.
The Problem It Solves When running LLM nodes in n8n workflows, the token usage and intermediate data are not directly accessible within the same workflow. This monitoring workflow bridges that gap by: - Retrieving execution data using the execution ID - Extracting all LLM usage from any nested structure - Calculating costs with customizable pricing - Providing detailed analytics per node and model - WARNING: it works after the full execution of the workflow (i.e. you can't get this data before completion of all tasks in the workflow)
⚙️ Setup Instructions
Prerequisites 1. Experience Required: Basic familiarity with n8n LLM nodes and AI agents 2. Agent Configuration: In your monitored workflows, go to agent settings and enable "Return Intermediate Steps" 3. For getting execution data, you need to set upthe n8n API in your instance (also available onthe free version)
Installation Steps 1. Import this monitoring workflow into your n8n instance 2. Go to Settings >> select n8n API from left bar >> define an API. Now you can add this as the credential for your "Get an Execution" node 3. Configure your model name mappings in the "Standardize Names" node 4. Update model pricing in the "Model Prices" node (prices per 1M tokens) 5. To monitor a workflow: - Add an "Execute Workflow" node at the end of your target workflow - Select this monitoring workflow - Important: Turn OFF "Wait For Sub-Workflow Completion" - Pass the execution ID as input