Block 1 - Get an execution
- Type / Role
- n8n-nodes-base.n8n - n8n
- Config choices
- Version 1
This workflow is provided as-is. Please review and test before using in production.
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í...
n8n-nodes-base.n8n, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.code, n8n-nodes-base.stickynote, n8n-nodes-base.executeworkflow, @n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Elimeleth.
Original n8n.io source📊 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 execution_id y un array con los nombres de los nodos de AI (por ejemplo: openai, gemini).
Requisitos:
execution_id: ID de la ejecución de n8n de la cual se extraerán los datos.
model_names: Array con los nombres de los nodos AI a buscar (ejemplo: openai, gemini).
Funcionamiento:
Obtiene la ejecución con el ID proporcionado.
Busca en los nodos indicados la información de token usage dentro de la ejecución.
Suma los tokens usados y genera un listado de modelos utilizados.
Devuelve métricas totales y un desglose detallado por modelo.
Configuración recomendada:
Este workflow debe configurarse para ejecutarse siempre al final del flujo de trabajo.
Desactivar la opción “Esperar a que termine” para evitar bloqueos y asegurar que se obtenga la ejecución completa.
📊 Token Usage Metrics Workflow
Description: This n8n workflow extracts and summarizes token usage metrics (prompt, completion, and total tokens) along with the models used in a specific execution. It requires the execution_id and an array of AI node names (e.g., openai, gemini).
Requirements:
execution_id: The n8n execution ID from which data will be extracted.
model_names: An array of AI node names to search for (e.g., openai, gemini).
How It Works:
Fetches the execution using the provided ID.
Searches the specified nodes for token usage information within the execution.
Aggregates token counts and compiles a list of models used.
Returns total metrics and a detailed breakdown per model.
Recommended Configuration:
Configure this workflow to run always at the end of your workflow.
Disable the “Wait until finished” option to avoid blocking and ensure the complete execution data is available.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Track and monitor AI token usage metrics for OpenAI and Gemini models |
|---|---|
| Complexity | intermediate |
| Nodes | 10 |
| Categories | Engineering, Multimodal AI |
| Author | Elimeleth |
| Published | 11 Aug 2025 |
Use the JSON export at /data/workflows/7265/7265.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
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í...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, Multimodal AI use case.