Automated Token Usage Tracking for AI Workflows

somdn_product_page

This n8n workflow streamlines the process of monitoring and analyzing token usage across AI-powered workflows. Starting with a manual trigger, it calls an AI agent to generate a response, then executes a sub-workflow to retrieve execution metadata and token consumption data. The workflow extracts token usage details from the workflow’s metadata and aggregates the data by AI model type, updating a Google Sheets spreadsheet for cost estimation. Additional sticky notes guide users on customizing the workflow, understanding limitations, and tracking token costs. This setup is particularly useful for developers and businesses leveraging AI APIs, as it provides real-time insights into token consumption and associated costs, enabling better budget management and performance optimization.

Node Count

>20 Nodes

Nodes Used

@n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmChatAnthropic, @n8n/n8n-nodes-langchain.lmChatGoogleGemini, @n8n/n8n-nodes-langchain.lmChatOpenAi, @n8n/n8n-nodes-langchain.toolThink, executeWorkflow, executeWorkflowTrigger, googleSheets, manualTrigger, n8n, set, splitOut, stickyNote, summarize

Reviews

There are no reviews yet.

Be the first to review “Automated Token Usage Tracking for AI Workflows”

Your email address will not be published. Required fields are marked *