{
  "name": "Email AI Agent (with step by step video)",
  "nodes": [
    {
      "id": "05d9f7e7-732e-43cf-8fe9-c39d93a883b5",
      "name": "New Email Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -160,
        -96
      ]
    },
    {
      "id": "a0e24a38-97a2-4ebb-afb3-e85acb45f4d6",
      "name": "Get Knowledge Base Data",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        48,
        -96
      ]
    },
    {
      "id": "6519b2ee-0531-486e-9617-c44e698c87b3",
      "name": "Get Gmail Labels List",
      "type": "n8n-nodes-base.gmail",
      "position": [
        256,
        -96
      ]
    },
    {
      "id": "af7c86e5-b053-4249-a0ad-706ea44b0f91",
      "name": "Aggregate Labels Data",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        464,
        -96
      ]
    },
    {
      "id": "a1b8fbb2-7734-4fad-bcf6-63024c4973d1",
      "name": "Email Categorization AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        672,
        -96
      ]
    },
    {
      "id": "e41713e6-a016-48ce-8beb-f779113f00bc",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        608,
        128
      ]
    },
    {
      "id": "d051c34c-f150-4d55-9081-85a9785f1855",
      "name": "Create a draft in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1024,
        128
      ]
    },
    {
      "id": "9232f3c7-6c4e-496c-8011-2dbfb0a36d30",
      "name": "Add label to message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        896,
        128
      ]
    },
    {
      "id": "2a40a82a-0e15-43b8-aefb-75f283ca8f65",
      "name": "Send a text message in Telegram",
      "type": "n8n-nodes-base.telegramTool",
      "position": [
        768,
        128
      ]
    },
    {
      "id": "doc-note-1769185385297",
      "name": "Workflow Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        -246
      ],
      "parameters": {
        "width": 600,
        "height": 1043,
        "content": "## Workflow Overview\n\nThis workflow creates an AI-powered email assistant that automatically processes incoming Gmail messages. When a new email arrives, the AI agent categorizes it (such as \"existing"
      }
    },
    {
      "id": "contact-note-1769185448256",
      "name": "Creator Contact Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        -706
      ],
      "parameters": {
        "width": 600,
        "height": 440,
        "content": "# Contact Us:\n## Milan @ SmoothWork - [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n![Milan](https://gravatar.com/avatar/95700d17ba300a9f14c1b8cacf933df7720027b3adda9cbe6183d891429"
      }
    },
    {
      "id": "video-note-1769187077818",
      "name": "Video Walkthrough",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -250,
        -706
      ],
      "parameters": {
        "width": 420,
        "height": 340,
        "content": "# Video Walkthrough\n[![image.png](https://vasarmilan-public.s3.us-east-1.amazonaws.com/blog_thumbnails/thumbnail_rec5lxlsWWeV1B327.jpg)](https://www.youtube.com/watch?v=UEcE0cXlQ5g)"
      }
    }
  ],
  "connections": {
    "New Email Trigger": {
      "main": [
        [
          {
            "node": "Get Knowledge Base Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Email Categorization AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Labels Data": {
      "main": [
        [
          {
            "node": "Email Categorization AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Gmail Labels List": {
      "main": [
        [
          {
            "node": "Aggregate Labels Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a draft in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Email Categorization AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Knowledge Base Data": {
      "main": [
        [
          {
            "node": "Get Gmail Labels List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add label to message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Email Categorization AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message in Telegram": {
      "ai_tool": [
        [
          {
            "node": "Email Categorization AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}