Skip to main content

πŸ₯‡ Token Estim8r -sub workflow to track AI model token usage and cost with JinaAI

Workflow preview

Workflow preview
100%
πŸ₯‡ Token Estim8r -sub workflow to track AI model token usage and cost with JinaAI preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Save Your Tokens from Evil King Browser Image Generated with [ideoGener8r](https://ideogener8r.com?utm so...

Best for

  • Engineering automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.n8n, n8n-nodes-base.code, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.googlesheets, n8n-nodes-base.stickynote, n8n-nodes-base.executeworkflowtrigger

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
πŸ₯‡ Token Estim8r -sub workflow to track AI model token usage and cost with JinaAI
Workflow name
πŸ₯‡ Token Estim8r -sub workflow to track AI model token usage and cost with JinaAI

Save Your Tokens from Evil King Browser

> Image Generated with ideoGener8r n8n workflow template

πŸ” Estimate token usage and AI model cost from any workflow in n8n

πŸ™‹β€β™‚οΈ Who is this for?

This workflow is ideal for AI engineers, automation specialists, and business analysts who use OpenAI, Anthropic, or other token-based large language models (LLMs) in their n8n workflows and want to track their usage and accuratley estimate associated costs.

Whether you're prototyping workflows or deploying in production, this tool gives you insight into how many tokens you're using and what that translates to in actual dollars.

😌 What problem is this workflow solving?

n8n users running AI-based workflows often struggle to track how many tokens were used per execution and how much those tokens cost. Without visibility into usage, it’s easy to lose track of API spending.

This workflow solves that problem by:

  • Logging token counts and costs to Google Sheets
  • Supporting prompt and completion token counts
  • Providing live pricing (optional, via Jina AI API)

βš™οΈ What this workflow does

This template allows you to analyze the token usage and cost of any workflow in n8n. It uses an Execute Workflow node to call the Token Estim8r utility, which:

  • Estimates prompt and completion tokens
  • Retrieves model pricing (either statically or live via Jina API)
  • Calculates the total cost
  • Logs the data to a connected Google Sheet with timestamp and model info

πŸ› οΈ Setup Instructions

  1. Create Google Sheet: Copy and paste the CSV template below into a .csv file and upload to Google Sheets:

    timestamp, Total Tokens, Prompt Tokens, Completion Tokens, Models Used, Tools Used, Total Cost, Json Array
    
  2. Set up pricing (optional): In the Get AI Pricing node, add your Jina API Auth Header if you want live pricing.

  3. Select the correct Google Sheet: Ensure your workflow is pointing to the imported sheet.

  4. Attach to your target workflow: Add an Execute Workflow node to the end of your target workflow.

  5. Point to this Token Estim8r: Choose this template as the executed workflow and send {{ $execution.id }} as the input.

  6. Run and view results: Trigger the target workflow and see your token usage and cost data populate in the sheet.


πŸ”§ How to customize this workflow to your needs

  • Change the logging destination: Instead of Google Sheets, connect to Airtable, Notion, or a database.
  • Support multiple models: Extend the price-mapping logic to cover your own model providers.
  • Add Slack alerts: Send a notification if a workflow exceeds a token or cost threshold.
  • Aggregate costs: Create a weekly summary workflow that totals cost by workflow or model.

> This utility workflow works across all n8n deployment types and uses only built-in nodes.

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 clicking β€˜Test workflow’

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

Block 2 - n8n Get Execution Data

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

Block 3 - Get AI Usage Data

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

Block 4 - Set Ai_Run_Data

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

Block 5 - Get AI Pricing

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 6 - Get Models Price and Add Summary

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

Block 7 - Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 8 - Sticky Note

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

Block 9 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 10 - Sticky Note6

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

Block 11 - Sticky Note1

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

3. Summary Table

Workflow πŸ₯‡ Token Estim8r -sub workflow to track AI model token usage and cost with JinaAI
Complexity intermediate
Nodes 11
Categories Engineering, AI Summarization
Author RealSimple Solutions
Published 10 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3513/3513.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 πŸ₯‡ Token Estim8r -sub workflow to track AI model token usage and cost with JinaAI do?

Save Your Tokens from Evil King Browser Image Generated with [ideoGener8r](https://ideogener8r.com?utm so...

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 Summarization use case.