{
  "name": "monthly-financial-summary-email",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 1 * *"
            }
          ]
        }
      },
      "id": "schedule",
      "name": "Monthly Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "={{$env.APP_API_BASE_URL}}/api/automation/monthly-summary?user_id=default",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{'Bearer ' + $env.AUTOMATION_WEBHOOK_TOKEN}}"
            }
          ]
        },
        "options": {}
      },
      "id": "fetch-summary",
      "name": "Fetch Monthly Summary",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        300
      ]
    },
    {
      "parameters": {
        "sendTo": "={{$env.SUMMARY_EMAIL_TO}}",
        "subject": "={{ $json.data.subject }}",
        "emailType": "text",
        "message": "={{ $json.data.body }}",
        "options": {}
      },
      "id": "gmail",
      "name": "Send Gmail Summary",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        780,
        300
      ],
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Monthly Schedule": {
      "main": [
        [
          {
            "node": "Fetch Monthly Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Monthly Summary": {
      "main": [
        [
          {
            "node": "Send Gmail Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}