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

650 views · ⚒️ Engineering

Description

🤖 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

📊 Generate an Interactive Dashboard

✨ Key Features

💬 Conversation Data Collection

Messages sent to the AI agent are recorded with:

This allows detailed tracking of AI interactions across sessions.

💰 Model Pricing Management

🗄️ 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

⚙️ 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

3. Configure the Webhook

4. Set Up the Pricing Sub-workflow

5. Dashboard Visualization

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

🔧 Adaptability

🔗 Nodes Used

Webhook, n8n, Schedule Trigger, AI Agent, OpenAI Chat Model, Simple Memory

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup