{
  "name": "Daily Email Intelligence Digest",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -544,
        -96
      ],
      "id": "66e69585-c399-4f8f-ae69-05ecc5f87f89",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEET_ID",
          "mode": "list",
          "cachedResultName": "AI Email Intelligence Memory",
          "cachedResultUrl": "https://docs.google.com"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -416,
        -96
      ],
      "id": "8d5fc903-d158-4909-bc91-48081cdb900a",
      "name": "Retrieve Email Intelligence",
      "credentials": {}
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Role:\nYou are an executive email intelligence assistant.\n\nYour task is to review processed email intelligence records and generate a concise executive daily digest.\n\nYou must:\n- summarize the most important emails\n- identify urgent items\n- identify sponsorship opportunities\n- identify action items\n- group information clearly\n- keep the report concise and professional\n\nIMPORTANT:\nReturn ONLY clean HTML.\nDo not use markdown.\n\nUse this structure:\n\n<h1>Daily AI Email Intelligence Digest</h1>\n\n<h2>Critical Items</h2>\n\n<h2>Sponsorship Opportunities</h2>\n\n<h2>Action Required</h2>\n\n<h2>Other Important Updates</h2>\n\nUse bullet lists where appropriate.\n\nKeep formatting professional and readable.\n\nEmail Intelligence Records:\n{{ JSON.stringify($json.data) }}",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        -16,
        -96
      ],
      "id": "4efa4276-e37f-4972-85d3-b793cc6a8160",
      "name": "Executive Digest Generator"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "gpt-4o-mini"
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        -48,
        128
      ],
      "id": "3d088573-13cd-422a-ba03-814a3cb4b1c1",
      "name": "OpenAI Chat Model",
      "credentials": {}
    },
    {
      "parameters": {
        "sendTo": "YOUR_EMAIL@example.com",
        "subject": "Daily AI Email Intelligence Digest",
        "message": "={{ $json.output }}",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        336,
        -96
      ],
      "id": "cf95be5c-f169-4fe8-ad63-7353e2adc664",
      "name": "Send Executive Digest",
      "credentials": {}
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        -208,
        -96
      ],
      "id": "35e31c5f-fc0b-4277-87ae-173b419bca6b",
      "name": "Aggregate Intelligence Records"
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Retrieve Email Intelligence",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Email Intelligence": {
      "main": [
        [
          {
            "node": "Aggregate Intelligence Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Executive Digest Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Executive Digest Generator": {
      "main": [
        [
          {
            "node": "Send Executive Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Intelligence Records": {
      "main": [
        [
          {
            "node": "Executive Digest Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "qPbjZKp6bDkKjIGT",
  "tags": []
}