# Track LLM spend per workflow and send budget alerts via the n8n API

> Quick overview This workflow runs every 15 minutes, reads recent n8n executions via the n8n API, extracts LLM token usage from AI and HTTP Request nodes, logs per-call cost into an n8n Data Table, and sends Slack/email/Telegram/webhook alerts for budget overruns, spend spikes, loops, and unpriced models. How it works 1. Runs every 15 minutes on a schedule. 2. Calls the n8n Public API to fetch execution data since the last saved checkpoint. 3. Extracts LLM calls from execution run data (chat model sub-nodes and raw provider responses from nodes like OpenAI/Anthropic/Google Gemini and HTTP Request), calculates token totals, and estimates USD cost from the configured per-model pricing. 4. Writes only new LLM-call rows into an n8n Data Table using a unique call key to deduplicate across runs. 5. Reads the last 8 days of logged usage and analyzes today’s spend per workflow to detect budget overruns, spikes versus the prior 7-day daily average, excessive calls per execution (loops), and mode

- **Domain**: `n8n-workflow-22244.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/22244
- Page (HTML): https://agenstry.com/agents/n8n-workflow-22244.n8n.io
- Documentation: https://n8n.io/workflows/22244
