LLM usage tracker & cost monitor with node-level analytics (v2)
Ready for 3.0What this workflow does
This workflow has 12 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). It uses only n8n's built-in nodes.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- Get an execution (n8n): get (execution)
- Find Nodes with LLM Use (Code): runs custom JavaScript code
- Merge: merges the data from its input branches
- create models_used list (Code): runs custom JavaScript code
- Calculate cost (Code): runs custom JavaScript code
- Standardize names (Edit Fields (Set)): sets or maps fields
- model prices (Edit Fields (Set)): sets or maps fields
- Check correctly defined (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- Stop and Error: stops the run with an error
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (8)
- n8n
n8n-nodes-base.n8n - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Stop and Error
n8n-nodes-base.stopAndError - If
n8n-nodes-base.if - Merge
n8n-nodes-base.merge - Manual Trigger
n8n-nodes-base.manualTrigger
From the author
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…