{
  "name": "AI-powered lead email classification & auto-reply with GPT-4o and Gmail",
  "nodes": [
    {
      "id": "46330a1e-99c2-4e0b-b2ef-fbc1ac382402",
      "name": "Email Trigger (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "2a2a35ef-23cf-4612-ac7d-21f91f21a2c6",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        608,
        0
      ]
    },
    {
      "id": "ddba86b4-fe7d-4c36-b42c-6dde939d05f4",
      "name": "Get Message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1216,
        0
      ]
    },
    {
      "id": "f1b3f3c5-a2fe-436e-a272-d3958ccab3e5",
      "name": "Reply to Message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1536,
        0
      ]
    },
    {
      "id": "2489c348-5d8e-4564-915f-1d933eae745b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        -320
      ],
      "parameters": {
        "width": null,
        "height": 256,
        "content": "## Reply to Message\nSends the AI-generated reply back to the sender as a direct response to their email.  \nThe reply will appear as part of the same conversation thread in the recipient’s inbox.  \n[Gu"
      }
    },
    {
      "id": "e7617aa6-1104-4cc9-af36-80d7c19cdc59",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -320
      ],
      "parameters": {
        "width": 208,
        "height": 256,
        "content": "## Email Trigger (IMAP)\nMake sure to replace you own [service/offer] in the prompt\nChecks your email inbox for new incoming messages in real time using the IMAP protocol.  \nThis node is the entry poin"
      }
    },
    {
      "id": "33fe0c88-6540-4087-bb60-ac6c4de9f6d3",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -320
      ],
      "parameters": {
        "width": null,
        "height": 256,
        "content": "## Is Lead? (Message Model)\nUses an AI model to analyze the incoming email and determine whether the sender is a potential lead.  \nThe AI looks for keywords, tone, and intent within the message to cla"
      }
    },
    {
      "id": "54c5cf98-a106-4e3b-ad2d-d57fb8095044",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        -320
      ],
      "parameters": {
        "width": null,
        "height": 256,
        "content": "## Filter\nFilters out emails that are NOT classified as leads.  \nOnly messages identified as leads will continue through the workflow for an automated reply.\n"
      }
    },
    {
      "id": "94aedcf9-6abb-40e0-9856-e2fc3a84116a",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        -320
      ],
      "parameters": {
        "width": null,
        "height": 256,
        "content": "## Reply with customized message (Message Model)\nGenerates a personalized reply using AI based on the content of the incoming email.  \nMake sure to replace your own \"business/service\" in the prompt.\n\n"
      }
    },
    {
      "id": "83e57764-c096-45fc-a475-0167caa7eeaf",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        -320
      ],
      "parameters": {
        "width": 256,
        "height": 256,
        "content": "## Get Message\nRetrieves the full details of the original email, including the sender’s address and the conversation thread.  \nEnsures the reply is linked to the correct email conversation.  \n[Guide]("
      }
    },
    {
      "id": "4875fac3-0ca1-4d26-a116-3afcfe8477c9",
      "name": "Filter leads",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        240,
        0
      ]
    },
    {
      "id": "7c5f6533-c82e-4fa2-b794-c93b38903c7c",
      "name": "Reply with customized message",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        848,
        0
      ]
    }
  ],
  "connections": {
    "Filter": {
      "main": [
        [
          {
            "node": "Reply with customized message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Message": {
      "main": [
        [
          {
            "node": "Reply to Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter leads": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Trigger (IMAP)": {
      "main": [
        [
          {
            "node": "Filter leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply with customized message": {
      "main": [
        [
          {
            "node": "Get Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}