{
  "name": "Monitor emails & send AI-generated auto-replies with Ollama & Telegram alerts",
  "nodes": [
    {
      "id": "c12ebb83-47fd-470b-ba67-151e1b259b82",
      "name": "No Operation",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -688,
        704
      ]
    },
    {
      "id": "3098bb59-a78d-4a8d-8253-466f98832ec0",
      "name": "Send Notification from Incoming Email",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1376,
        464
      ]
    },
    {
      "id": "45c29e94-e265-4853-a20d-60a1dc099ea8",
      "name": "Dedicate Filtering As No-Response",
      "type": "n8n-nodes-base.if",
      "position": [
        -1056,
        464
      ]
    },
    {
      "id": "78483eec-fc65-432b-9e7d-d41db7588647",
      "name": "Check Incoming Emails - IMAP (example: SOGo)",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        -1664,
        464
      ]
    },
    {
      "id": "19549685-fc0a-4ed3-bcaf-8be2c946cb79",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2208,
        112
      ],
      "parameters": {
        "width": 508,
        "height": 216,
        "content": "## IMAP Email Monitor with Smart Auto-Reply\n\nAutomated email handling with three core functions:\n1. Monitors incoming emails via IMAP\n2. Sends instant Telegram notifications\n3. Auto-replies to legitim"
      }
    },
    {
      "id": "1d5fe648-3529-41d2-a3c7-88e450be8461",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        624
      ],
      "parameters": {
        "width": 300,
        "height": 260,
        "content": "## IMAP CONFIGURATION\n\nRequires IMAP credential:\n- Host: IMAP server address\n- Port: Usually 993 for SSL/TLS\n- Username: Email address\n- Password: App-specific password\n- SSL/TLS: Enabled\n\nPolls mailb"
      }
    },
    {
      "id": "a03d2412-becc-4e7e-9bf3-e494177aa9db",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1488,
        208
      ],
      "parameters": {
        "width": 332,
        "height": 240,
        "content": "## TELEGRAM NOTIFICATION\n\nSends immediate notification for every new email.\n\nIncludes: Sender, Subject, Date-Time\n\nRequires:\n- Chat ID (update -1234567890123)\n- Telegram API credential from @BotFather"
      }
    },
    {
      "id": "9ba3905c-85e1-41ed-999f-82b0d519a7f8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        624
      ],
      "parameters": {
        "width": 296,
        "height": 260,
        "content": "## SPAM FILTERING LOGIC\n\nBlocks auto-replies from:\n- Addresses containing noreply or no-reply\n- Subjects containing newsletter\n\nTrue path: Send auto-reply\nFalse path: No operation\n\nCustomize condition"
      }
    },
    {
      "id": "4b3795ef-d342-4818-a343-a18070c23132",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        96
      ],
      "parameters": {
        "width": 300,
        "height": 328,
        "content": "## AI-POWERED AUTO-REPLY\n\nSends personalized acknowledgment to legitimate senders.\n\nRequires SMTP credential:\n- Host: SMTP server (e.g., Postfix)\n- Port: 587 (STARTTLS) or 465 (SSL)\n- Credentials and "
      }
    },
    {
      "id": "a94c5eae-23f7-46cd-87d5-ef3a9be65cf2",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2208,
        336
      ],
      "parameters": {
        "width": 396,
        "height": 240,
        "content": "## CREDENTIALS REQUIRED\n\n1. IMAP Credential - for email monitoring\n2. SMTP Credential - for sending auto-replies\n3. Telegram API - bot token from @BotFather\n4. Ollama API - for LLM model access\n\nAll c"
      }
    },
    {
      "id": "0074dcf8-3b77-416b-912c-b1c91f42ad4c",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        48
      ],
      "parameters": {
        "width": 300,
        "height": 372,
        "content": "## AI RESPONSE GENERATION\n\nUses LLM to generate contextual auto-reply.\n\nReads email content and identifies main topic in 2-4 words.\n\nGenerates personalized response:\n- Thanks sender for message\n- Ment"
      }
    },
    {
      "id": "71246042-ba4d-4767-bf42-247ce4998014",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        800
      ],
      "parameters": {
        "width": 300,
        "height": 300,
        "content": "## OLLAMA MODEL CONFIGURATION\n\nRequires Ollama API credential.\n\nModel: llama3.1\nContext window: 4096 tokens\n\nInstall Ollama locally or use remote instance.\n\nEnsure model is downloaded:\nollama pull lla"
      }
    },
    {
      "id": "e3d171cc-c71a-4c82-acaf-1605e9ba38d3",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        640
      ],
      "parameters": {
        "width": 300,
        "height": 296,
        "content": "## RESPONSE CONFIRMATION\n\nSends Telegram notification after auto-reply is sent.\n\nIncludes:\n- Original sender and subject\n- Generated AI response text\n\nConfirms successful auto-reply delivery."
      }
    },
    {
      "id": "82d9e05d-8cb2-46fb-9a05-825b6ab9cb85",
      "name": "Ollama Model",
      "type": "@n8n/n8n-nodes-langchain.lmOllama",
      "position": [
        -416,
        672
      ]
    },
    {
      "id": "0c1d9daa-3981-4918-872b-d6e121f8d23c",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -416,
        448
      ]
    },
    {
      "id": "1905aad8-dcd2-49dc-83ea-c93f3b9d4737",
      "name": "Send Auto-Response in SMTP (example POSTFIX)",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        80,
        448
      ]
    },
    {
      "id": "d3a996dd-465f-46c7-acdd-1d0d1358a8bb",
      "name": "Send Notification from Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        80,
        672
      ]
    }
  ],
  "connections": {
    "Ollama Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Send Auto-Response in SMTP (example POSTFIX)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dedicate Filtering As No-Response": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Notification from Incoming Email": {
      "main": [
        [
          {
            "node": "Dedicate Filtering As No-Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Incoming Emails - IMAP (example: SOGo)": {
      "main": [
        [
          {
            "node": "Send Notification from Incoming Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Auto-Response in SMTP (example POSTFIX)": {
      "main": [
        [
          {
            "node": "Send Notification from Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}