Track LLM Token Costs per Customer with Langchain Code Node - n8n Workflow | Neura Market
Track LLM Token Costs per Customer with Langchain Code Node
Track token usage and costs for every LLM call per customer using a custom Langchain Code node in self-hosted n8n. Logs data to Google Sheets for aggregation and billing insights.
This n8n workflow demonstrates tracking LLM token usage and costs for individual customers using the Langchain Code node, exclusively for self-hosted n8n instances. It simulates an AI service converting resume PDFs to JSON: a form trigger handles PDF uploads, followed by file extraction, field editing for metadata, and an Information Extractor node with a custom LLM subnode built via Langchain Code. Lifecycle hooks capture usage metadata, which is logged to Google Sheets.
Key benefits include c
Platform
n8n
Category
Customer Support
Price
$19.99
Creator
BestWorkflows
LLM
Langchain
Token Tracking
Cost Management
Google Sheets
PDF Processing
AI Billing
Self-Hosted n8n
Customer Analytics
How to import this workflow into n8n
1Purchase or download the workflow to get the n8n workflow JSON file.
2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
3Open each node marked with a credential warning and connect your own accounts and API keys.
4Run the workflow once manually to verify the data flow, then toggle it to Active.