Templates / Track LLM token spend per workflow with n8n API, data tables, and Slack alerts

Track LLM token spend per workflow with n8n API, data tables, and Slack alerts

Ready for 3.0

by Retailbox Automation · 16 views · created 2026-10-27 · DevOps, AI Summarization

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 workflow has 11 nodes and runs on a schedule (every 15 minutes). Along the way it connects Slack.

How it runs

Trigger: On a schedule (every 15 minutes).

  1. Set configuration (Edit Fields (Set)): sets 4 fields: pricesPer1M, dailyBudgetUsd, budgetOverrides…
  2. Get recent executions (n8n): work with execution
  3. Extract LLM calls and cost (Code): runs custom JavaScript code
  4. Skip calls already logged (Data table): row not exists
  5. Insert usage rows (Data table): uses Data table
  6. Get today's usage (Data table): get
  7. Find workflows over budget (Code): runs custom JavaScript code
  8. Pause over-budget workflows? (If): checks a condition and branches into true / false
  9. Unpublish workflow (n8n): deactivate
  10. Send budget alert to Slack (Slack): uses Slack

Services it uses

Slack

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

From the author

Quick overview This workflow runs every 15 minutes, pulls recent n8n executions via the n8n API, calculates per-call LLM token costs, stores them in an n8n Data Table, and posts a Slack alert when any workflow exceeds its daily budget (optionally deactivating…

Excerpt from Retailbox Automation'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.