Automation library · Data collection

Build Gmail contact database with Brave Search

Started by an event in a connected app, and works across Gmail and Google Sheets. It hands the judgement calls to OpenAI. 25 steps, 3 branches, 3 loops or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

25 stepsLarge: read it before trusting it with anything live
3Branches: places the flow splits
3Loops or waits
2Services it connects to

The flow

Starts it 1Model 2Logic 17Service 5

The steps in the order they run, from what starts it.

  1. 1When clicking ‘Execute workflow’Manual triggerStarts it
  2. 2OpenAI Chat ModelLm Chat Open AiModel
  3. 3LoadSentMessagesGmailService
  4. 4Information ExtractorInformation ExtractorModel
  5. 5SelectTo&CCSetLogic
  6. 6MergeCodeLogic
  7. 7Remove DuplicatesRemove DuplicatesLogic
  8. 8WriteToDBGoogle SheetsService
  9. 9Loop Over ItemsSplit In BatchesLogic
  10. 10No Operation, do nothingNo OpLogic
  11. 113sWaitLogic
  12. 12GetInboxMessagesGmailService
  13. 13InboxMessages?IfLogic
  14. 14SelectImportantFieldsSetLogic
  15. 15MailParserCodeLogic
  16. 16ValidDomain?IfLogic
  17. 17SearchWebsiteBrave SearchService
  18. 18No Operation, do nothing1No OpLogic
  19. 19GetClusters1CodeLogic
  20. 20HaveClustersIfLogic
  21. 21Loop Over Items1Split In BatchesLogic
  22. 22ReturnContactFromMailParserCodeLogic
  23. 23HTMLParserCodeLogic
  24. 24GetHTMLHttp RequestService
  25. 25AggregateAggregateLogic

How it's built

Starts on
An event in a connected app
Steps
25, with 3 branches, 3 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Sheets
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail and Google Sheets accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 25 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 25 steps before you point it at anything that matters.