{
  "name": "Auto-reply to emails using Google Gemini AI and SendGrid",
  "nodes": [
    {
      "id": "1356b3c8-8cad-4ff4-8262-a691840401ad",
      "name": "Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        -560
      ],
      "parameters": {
        "width": 504,
        "height": 1148,
        "content": "# Email chatbot workflow using AI Agent and SendGrid\n\n## Watch this tutorial\n@[youtube](aZU_vAyBuSQ)\n\n## How it works\nThis workflow automatically replies to incoming emails using AI-powered responses:"
      }
    },
    {
      "id": "1b31d1d5-5524-4eb0-a595-9e015ed8ad5e",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        64,
        224
      ]
    },
    {
      "id": "e80e12a5-79b8-484b-bd2c-912891c542d2",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        224,
        240
      ]
    },
    {
      "id": "206c2148-923a-4a12-859b-3cf0eb3bd113",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -384
      ],
      "parameters": {
        "width": 800,
        "height": 288,
        "content": "## 1. Read incoming email"
      }
    },
    {
      "id": "2aa834ca-d260-4801-9128-27f2ba668f10",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -80
      ],
      "parameters": {
        "width": 800,
        "height": 480,
        "content": "## 2. Generate email reply and send"
      }
    },
    {
      "id": "2ac3002e-4966-4bed-91cf-dd3e04ab4c1f",
      "name": "Pause for 20 seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        96,
        -272
      ]
    },
    {
      "id": "f18aa35c-562a-436f-9b31-cca486028648",
      "name": "Set your details",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        -272
      ]
    },
    {
      "id": "fd1c7b07-eddd-448b-b01f-91e423811384",
      "name": "Check if email exists",
      "type": "n8n-nodes-base.if",
      "position": [
        -128,
        32
      ]
    },
    {
      "id": "8b0cbe4c-556e-46bd-8123-52f551d1b04b",
      "name": "Send reply email",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        400,
        16
      ]
    },
    {
      "id": "f1af183f-2008-4512-9b5c-4293a5757b71",
      "name": "Generate reply email",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        96,
        16
      ]
    },
    {
      "id": "560fe41f-b83f-4f21-b675-38676a2ec8d2",
      "name": "Read incoming emails",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        -128,
        -272
      ]
    }
  ],
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Generate reply email",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Set your details": {
      "main": [
        [
          {
            "node": "Check if email exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate reply email": {
      "main": [
        [
          {
            "node": "Send reply email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pause for 20 seconds": {
      "main": [
        [
          {
            "node": "Set your details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read incoming emails": {
      "main": [
        [
          {
            "node": "Pause for 20 seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if email exists": {
      "main": [
        [
          {
            "node": "Generate reply email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate reply email",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}