{
  "nodes": [
    {
      "id": "1bc1be3b-42cf-45be-b3cc-8ebb0dfecd62",
      "name": "Zoho Mail Trigger",
      "type": "@zohomail/n8n-nodes-zohomail.zohoMailTrigger",
      "position": [
        688,
        368
      ],
      "parameters": {
        "from": "user@example.com,user@example.com...",
        "account": "5263509+1234567890",
        "matchingcondition": "and"
      },
      "credentials": {
        "zohoMailOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3c5ec7d1-7881-4db5-bdcc-0d4e2bd1be62",
      "name": "Set Context",
      "type": "n8n-nodes-base.set",
      "position": [
        944,
        368
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg-001",
              "name": "forward_to",
              "type": "string",
              "value": "[YOUR_2ND_EMAIL]"
            },
            {
              "id": "cfg-002",
              "name": "subject_prefix",
              "type": "string",
              "value": "[Forward]"
            },
            {
              "id": "cfg-003",
              "name": "telegram_chat_id",
              "type": "string",
              "value": "[YOUR_ID_TELEGRAM]"
            },
            {
              "id": "cfg-004",
              "name": "footer_note",
              "type": "string",
              "value": "Email automatically forwarded by the GenStaff system \u00b7 Analyzed by Gemini AI"
            },
            {
              "id": "cfg-005",
              "name": "ai_context",
              "type": "string",
              "value": "You are an intelligent email analysis assistant. The user needs you to analyze incoming emails and extract key information so they can quickly handle them without reading the entire content."
            },
            {
              "id": "cfg-006",
              "name": "ai_type_options",
              "type": "string",
              "value": "Notification \n Action Required \n Invoice / Payment \n Confirmation \n Alert \n Policy Information \n Other"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "af50f0a0-55f7-4ce0-a79f-681ff279f2de",
      "name": "Has Attachment?",
      "type": "n8n-nodes-base.if",
      "position": [
        1888,
        368
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "fff035c8-4c16-4503-9407-e4fc4e6af938",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Zoho Mail Trigger').item.json.hasAttachment }}",
              "rightValue": "Yes"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "5f8ace38-356f-4fee-a330-53077172b9ba",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1248,
        368
      ],
      "parameters": {
        "text": "=**Ti\u00eau \u0111\u1ec1:** {{ $('Zoho Mail Trigger').item.json.subject }}\n\n**G\u1eedi t\u1eeb:** {{ $('Zoho Mail Trigger').item.json.fromAddress }}\n\n**N\u1ed9i dung t\u00f3m t\u1eaft:** {{ $('Zoho Mail Trigger').item.json.summary || $('Zoho Mail Trigger').item.json.subject }}",
        "options": {
          "systemMessage": "={{ $('Set Context').item.json.ai_context }}\n\nPlease analyze the email below and return JSON with the exact structure as described.\n\n**Available email types to choose from:** {{ $('Set Context').item.json.ai_type_options }}\n\nReturn **valid JSON** with the following fields:\n\n{\n  \"type\": \"string - classify the email, choose ONLY ONE from the options above\",\n  \"priority\": \"string - 'High' | 'Medium' | 'Low'\",\n  \"summary\": \"string - summarize the main content, 2-3 short sentences in the same language as the email\",\n  \"deadline\": \"string | null - deadline date if available, format dd/MM/yyyy, null if not present\",\n  \"action_required\": \"string | null - specific action the recipient needs to take, null if only informational\",\n  \"key_numbers\": [\"array of string - important numbers, codes, IDs mentioned (invoice, transaction ID, amounts...). Empty array if none\"]\n}\n\nExample:\n{\n  \"type\": \"Invoice\",\n  \"priority\": \"High\",\n  \"summary\": \"Email notification about the February service invoice that needs to be paid. The sender requests immediate action to avoid service interruption.\",\n  \"deadline\": \"10/03/2026\",\n  \"action_required\": \"Pay the service invoice before the deadline\",\n  \"key_numbers\": [\"HD20260215\", \"5000 USD\"]\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "faf5ca8e-cc54-409b-b148-65da34e71d43",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1472,
        560
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"type\": \"Invoice\",\n  \"priority\": \"High\",\n  \"summary\": \"Email notification about the February service invoice that needs to be paid. The sender requests immediate action to avoid service interruption.\",\n  \"deadline\": \"10/03/2026\",\n  \"action_required\": \"Pay the service invoice before the deadline\",\n  \"key_numbers\": [\"HD20260215\", \"5000 USD\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "0f511c40-080a-4792-917f-e6c855e35c81",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1104,
        576
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "afd8fee2-d150-48ed-9ea7-87e63573c384",
      "name": "Get AccountsID",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2192,
        224
      ],
      "parameters": {
        "url": "https://mail.zoho.com/api/accounts",
        "options": {},
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "zohoMailOAuth2Api"
      },
      "credentials": {
        "zohoMailOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "a8e2a076-18b1-41d1-9bac-ee1002c0da7e",
      "name": "Get Attachment Info",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2432,
        224
      ],
      "parameters": {
        "url": "=https://mail.zoho.com/api/accounts/{{ $('Get AccountsID').item.json.data[0].accountId }}/folders/{{ $('Zoho Mail Trigger').item.json.folderId }}/messages/{{ $('Zoho Mail Trigger').item.json.messageIdString }}/attachmentinfo",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "zohoMailOAuth2Api"
      },
      "credentials": {
        "zohoMailOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "b8d64c78-f509-4b04-861a-aba2106aeff7",
      "name": "Split Out Attachments",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2672,
        224
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "data.attachments"
      },
      "typeVersion": 1
    },
    {
      "id": "2e0450e8-005d-47b2-be12-bccfee93fbdb",
      "name": "Get Attachment Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2912,
        224
      ],
      "parameters": {
        "url": "=https://mail.zoho.com/api/accounts/{{ $('Get AccountsID').item.json.data[0].accountId }}/folders/{{ $('Zoho Mail Trigger').item.json.folderId }}/messages/{{ $('Zoho Mail Trigger').item.json.messageIdString }}/attachments/{{ $json.attachmentId }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/octet-stream"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "zohoMailOAuth2Api"
      },
      "credentials": {
        "zohoMailOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "b8aa8f22-fc5c-4239-a1f3-d3b41802d917",
      "name": "Aggregate Attachments",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3232,
        224
      ],
      "parameters": {
        "options": {
          "includeBinaries": true
        },
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "c47a4382-4460-465c-8adb-66ed00eed7fd",
      "name": "Build Attachment List",
      "type": "n8n-nodes-base.code",
      "position": [
        3488,
        224
      ],
      "parameters": {
        "jsCode": "const aggregated = $input.first();\nconst allBinaries = aggregated.binary || {};\nconst binaryKeys = Object.keys(allBinaries);\nif (binaryKeys.length === 0) throw new Error('No binary data found after aggregation.');\nreturn [{\n  json: { attachmentNames: binaryKeys.join(','), attachmentCount: binaryKeys.length },\n  binary: allBinaries\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "04420c65-49b2-4163-9b5e-46c44d7def93",
      "name": "Forward Email with Attachments",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3872,
        224
      ],
      "parameters": {
        "sendTo": "={{ $('Set Context').item.json.forward_to }}",
        "message": "={{ $('Build Email HTML').item.json.emailHtml }}",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {
                "property": "={{ $json.attachmentNames }}"
              }
            ]
          },
          "appendAttribution": false
        },
        "subject": "={{ $('Build Email HTML').item.json.emailSubject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "985cce0b-bb38-402d-bf87-b59e61240528",
      "name": "Forward Email (No Attachments)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3872,
        384
      ],
      "parameters": {
        "sendTo": "={{ $('Set Context').item.json.forward_to }}",
        "message": "={{ $('Build Email HTML').item.json.emailHtml }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $('Build Email HTML').item.json.emailSubject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b6e8de89-3b15-43a3-a500-a165eb9fb832",
      "name": "Notify Admin via Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4224,
        304
      ],
      "parameters": {
        "text": "=\ud83d\udcec *Email M\u1edbi*\n\n{{ $('Build Email HTML').item.json.ai_priority_emoji }} *\u01afu ti\u00ean: {{ $('Build Email HTML').item.json.ai_priority }}*\n\ud83d\udccb *Lo\u1ea1i:* {{ $('Build Email HTML').item.json.ai_type }}\n\n\ud83d\udcdd *T\u00f3m t\u1eaft:*\n{{ $('Build Email HTML').item.json.ai_summary }}{{ $('Build Email HTML').item.json.ai_deadline ? '\\n\\n\u23f0 *Deadline:* ' + $('Build Email HTML').item.json.ai_deadline : '' }}{{ $('Build Email HTML').item.json.ai_action ? '\\n\u2705 *C\u1ea7n l\u00e0m:* ' + $('Build Email HTML').item.json.ai_action : '' }}{{ $('Build Email HTML').item.json.ai_key_numbers ? '\\n\ud83d\udd22 *S\u1ed1 li\u1ec7u:* ' + $('Build Email HTML').item.json.ai_key_numbers : '' }}\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ud83d\udce7 *T\u1eeb:* {{ $('Zoho Mail Trigger').item.json.fromAddress }}\n\ud83d\udd50 *Nh\u1eadn l\u00fac:* {{ $('Zoho Mail Trigger').item.json.receivedTime.toDateTime().toFormat('HH:mm dd/MM/yyyy') }}\n\ud83d\udcce *\u0110\u00ednh k\u00e8m:* {{ $('Zoho Mail Trigger').item.json.hasAttachment === 'Yes' ? 'C\u00f3 \u2705' : 'Kh\u00f4ng \u274c' }}\n\u27a1\ufe0f *Chuy\u1ec3n t\u1edbi:* {{ $('Set Context').item.json.forward_to }}",
        "chatId": "={{ $('Set Context').item.json.telegram_chat_id }}",
        "additionalFields": {
          "parse_mode": "Markdown",
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "18d09588-033a-43e7-bdae-db8a5a011bb5",
      "name": "Build Email HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        368
      ],
      "parameters": {
        "jsCode": "const cfg  = $('Set Context').item.json;\nconst mail = $('Zoho Mail Trigger').item.json;\nconst ai   = $('AI Agent').item.json.output;\n\nconst priorityEmoji = { 'High': '\ud83d\udd34', 'Medium': '\ud83d\udfe1', 'Low': '\ud83d\udfe2' };\nconst emoji     = priorityEmoji[ai.priority] || '\ud83d\udfe1';\nconst badgeCss  = ai.priority === 'High' ? 'badge-high' : (ai.priority === 'Low' ? 'badge-low' : 'badge-mid');\nconst keyNums   = (ai.key_numbers || []).join(', ') || null;\n\nconst aiRows = [\n  `<p><span class=\"lbl\">Type:</span> ${ai.type}</p>`,\n  `<p><span class=\"lbl\">Priority:</span> <span class=\"badge ${badgeCss}\">${emoji} ${ai.priority}</span></p>`,\n  `<p><span class=\"lbl\">Summary:</span> ${ai.summary}</p>`,\n  ai.deadline        ? `<p><span class=\"lbl\">\u23f0 Deadline:</span> <strong>${ai.deadline}</strong></p>` : '',\n  ai.action_required ? `<p><span class=\"lbl\">\u2705 Action Required:</span> ${ai.action_required}</p>` : '',\n  keyNums            ? `<p><span class=\"lbl\">\ud83d\udd22 Key Numbers:</span> ${keyNums}</p>` : ''\n].filter(Boolean).join('\\n');\n\nconst html = `<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\">\n<style>\n  body{font-family:'Segoe UI',sans-serif;background:#f9fafb;margin:0;padding:40px;color:#1f2937}\n  .wrap{background:#fff;border-radius:12px;box-shadow:0 6px 20px rgba(0,0,0,.08);padding:30px;max-width:900px;margin:auto}\n  .ai-box{background:#eff6ff;border-left:4px solid #3b82f6;border-radius:8px;padding:16px 20px;margin-bottom:24px}\n  .ai-box h3{margin:0 0 12px;font-size:15px;color:#1d4ed8}\n  .ai-box p{margin:4px 0;font-size:14px;color:#1e40af}\n  .lbl{font-weight:600;display:inline-block;width:110px}\n  .badge{display:inline-block;padding:2px 10px;border-radius:12px;font-size:12px;font-weight:700}\n  .badge-high{background:#fee2e2;color:#b91c1c}\n  .badge-mid{background:#fef3c7;color:#92400e}\n  .badge-low{background:#d1fae5;color:#065f46}\n  .hdr{border-bottom:1px solid #e5e7eb;margin-bottom:20px;padding-bottom:15px}\n  .hdr p{margin:4px 0;font-size:14px}\n  .hdr span{font-weight:600;color:#111827}\n  .body-lbl{font-size:15px;font-weight:600;color:#2563eb;margin-bottom:10px}\n  .body-cnt{padding:15px;background:#f3f4f6;border-radius:8px;font-size:14px;line-height:1.7}\n  .footer{margin-top:20px;font-size:12px;color:#9ca3af;border-top:1px solid #e5e7eb;padding-top:12px}\n</style></head>\n<body><div class=\"wrap\">\n  <div class=\"ai-box\"><h3>\ud83e\udd16 AI Analysis</h3>${aiRows}</div>\n  <div class=\"hdr\">\n    <p><span>From:</span> ${mail.fromAddress}</p>\n    <p><span>To:</span> ${mail.toAddress}</p>\n    <p><span>Received At:</span> ${new Date(mail.receivedTime).toLocaleString('en-US',{timeZone:'Asia/Ho_Chi_Minh'})}</p>\n  </div>\n  <div class=\"body-lbl\">Original Content</div>\n  <div class=\"body-cnt\">${mail.html || mail.summary || '(No content available)'}</div>\n  <div class=\"footer\">${cfg.footer_note}</div>\n</div></body></html>`;\n\nreturn [{\n  json: {\n    emailHtml:         html,\n    emailSubject:      `${cfg.subject_prefix} ${emoji} [${ai.type}] ${mail.subject}`,\n    ai_priority:       ai.priority,\n    ai_priority_emoji: emoji,\n    ai_type:           ai.type,\n    ai_summary:        ai.summary,\n    ai_deadline:       ai.deadline || null,\n    ai_action:         ai.action_required || null,\n    ai_key_numbers:    keyNums\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "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 \u2192 Gmail + Telegram)\n\nThis workflow monitors a **Zoho Mail** inbox, automatically analyzes each incoming email with **Gemini AI**, then forwards it \u2014 including all attachments \u2014 to a designated recipient via **Gmail**. The admin receives an instant smart digest on **Telegram** without needing to open the email.\n\nAll behavior is controlled from a **single node** (`Set Context`). No other node needs editing to adapt this workflow to a different use case.\n\n### How it works\n1. **Zoho Mail Trigger** detects new incoming emails matching the configured sender filter.\n2. **Set Context** defines all runtime config: recipient, subject prefix, Telegram chat ID, footer text, AI role, and email category options.\n3. **Gemini AI** analyzes the email and extracts: type, priority level, summary, deadline, required action, and key numbers or IDs.\n4. **Build Email HTML** assembles the forwarded email body with an AI analysis panel embedded at the top \u2014 shared by both paths.\n5. **Has Attachment?** branches the flow: emails with files go through the Zoho attachment download pipeline before sending; emails without go directly to Gmail.\n6. **Gmail** forwards the formatted email to the configured recipient.\n7. **Telegram** notifies the admin with a structured, emoji-rich summary of the email.\n\n### Setup\n* [ ] Connect **Zoho Mail** OAuth2 credential in the Trigger and all Zoho API nodes.\n* [ ] Connect **Gmail** OAuth2 credential in both Gmail nodes.\n* [ ] Connect **Google Gemini** (`googlePalmApi`) credential in the AI Agent node.\n* [ ] Connect **Telegram Bot** credential in the Notify node.\n* [ ] Edit **Set Context** \u2014 update all 6 config fields to match your use case.\n* [ ] Edit **Zoho Mail Trigger** \u2014 update the `from` filter with your expected sender addresses.\n* [ ] Activate the workflow.\n\n### Customization tips\n* **Different inbox:** Swap Zoho Mail Trigger for Gmail Trigger or any other email node.\n* **Different AI behavior:** Change `ai_context` and `ai_type_options` in Set Context \u2014 no prompt editing needed elsewhere.\n* **Different notification channel:** Replace the Telegram node with Slack or Discord.\n\n### LICENCE\nThis template is for internal GenStaff use. Copyright belongs to Nguyen Thieu Toan. Any copying or modification must credit the author."
      },
      "typeVersion": 1
    },
    {
      "id": "d09c7c20-9702-426f-8547-0513acde7e99",
      "name": "Section 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 1120,
        "height": 576,
        "content": "## Section 1: Trigger & AI Analysis\nReceives new tax email from Zoho Mail \u2192 sets forward destination \u2192 **Gemini AI analyzes the email** (type, priority, deadline, invoice numbers, tax amount, required action) \u2192 routes by attachment status."
      },
      "typeVersion": 1
    },
    {
      "id": "d81b39ec-62c5-427e-b0b7-b1f88b9fa1ac",
      "name": "Section 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2128,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 1524,
        "height": 576,
        "content": "## Section 2: Attachment Download Pipeline\nFetches Account ID \u2192 gets attachment metadata \u2192 splits per file \u2192 downloads each binary \u2192 merges all into one item ready for Gmail."
      },
      "typeVersion": 1
    },
    {
      "id": "b8821e1f-06c5-4000-8167-3390c4636aeb",
      "name": "Section 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3776,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 676,
        "height": 576,
        "content": "## Section 3: Forward & Smart Notify\nBoth paths (with/without attachments) forward the email via Gmail \u2014 with an **AI analysis panel** embedded at the top of the email body. After sending, Telegram delivers a structured summary to the admin with priority level, deadline, and required action."
      },
      "typeVersion": 1
    },
    {
      "id": "7203dcc4-3147-4c6b-872c-8636349fb0d7",
      "name": "Author",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2128,
        592
      ],
      "parameters": {
        "color": 4,
        "width": 500,
        "height": 340,
        "content": "## Author Message\n\nHi! I am **Nguyen Thieu Toan (Jay Nguyen)** \u2014 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, optimizes your operations, or saves you time, you can buy me a coffee here: **[My Donate Website](https://nguyenthieutoan.com/payment/)** *(PayPal, Momo, Bank Transfer)*\n\n* Website: [nguyenthieutoan.com](https://nguyenthieutoan.com)\n* Email: me@nguyenthieutoan.com\n* Company: GenStaff ([genstaff.net](https://genstaff.net))\n* Socials (Facebook / X / LinkedIn): @nguyenthieutoan\n\n*Discover more of my automation solutions:* **[Click here](https://n8n.io/creators/nguyenthieutoan/)**"
      },
      "typeVersion": 1
    },
    {
      "id": "f29106d7-eaa0-443e-8d13-ab38bc8fec37",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        304
      ],
      "parameters": {
        "color": 3,
        "width": 464,
        "height": 224,
        "content": "## Edit these nodes!\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c26e3c80-5e7a-4013-bdca-d06e18639572",
      "name": "Warning AI1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2176,
        96
      ],
      "parameters": {
        "color": 3,
        "width": 360,
        "height": 168,
        "content": "## \u26a0\ufe0f Important!\n\nPlease enter Zoho Mail credentials for the nodes: **GetAccountsID, Get Attachment Info, and Get Attachment Content**.\""
      },
      "typeVersion": 1
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}