Automation library · Lead generation

Generate B2B Leads with SerpAPI

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

LargeCalls a model: OpenAI

38 stepsLarge: read it before trusting it with anything live
5Branches: places the flow splits
2Loops or waits
1Service it connects to

The flow

Starts it 1Model 3Logic 19Service 15

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

  1. 1When clicking ‘Execute workflow’Manual triggerStarts it
  2. 2Edit FieldsSetLogic
  3. 3Compute search keyCodeLogic
  4. 4Upsert search keyGoogle SheetsService
  5. 5Get row(s) in sheetGoogle SheetsService
  6. 6If template existsIfLogic
  7. 7Turn into search termsCodeLogic
  8. 8Generate SerpAPI queryOpen AiModel
  9. 9Verify and limit query amountLimitLogic
  10. 10Add templateGoogle SheetsService
  11. 11SerpApi RequestHttp RequestService
  12. 12Extract itemsCodeLogic
  13. 13Increment run count by 1Google SheetsService
  14. 14Result validationsOpen AiModel
  15. 15MergeMergeLogic
  16. 16Filter out non-matching websitesFilterLogic
  17. 17Collect the domainsCodeLogic
  18. 18Instantly, Get ListHttp RequestService
  19. 19If list existsIfLogic
  20. 20Extract list IDSetLogic
  21. 21Instantly Lead List, CreateHttp RequestService
  22. 22Merge SS query and List IDMergeLogic
  23. 23Get rowGoogle SheetsService
  24. 24If lead list existsIfLogic
  25. 25If seach filters existIfLogic
  26. 26Instantly Lead List, Create temporaryHttp RequestService
  27. 27Instantly SuperSearch, CreateHttp RequestService
  28. 28Parse search filters to jsonCodeLogic
  29. 29Generate search filtersOpen AiModel
  30. 30Instantly SuperSearch, Create2Http RequestService
  31. 31Add search filtersGoogle SheetsService
  32. 32Instantly, Move Leads to Master ListHttp RequestService
  33. 33Loop for 5 timesCodeLogic
  34. 34Loop Over ItemsSplit In BatchesLogic
  35. 35Wait 15sWaitLogic
  36. 36Instantly, Check Move JobHttp RequestService
  37. 37If move succeededIfLogic
  38. 38Instantly, Delete Temp Lead ListHttp RequestService

How it's built

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

Questions

What does it need to run?

An n8n account, plus your own Google Sheets account, 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 38 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 38 steps before you point it at anything that matters.