{
  "name": "Forward Zoho Mail emails to Gmail with Gemini AI analysis and Telegram digest",
  "nodes": [
    {
      "id": "1bc1be3b-42cf-45be-b3cc-8ebb0dfecd62",
      "name": "Zoho Mail Trigger",
      "type": "@zohomail/n8n-nodes-zohomail.zohoMailTrigger",
      "position": [
        688,
        368
      ]
    },
    {
      "id": "3c5ec7d1-7881-4db5-bdcc-0d4e2bd1be62",
      "name": "Set Context",
      "type": "n8n-nodes-base.set",
      "position": [
        944,
        368
      ]
    },
    {
      "id": "af50f0a0-55f7-4ce0-a79f-681ff279f2de",
      "name": "Has Attachment?",
      "type": "n8n-nodes-base.if",
      "position": [
        1888,
        368
      ]
    },
    {
      "id": "5f8ace38-356f-4fee-a330-53077172b9ba",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1248,
        368
      ]
    },
    {
      "id": "faf5ca8e-cc54-409b-b148-65da34e71d43",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1472,
        560
      ]
    },
    {
      "id": "0f511c40-080a-4792-917f-e6c855e35c81",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1104,
        576
      ]
    },
    {
      "id": "afd8fee2-d150-48ed-9ea7-87e63573c384",
      "name": "Get AccountsID",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2192,
        224
      ]
    },
    {
      "id": "a8e2a076-18b1-41d1-9bac-ee1002c0da7e",
      "name": "Get Attachment Info",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2432,
        224
      ]
    },
    {
      "id": "b8d64c78-f509-4b04-861a-aba2106aeff7",
      "name": "Split Out Attachments",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2672,
        224
      ]
    },
    {
      "id": "2e0450e8-005d-47b2-be12-bccfee93fbdb",
      "name": "Get Attachment Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2912,
        224
      ]
    },
    {
      "id": "b8aa8f22-fc5c-4239-a1f3-d3b41802d917",
      "name": "Aggregate Attachments",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3232,
        224
      ]
    },
    {
      "id": "c47a4382-4460-465c-8adb-66ed00eed7fd",
      "name": "Build Attachment List",
      "type": "n8n-nodes-base.code",
      "position": [
        3488,
        224
      ]
    },
    {
      "id": "04420c65-49b2-4163-9b5e-46c44d7def93",
      "name": "Forward Email with Attachments",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3872,
        224
      ]
    },
    {
      "id": "985cce0b-bb38-402d-bf87-b59e61240528",
      "name": "Forward Email (No Attachments)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3872,
        384
      ]
    },
    {
      "id": "b6e8de89-3b15-43a3-a500-a165eb9fb832",
      "name": "Notify Admin via Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4224,
        304
      ]
    },
    {
      "id": "18d09588-033a-43e7-bdae-db8a5a011bb5",
      "name": "Build Email HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        368
      ]
    },
    {
      "id": "1ccb3b56-247e-4c6f-a9b1-635c19e033e5",
      "name": "Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 628,
        "height": 958,
        "content": "## Smart Email Forwarder with AI Analysis (Zoho → Gmail + Telegram)\n\nThis workflow monitors a **Zoho Mail** inbox, automatically analyzes each incoming email with **Gemini AI**, then forwards it — inc"
      }
    },
    {
      "id": "d09c7c20-9702-426f-8547-0513acde7e99",
      "name": "Section 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        0
      ],
      "parameters": {
        "width": 1120,
        "height": 576,
        "content": "## Section 1: Trigger & AI Analysis\nReceives new tax email from Zoho Mail → sets forward destination → **Gemini AI analyzes the email** (type, priority, deadline, invoice numbers, tax amount, required"
      }
    },
    {
      "id": "d81b39ec-62c5-427e-b0b7-b1f88b9fa1ac",
      "name": "Section 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2128,
        0
      ],
      "parameters": {
        "width": 1524,
        "height": 576,
        "content": "## Section 2: Attachment Download Pipeline\nFetches Account ID → gets attachment metadata → splits per file → downloads each binary → merges all into one item ready for Gmail."
      }
    },
    {
      "id": "b8821e1f-06c5-4000-8167-3390c4636aeb",
      "name": "Section 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3776,
        0
      ],
      "parameters": {
        "width": 676,
        "height": 576,
        "content": "## Section 3: Forward & Smart Notify\nBoth paths (with/without attachments) forward the email via Gmail — with an **AI analysis panel** embedded at the top of the email body. After sending, Telegram de"
      }
    },
    {
      "id": "7203dcc4-3147-4c6b-872c-8636349fb0d7",
      "name": "Author",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2128,
        592
      ],
      "parameters": {
        "width": 500,
        "height": 340,
        "content": "## Author Message\n\nHi! I am **Nguyen Thieu Toan (Jay Nguyen)** — a Verified n8n Creator. Thank you for using this template!\n\nThis workflow is shared with you for free. If it brings value to your work,"
      }
    },
    {
      "id": "f29106d7-eaa0-443e-8d13-ab38bc8fec37",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        304
      ],
      "parameters": {
        "width": 464,
        "height": 224,
        "content": "## Edit these nodes!\n"
      }
    },
    {
      "id": "c26e3c80-5e7a-4013-bdca-d06e18639572",
      "name": "Warning AI1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2176,
        96
      ],
      "parameters": {
        "width": 360,
        "height": 168,
        "content": "## ⚠️ Important!\n\nPlease enter Zoho Mail credentials for the nodes: **GetAccountsID, Get Attachment Info, and Get Attachment Content**.\""
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Build Email HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Context": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get AccountsID": {
      "main": [
        [
          {
            "node": "Get Attachment Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Attachment?": {
      "main": [
        [
          {
            "node": "Get AccountsID",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Forward Email (No Attachments)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Email HTML": {
      "main": [
        [
          {
            "node": "Has Attachment?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Zoho Mail Trigger": {
      "main": [
        [
          {
            "node": "Set Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Attachment Info": {
      "main": [
        [
          {
            "node": "Split Out Attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Attachments": {
      "main": [
        [
          {
            "node": "Build Attachment List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Attachment List": {
      "main": [
        [
          {
            "node": "Forward Email with Attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Attachments": {
      "main": [
        [
          {
            "node": "Get Attachment Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Attachment Content": {
      "main": [
        [
          {
            "node": "Aggregate Attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Forward Email (No Attachments)": {
      "main": [
        [
          {
            "node": "Notify Admin via Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Forward Email with Attachments": {
      "main": [
        [
          {
            "node": "Notify Admin via Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}