LOW / CODEBlueprints
financeai

AI Expense Auto-Categorizer

When expenses land in a Google Sheet, Claude AI automatically categorizes them by type (travel, software, meals, office supplies, etc.), flags anomalies or duplicates, and posts a weekly spending summary to Slack.

Beginner~15 minn8nMake.com 260 downloads 637 views

Setup Instructions

1. Create a Google Sheet named "Expenses" with columns: Date, Description, Amount, Vendor, Category (leave blank — Claude will fill this), Flagged. 2. In your automation platform, add a Schedule trigger to run every hour (or a Google Sheets trigger for new rows). 3. Add a Google Sheets node to read rows where the Category column is empty. 4. Add an HTTP Request node to call the Claude API (POST https://api.anthropic.com/v1/messages). Set headers: x-api-key: {{YOUR_ANTHROPIC_API_KEY}}, anthropic-version: 2023-06-01, Content-Type: application/json. Use model claude-sonnet-4-20250514. 5. In the request body, send the expense description and amount, asking Claude to return a JSON object with "category" (one of: Travel, Software, Meals, Office Supplies, Marketing, Professional Services, Utilities, Other) and "flagged" (boolean, true if the amount seems unusual for the category). 6. Parse Claude's JSON response and update the Google Sheet row with the category and flagged status. 7. Add a weekly Schedule trigger that reads all categorized expenses, summarizes totals by category, and posts the summary to a Slack channel (e.g., #finance). 8. Test by adding a few sample expenses with varying descriptions and amounts and verifying Claude categorizes them correctly.
Troubleshooting
**Claude returning inconsistent categories:** Make sure your prompt specifies the exact list of allowed categories and instructs Claude to return valid JSON only. Add "You must respond with valid JSON and nothing else" to your system prompt. **Google Sheets rate limits:** If processing many rows at once, add a delay between API calls or batch rows into a single Claude request (up to 10 expenses per message works well). **Anomaly detection too sensitive or too loose:** Adjust your prompt to include typical ranges for each category. For example, "Flag any meal expense over $200 or any software subscription over $1,000 as anomalous." **Slack summary not posting:** Verify the bot token has chat:write permission and the bot has been invited to the target channel. Check that the weekly schedule trigger timezone matches your expectations.

Need a custom version?

We can build a tailored automation workflow for your specific needs.

New blueprints weekly

Get notified when we publish new automation workflows.