{
  "name": "Ledger: Transaction Monitor",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 4
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Every 4 Hours",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [0, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://192.168.7.6:18789/hooks/agent",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"agent\": \"ledger\",\n  \"task\": \"transaction_check\",\n  \"message\": \"Check for new transactions since last check. Query Monarch Money for transactions in the last 4 hours. For each transaction, evaluate against budget rules: (1) Eating out on non-Saturday = violation, (2) Discretionary purchase > 150% of weekly fun budget = alert, (3) Any purchase > 250% of weekly fun budget = should have discussed first. If any violations found, send alert to Brandon via Signal with transaction details and which rule was broken. Update memory/last-check-timestamp.md with current time.\"\n}",
        "options": {}
      },
      "id": "webhook-openclaw",
      "name": "Call Ledger Agent",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [220, 0],
      "credentials": {
        "httpHeaderAuth": {
          "id": "openclaw-webhook-auth",
          "name": "OpenClaw Webhook Auth"
        }
      }
    },
    {
      "parameters": {},
      "id": "noop-end",
      "name": "Done",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [440, 0]
    }
  ],
  "connections": {
    "Every 4 Hours": {
      "main": [
        [
          {
            "node": "Call Ledger Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Ledger Agent": {
      "main": [
        [
          {
            "node": "Done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0
}
