AutomationFlowsAI & RAG › Build Gmail Contact Database with Gpt-5 Nano, Brave Search & Google Sheets

Build Gmail Contact Database with Gpt-5 Nano, Brave Search & Google Sheets

ByVáclav Čikl @venca on n8n.io

Transform your Gmail sent folder into a comprehensive, enriched contact database automatically. This workflow processes hundreds or thousands of sent emails, extracting and enriching contact information using AI and web search – saving days of manual work. Loads sent Gmail…

Event trigger★★★★★ complexityAI-powered32 nodesHTTP Request@Brave/N8N Nodes Brave SearchGmailGoogle SheetsInformation ExtractorOpenAI Chat
AI & RAG Trigger: Event Nodes: 32 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #10778 — we link there as the canonical source.

This workflow follows the Gmail → Google Sheets recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

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

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Transform your Gmail sent folder into a comprehensive, enriched contact database automatically. This workflow processes hundreds or thousands of sent emails, extracting and enriching contact information using AI and web search – saving days of manual work. Loads sent Gmail…

Source: https://n8n.io/workflows/10778/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Author: CSChin Example Source: https://www.ncl.ac.uk/singapore/staff/profile/chengchin.html#publications

HTTP Request, OpenAI Chat, Form Trigger +3
AI & RAG

Eliminate 90% of manual work in procurement by automating quote requests, response tracking, price extraction, and supplier follow-ups. This complete automation handles everything from sending persona

Gmail, Google Sheets, Information Extractor +2
AI & RAG

This workflow is ideal for HR professionals, recruiters, and small businesses looking to streamline resume screening with AI-powered analysis and CRM integration.

Jot Form Trigger, Postgres, OpenAI +5
AI & RAG

This comprehensive workflow automates the entire invoice processing pipeline by monitoring a Google Drive folder for new invoice uploads, intelligently processing both PDF and image formats, extractin

OpenAI Chat, Google Drive Trigger, Google Drive +4
AI & RAG

Detects new unread Gmail messages Extracts sender name for personalized replies Classifies the email into one of four categories Applies the correct Gmail label and either sends an auto-reply, creates

Gmail Trigger, OpenAI Chat, Gmail +4