Track AI agent token usage and estimate costs in Google Sheets: n8n template
Track AI agent token usage and estimate costs in Google Sheets is a free n8n workflow template by Solomon with 13 nodes. It starts with the Manual Trigger node ("When clicking ‘Test workflow’") and uses AI Agent, n8n, Google Sheets, Google Gemini Chat Model and 2 more. You can paste it into your n8n editor in one click with FlowLume.
What this workflow does, step by step
- When clicking ‘Test workflow’ (Manual Trigger node)
- When Executed by Another Workflow (Execute Workflow Trigger node)
- AI Agent
- Get execution data (n8n node)
- Think (Think Tool node)
- OpenAI (OpenAI Chat Model node)
- Call sub-workflow (Execute Sub-workflow node)
- Extract token usage data (Edit Fields (Set) node)
- Split Out
- Sum Token Totals - aggregate by model (Summarize node)
- Record token usage (Google Sheets node)
The full workflow has 13 nodes; this list shows the main path from the trigger.
What you need before you paste it
Connect these accounts in n8n
- Anthropic · used by Anthropic
- Google Gemini (PaLM) API · used by Gemini
- Google Sheets (OAuth2) · used by Record token usage
- n8n API key · used by Get execution data
- OpenAI · used by OpenAI
Checked with FlowLume's setup checklist on 2026-11-25. In the extension, FlowLume Pro shows this checklist for any template before you paste.
Template facts
- Author
- Solomon (verified n8n creator)
- Nodes
- 13
- Apps
- AI Agent, n8n, Google Sheets, Google Gemini Chat Model, OpenAI Chat Model, Anthropic Chat Model
- Uses AI
- Yes (n8n AI nodes)
- Categories
- Engineering
- Views on n8n.io
- 25,131
- Published
- 2 July 2025
- Price
- Free
How to paste it with FlowLume
- Install FlowLume. Add the free FlowLume extension to Google Chrome from the Chrome Web Store.
- Open n8n. Open a new or existing workflow in your n8n editor (n8n Cloud or self-hosted).
- Find the template. Click the FlowLume button at the bottom right and search for "Track AI agent token usage and estimate costs in Google Sheets".
- Paste it. Click Paste to n8n. All nodes and connections land on your canvas.
- Connect your accounts. Add your own credentials for Anthropic, Google Gemini (PaLM) API, Google Sheets (OAuth2), n8n API key, OpenAI, then run the workflow.
Similar n8n templates
- 🤖 AI content generation for auto service 🚘 automate your social media📲!Telegram · Schedule Trigger · Google Sheets Trigger · Mistral Cloud Chat Model
- ✨🤖Automate Multi-Platform Social Media Content Creation with AIGoogle Gemini Chat Model · OpenAI Chat Model · HTTP Request · Facebook Graph API
- Generate AI viral videos with Seedance and upload to TikTok, YouTube & InstagramSchedule Trigger · Google Sheets · OpenAI Chat Model · HTTP Request
- Generate AI viral videos with VEO 3 and upload to TikTokSchedule Trigger · Google Sheets · AI Agent · OpenAI Chat Model
- Generate & auto-post AI videos to social media with Veo3 and BlotatoGoogle Sheets · HTTP Request · Schedule Trigger · AI Agent
- Create & upload AI-generated ASMR YouTube Shorts with Seedance, Fal AI, and GPT-4HTTP Request · OpenAI Chat Model · AI Agent · Schedule Trigger
Template "Track AI agent token usage and estimate costs in Google Sheets" by Solomon, published on n8n.io. The template and its description belong to its author; this page only summarises its structure. FlowLume is an independent tool by DrakenLume and is not affiliated with n8n GmbH. n8n is a trademark of n8n GmbH.