Cap daily AI model spend per workflow with Google Sheets and Slack
Ready for 3.0What this workflow does
This workflow has 19 nodes and runs when another workflow calls it (plus 1 other trigger). Along the way it connects Google Sheets and Slack.
How it runs
Trigger: When another workflow calls it (plus 1 other trigger).
- Read The Request (Code): runs custom JavaScript code
- Read Yesterday's Ledger (Data table): get
- Load Budgets (Google Sheets): uses Google Sheets
- Build The Spend Summary (Code): runs custom JavaScript code
- Load Model Prices (Google Sheets): uses Google Sheets
- Anything To Report? (If): checks a condition and branches into true / false
- Resolve Budget And Day (Code): runs custom JavaScript code
- Post The Summary To Slack (Slack): uses Slack
- Read Today's Ledger Row (Data table): get
- Check Or Record? (Switch): routes items into 2 branches
…plus 7 more steps. See the full node list below.
Services it uses
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 (9)
- Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - Data table
n8n-nodes-base.dataTable - Switch
n8n-nodes-base.switch - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
Quick Overview This workflow caps per-workflow daily AI spend by tracking token usage in an n8n Data Table, looking up budgets and model pricing in Google Sheets, and sending one-time threshold alerts plus a daily spend summary to Slack. How it works 1.…