Skip to main content

AI model usage dashboard: Track token metrics and costs for LLM workflows

Workflow preview

Workflow preview
100%
AI model usage dashboard: Track token metrics and costs for LLM workflows preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

n8n AI Workflow Dashboard Template Overview This template is designed to collect execution data from your AI workflows and generate an interactive dashboard for easy monitoring. It's compatible ...

Best for

  • Engineering automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.set, n8n-nodes-base.datatable, n8n-nodes-base.n8n

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Hugo.

Original n8n.io source

1.1 Workflow description

Title
AI model usage dashboard: Track token metrics and costs for LLM workflows
Workflow name
AI model usage dashboard: Track token metrics and costs for LLM workflows

πŸ€– n8n AI Workflow Dashboard Template

Overview

This template is designed to collect execution data from your AI workflows and generate an interactive dashboard for easy monitoring. It's compatible with any AI Agent or RAG workflow in n8n.

Main Objectives

πŸ’Ύ Collect Execution Data
  • Track messages, tokens used (prompt/completion), session IDs, model names, and compute costs
  • Designed to plug into any AI agent or RAG workflow in n8n
πŸ“Š Generate an Interactive Dashboard
  • Visualize KPIs like total messages, unique sessions, tokens used, and costs
  • Display daily charts, including stacked bars for prompt vs completion tokens
  • Monitor AI activity, analyze usage, and track costs at a glance

✨ Key Features

πŸ’¬ Conversation Data Collection

Messages sent to the AI agent are recorded with:

  • sessionId
  • chatInput
  • output
  • promptTokens, completionTokens, totalTokens
  • globalCost and modelName

This allows detailed tracking of AI interactions across sessions.

πŸ’° Model Pricing Management

  • A sub-workflow with a Set node provides token prices for LLMs
  • Data is stored in the Model price table for cost calculations

πŸ—„οΈ Data Storage via n8n Data Tables

Two tables need to be created:

Model price
{
  "id": 20,
  "createdAt": "2025-10-11T12:16:47.338Z",
  "updatedAt": "2025-10-11T12:16:47.338Z",
  "name": "claude-4.5-sonnet",
  "promptTokensPrice": 0.000003,
  "completionTokensPrice": 0.000015
}
Messages
[
  {
    "id": 20,
    "createdAt": "2025-10-11T15:28:00.358Z",
    "updatedAt": "2025-10-11T15:31:28.112Z",
    "sessionId": "c297cdd4-7026-43f8-b409-11eb943a2518",
    "action": "sendMessage",
    "output": "Hey! \nHow's it going?",
    "chatInput": "yo",
    "completionTokens": 6,
    "promptTokens": 139,
    "totalTokens": 139,
    "globalCost": null,
    "modelName": "gpt-4.1-mini",
    "executionId": 245
  }
]

These tables store conversation data and pricing info to feed the dashboard and calculations.

πŸ“ˆ Interactive Dashboard

  • KPIs Generated: total messages, unique sessions, total/average tokens, total/average cost πŸ’Έ
  • Charts Included: daily messages, tokens used per day (prompt vs completion, stacked bar)
  • Provides a visual summary of AI workflow performance

βš™οΈ Installation & Setup

Follow these steps to set up and run the workflow in n8n:

1. Import the Workflow

Download or copy the JSON workflow and import it into n8n.

2. Create the Data Tables

  • Model price table: stores token prices per model
  • Messages table: stores messages generated by the AI agent

3. Configure the Webhook

  • The workflow is triggered via a webhook
  • Use the webhook URL to send conversation data

4. Set Up the Pricing Sub-workflow

  • Automatically generates price data for the models used
  • Connect it to your main workflow to enrich cost calculations

5. Dashboard Visualization

  • The workflow returns HTML code rendering the dashboard
  • View it in a browser or embed it in your interface 🌐

Once configured, your workflow tracks AI usage and costs in real-time, providing a live dashboard for quick insights.

πŸ”§ Adaptability

  • The template is modular and can be adapted to any AI agent or RAG workflow
  • KPIs, charts, colors, and metrics can be customized in the HTML rendering
  • Ideal for monitoring, cost tracking, and reporting AI workflow performance

1.2 Logical Blocks

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.

2. Block-by-Block Analysis

Block 1 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.3

Block 2 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 3 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 4 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 6 - Get Excution ID

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Model/Token Info

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Insert row2

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 9 - Get an execution

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 10 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 11 - Get row(s)

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 12 - Update row(s)

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 13 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Insert row1

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Get row(s)1

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 17 - Edit Fields1

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 19 - No Operation, do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 20 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 22 - Get row(s)3

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 23 - Merge1

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 24 - Code in JavaScript1

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Showing the first 24 of 30 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow AI model usage dashboard: Track token metrics and costs for LLM workflows
Complexity advanced
Nodes 30
Categories Engineering, AI Chatbot
Author Hugo
Published 11 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9497/9497.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

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.

Frequently asked questions

What does AI model usage dashboard: Track token metrics and costs for LLM workflows do?

n8n AI Workflow Dashboard Template Overview This template is designed to collect execution data from your AI workflows and generate an interactive dashboard for easy monitoring. It's compatible ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

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, AI Chatbot use case.