Automation library · Lead generation

Smart HubSpot lead matching and enrichment

Started by an incoming Telegram message, and works across Google Sheets, HubSpot and Telegram. It hands the judgement calls to Gemini. 32 steps, 4 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: Gemini

32 stepsLarge: read it before trusting it with anything live
4Branches: places the flow splits
1Loop or waits
3Services it connects to

The flow

Starts it 2Model 2Logic 18Service 10

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

  1. 1Telegram TriggerTelegram triggerStarts it
  2. 2New or Updated rowGoogle Sheets triggerStarts it
  3. 3Parse Telegram MessageGoogle GeminiModel
  4. 4Filter processed linesFilterLogic
  5. 5Format Telegram Lead DataCodeLogic
  6. 6Get HubSpot dataHttp RequestService
  7. 7Domain ResolverGoogle GeminiModel
  8. 8Append Resolved Domain to LeadMergeLogic
  9. 9Combine Lead with CRM Reference DataMergeLogic
  10. 10Split HubSpot Search ResultsSplit OutLogic
  11. 11Match Lead to Existing CompanyCodeLogic
  12. 12Mark as HubSpot Reference DataCodeLogic
  13. 13Switch LogicSwitchLogic
  14. 14HubSpot: Update CompanyHubspotService
  15. 15HubSpot: Create CompanyHubspotService
  16. 16Switch on email fieldSwitchLogic
  17. 17Lusha Enrichment - emailHttp RequestService
  18. 18Resolve Company IDCodeLogic
  19. 19Map Contact Enrichment DataCodeLogic
  20. 20Validate Company ID StatusSwitchLogic
  21. 21Retry ID resolutionWaitLogic
  22. 22Add a Note to Hubspot companyHttp RequestService
  23. 23Check for Existing Contact EmailSwitchLogic
  24. 24Lusha Company EnrichmentHttp RequestService
  25. 25Create or update a contactHubspotService
  26. 26Identify Telegram triggered flowFilterLogic
  27. 27Identify updated rowFilterLogic
  28. 28Prepare Firmographic UpdatesCodeLogic
  29. 29Update Telegram userTelegramService
  30. 30Acknowledge in sheetGoogle SheetsService
  31. 31Filter Leads with Data ChangesFilterLogic
  32. 32HubSpot: Update Enriched CompanyHttp RequestService

How it's built

Starts on
An incoming Telegram message
Steps
32, with 4 branches, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Google Sheets, HubSpot, Telegram
Model
Gemini

Questions

What does it need to run?

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

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

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

How long does it take to set up?

Take your time. At 32 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 32 steps before you point it at anything that matters.