{
  "name": "Email Summarizer",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "b0f570f5-f5a8-40c4-b87d-30eba8bece0e",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "operation": "getAll",
        "limit": 10,
        "simple": false,
        "filters": {
          "sender": "Kaggle"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        208,
        0
      ],
      "id": "bb1850a5-de73-44c6-a5e6-bfe5c848fe31",
      "name": "Get many messages",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-3-flash-preview"
        },
        "messages": {
          "values": [
            {
              "content": "=You are an expert email summarizer. Help summarize the user-input email. \n\nSender email: {{ $json.headers.from }}\nTo: {{ $json.headers.to }}\nSubject: {{ $json.headers.subject }}\nInput email text: {{ $json.text }}\n\nGive me a text summary of that email that includes all important information, the sender's name, the objective, contact info, etc. \nInclude:\n- Main purpose\n- Any action items\n- Deadlines if mentioned, etc. \n\nOutput in the form of text only. Summary limitation is one short paragraph of a maximum of 7 lines and a minimum of 3 lines. If possible, include emojies in the output text to make it engaging, and nice to read. Format long paragraph into bullet points if possible. Also, give top heading to this summary."
            }
          ]
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1.2,
      "position": [
        416,
        0
      ],
      "id": "8e23ab5a-c8dc-4370-9117-379591475c41",
      "name": "Message a model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "text": "=Your email summary: \n\n{{ $json.content.parts[0].text }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        768,
        0
      ],
      "id": "3d9c1f61-499b-417d-a578-398423db0536",
      "name": "Send a text message",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "code for email summarizer tg bot: \nYOUR_TELEGRAM_BOT_TOKEN\n\nchatid: YOUR_TELEGRAM_CHAT_ID",
        "height": 144,
        "width": 304
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        208
      ],
      "typeVersion": 1,
      "id": "2400747d-81d4-4c87-90e3-5e586250c6c5",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "New learning: \n\nTurn off \"Simplify\" option in Gmail node to get ultimate email response including full body text, etc. ",
        "height": 192,
        "width": 272
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        208
      ],
      "typeVersion": 1,
      "id": "f84f9dcc-95b1-42dd-90bf-411a3ff82d0e",
      "name": "Sticky Note1"
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get many messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many messages": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "staticData": null,
  "triggerCount": 0,
  "meta": {
    "templateCredsSetupCompleted": true
  }
}