Templates / Track and monitor AI token usage metrics for OpenAI and Gemini models

Track and monitor AI token usage metrics for OpenAI and Gemini models

Ready for 3.0

by Elimeleth · 1,611 views · created 2025-08-11 · Engineering, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 9 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects Google Gemini Chat Model and OpenAI Chat Model.

How it runs

Trigger: When a chat message arrives (plus 1 other trigger).

  1. AI Agent: runs an AI agent, with model: gemini, openai; memory: Simple Memory
  2. Get an execution (n8n): get (execution)
  3. Execute Workflow (Execute Sub-workflow): calls another n8n workflow
  4. map json (Code): runs custom JavaScript code

Services it uses

Google Gemini Chat ModelOpenAI Chat Model

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 (9)

From the author

📊 Token Usage Metrics Workflow Descripción: Este flujo de trabajo en n8n extrae y resume las métricas de uso de tokens (prompt, completion y total) y los modelos utilizados en una ejecución específica. Requiere el executionid y un array con los nombres de…

Excerpt from Elimeleth's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.