---
created: 2026-02-16T00:06
updated: 2026-02-17T09:28
---
# n8n Financial Workflows — Runbook

## Overview

Three workflows for financial awareness. All state stored locally — no Google Sheets needed.

| Workflow | Schedule | Purpose |
|----------|----------|---------|
| Spending Threshold Alert | 10am, 2pm, 6pm, 10pm | Alert when daily spending > $50 |
| Weekly Subscription Audit | Sundays 9am | Detect new/changed recurring charges |
| Debt Milestone Celebrator | Daily 7am | Celebrate crossing $1K debt thresholds |

---

## Architecture

```
n8n (QNAP) → cron trigger → HTTP POST to OpenClaw webhook
                                    ↓
                            OpenClaw runs Python script
                                    ↓
                            Script queries Monarch Money
                            Script updates local JSON state
                            Script returns result
                                    ↓
                            OpenClaw sends Signal alert (if needed)
```

**State files:**
- `~/.openclaw/data/finance/spending-alerts.json`
- `~/.openclaw/data/finance/subscriptions.json`
- `~/.openclaw/data/finance/debt-milestones.json`

**Scripts:**
- `~/.openclaw/scripts/spending-alert.py`
- `~/.openclaw/scripts/subscription-audit.py`
- `~/.openclaw/scripts/debt-milestone.py`

---

## 1. Spending Threshold Alert

**Schedule:** 10am, 2pm, 6pm, 10pm MST

**What it does:**
1. Queries today's transactions from Monarch
2. Sums expenses
3. If over $50 and not already alerted today → Signal alert
4. Logs to local JSON

**Threshold:** $50/day (edit in `spending-alert.py`, line 17)

---

## 2. Weekly Subscription Audit

**Schedule:** Sundays 9am MST

**What it does:**
1. Queries last 35 days of transactions
2. Identifies recurring patterns (same merchant, similar amounts)
3. Compares to last week's known subscriptions
4. Alerts on new charges or price changes
5. Updates baseline for next week

**Note:** First run will flag everything as "new" since there's no baseline yet.

---

## 3. Debt Milestone Celebrator

**Schedule:** Daily 7am MST (after financial pulse)

**What it does:**
1. Queries total credit card debt
2. Calculates current $1K milestone (e.g., $35,409 → $36,000 milestone)
3. If crossed DOWN from previous milestone → celebration!
4. Tracks last milestone to prevent duplicate celebrations

---

## Setup

### 1. Import Workflows to n8n
1. Open n8n.disorganized.net
2. Import each JSON file from `n8n-workflows/`
3. Configure HTTP Header Auth credential for OpenClaw webhook

### 2. Configure Webhook Auth
The workflows POST to `http://192.168.7.6:18789/hooks/agent`

Ensure this webhook is enabled in OpenClaw config with appropriate auth.

### 3. Activate Workflows
Toggle each workflow to active in n8n.

---

## Testing

Run scripts manually to test:

```bash
# Spending alert
~/.openclaw/scripts/spending-alert.py

# Subscription audit  
~/.openclaw/scripts/subscription-audit.py

# Debt milestone
~/.openclaw/scripts/debt-milestone.py
```

Each outputs JSON. If `should_alert` or `should_celebrate` is true, it includes the message to send.

---

## Maintenance

**If Monarch session expires:**
```bash
cd ~/.monarch-money && source venv/bin/activate
# Wait for fresh TOTP window, then:
MM_EMAIL="monarchmoney@dmd.la" MM_PASSWORD="..." MM_MFA=$(op item get Monarchmoney --vault OpenClaw --otp) python3 monarch_cffi.py login
```

**View state:**
```bash
cat ~/.openclaw/data/finance/spending-alerts.json | jq
cat ~/.openclaw/data/finance/debt-milestones.json | jq
```

**Reset state (start fresh):**
```bash
rm ~/.openclaw/data/finance/*.json
```

---

*All data stays local. No external dependencies except Monarch Money API.*
