{
  "name": "Build Gmail contact database with GPT-5 Nano, Brave Search & Google Sheets",
  "nodes": [
    {
      "id": "6496a003-58aa-48ee-aab6-fe3f66518070",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2016,
        -144
      ]
    },
    {
      "id": "c01e946f-a80f-438c-b967-07b466dd9ab9",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1312,
        -144
      ]
    },
    {
      "id": "6cb6cd5f-6b12-4881-bdbc-22618814284a",
      "name": "Remove Duplicates",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        -1504,
        -144
      ]
    },
    {
      "id": "5c1f7978-d638-42c6-9a93-f4c3e49189ae",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -1312,
        -480
      ]
    },
    {
      "id": "71db1984-814a-4cda-a3c8-6550a50ae094",
      "name": "3s",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1120,
        -80
      ]
    },
    {
      "id": "9da7b0fd-57f4-44d9-87d9-61087d660b0f",
      "name": "GetHTML",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        32
      ]
    },
    {
      "id": "39fdafbb-2669-4dbe-b30d-596d960e5338",
      "name": "MailParser",
      "type": "n8n-nodes-base.code",
      "position": [
        -624,
        336
      ]
    },
    {
      "id": "90310a89-c904-4f0b-8459-a8936289b573",
      "name": "HTMLParser",
      "type": "n8n-nodes-base.code",
      "position": [
        848,
        -64
      ]
    },
    {
      "id": "37e7b272-b040-48ad-988c-fae2d699124b",
      "name": "SearchWebsite",
      "type": "@brave/n8n-nodes-brave-search.braveSearch",
      "position": [
        -288,
        48
      ]
    },
    {
      "id": "c2be9ffd-5e4a-4973-ba62-2fed3d3814cd",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        272,
        16
      ]
    },
    {
      "id": "1030fb06-7742-4f91-9181-6ce03192be9e",
      "name": "No Operation, do nothing1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -112,
        352
      ]
    },
    {
      "id": "016004af-0c29-42ab-b4c7-00d5b0e41939",
      "name": "InboxMessages?",
      "type": "n8n-nodes-base.if",
      "position": [
        -784,
        -80
      ]
    },
    {
      "id": "94f0a766-e322-4c48-bfb1-f0bb1e720b16",
      "name": "ValidDomain?",
      "type": "n8n-nodes-base.if",
      "position": [
        -448,
        336
      ]
    },
    {
      "id": "7e1e609c-f4f1-4513-a408-a28de29939bc",
      "name": "GetInboxMessages",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -944,
        -80
      ]
    },
    {
      "id": "5d6ace50-de7f-46f0-95c6-6bdfd37c387f",
      "name": "SelectTo&CC",
      "type": "n8n-nodes-base.set",
      "position": [
        -1664,
        -144
      ]
    },
    {
      "id": "c410c068-c1ba-4624-83e4-da282f05aa1d",
      "name": "LoadSentMessages",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1840,
        -144
      ]
    },
    {
      "id": "31188212-380d-4aeb-8746-ff568e2a939e",
      "name": "WriteToDB",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1072,
        368
      ]
    },
    {
      "id": "cfdc0dc5-f981-408f-895e-83807d8779fd",
      "name": "SelectImportantFields",
      "type": "n8n-nodes-base.set",
      "position": [
        -560,
        -416
      ]
    },
    {
      "id": "1d80e46a-3af8-4d90-bdd5-b04dac6d0e94",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        -352,
        -416
      ]
    },
    {
      "id": "e4aca200-2256-4de4-8a73-2474d30cff27",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -432,
        -256
      ]
    },
    {
      "id": "9d8cbfad-b81c-498f-b80f-826061ffda22",
      "name": "Merge",
      "type": "n8n-nodes-base.code",
      "position": [
        848,
        -224
      ]
    },
    {
      "id": "9bc210e5-7292-490c-a06c-b60787c847f0",
      "name": "HaveClusters",
      "type": "n8n-nodes-base.if",
      "position": [
        32,
        48
      ]
    },
    {
      "id": "f06aa3f9-3814-4c0e-864f-715930ed4c54",
      "name": "ReturnContactFromMailParser",
      "type": "n8n-nodes-base.code",
      "position": [
        160,
        256
      ]
    },
    {
      "id": "8075ed4e-2c33-42dc-a043-f8a26497ed1c",
      "name": "GetClusters1",
      "type": "n8n-nodes-base.code",
      "position": [
        -128,
        48
      ]
    },
    {
      "id": "a4010343-622e-4fe1-8ead-ab6c0f4d0fc4",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        656,
        32
      ]
    },
    {
      "id": "2ed4d613-42e9-48c2-9e9c-fcc4c931ee98",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2048,
        -304
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "a2b6ae22-af1f-4c73-a06e-2d5229ac7b7d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        -144
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "d5e9e02f-9f68-44b1-9aa9-4898c2366483",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -96
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "5b809cf6-fe1e-455b-ad02-7214123c14a2",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -576
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "d9a75660-6028-41f5-b2e8-f2e85a46ceb2",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2432,
        -512
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "cd90fc19-4899-4c4f-9a65-252a5690494e",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        -336
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "ab87283e-ce39-4ed1-9659-ca9c2a613d5e",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        192
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "3s": {
      "main": [
        [
          {
            "node": "GetInboxMessages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "WriteToDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetHTML": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WriteToDB": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTMLParser": {
      "main": [
        [
          {
            "node": "WriteToDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MailParser": {
      "main": [
        [
          {
            "node": "ValidDomain?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SelectTo&CC": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetClusters1": {
      "main": [
        [
          {
            "node": "HaveClusters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HaveClusters": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ReturnContactFromMailParser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ValidDomain?": {
      "main": [
        [
          {
            "node": "SearchWebsite",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SearchWebsite": {
      "main": [
        [
          {
            "node": "GetClusters1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "InboxMessages?": {
      "main": [
        [
          {
            "node": "SelectImportantFields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "MailParser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "3s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetInboxMessages": {
      "main": [
        [
          {
            "node": "InboxMessages?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LoadSentMessages": {
      "main": [
        [
          {
            "node": "SelectTo&CC",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "HTMLParser",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "GetHTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SelectImportantFields": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Operation, do nothing1": {
      "main": [
        [
          {
            "node": "WriteToDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ReturnContactFromMailParser": {
      "main": [
        [
          {
            "node": "WriteToDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "LoadSentMessages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}