Automation library · Lead generation

Complete B2B sales pipeline: Apollo lead gen, Mailgun outreach

Started by an incoming Telegram message, and works across Apify, Gmail, Postgres, Supabase and one other. It puts Claude and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 96 steps, 8 branches, 12 loops or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: Claude, OpenAIRetrieval

96 stepsLarge: read it before trusting it with anything live
8Branches: places the flow splits
12Loops or waits
5Services it connects to

The flow

Starts it 6Model 12Logic 28Service 14

The steps in the order they run, from what starts it. The first 60 of 96.

  1. 1Schedule Trigger1Schedule triggerStarts it
  2. 2OpenAI Chat ModelLm Chat Open AiModel
  3. 3Structured Output ParserOutput Parser StructuredModel
  4. 4Schedule Trigger3Schedule triggerStarts it
  5. 5Schedule Trigger4Schedule triggerStarts it
  6. 6Schedule Trigger6Schedule triggerStarts it
  7. 7OpenAI Chat Model1Lm Chat Open AiModel
  8. 8Simple MemoryMemory Buffer WindowModel
  9. 9User messageTelegram triggerStarts it
  10. 10Structured Output Parser1Output Parser StructuredModel
  11. 11Gmail TriggerGmail triggerStarts it
  12. 12Get Email HistoryGmail ToolService
  13. 13Check Sent HistoryGmail ToolService
  14. 14Email Response ParserOutput Parser StructuredModel
  15. 15Anthropic Chat Model1Lm Chat AnthropicModel
  16. 16Supabase2SupabaseService
  17. 17create email sequenceAgentModel
  18. 18Get many rowsSupabaseService
  19. 19Supabase11SupabaseService
  20. 20Supabase13SupabaseService
  21. 21Scraper agentAgentModel
  22. 22Voice or Text1SwitchLogic
  23. 23extract emailCodeLogic
  24. 24Professional Email Response AgentAgentModel
  25. 25Sort2SortLogic
  26. 26CodeCodeLogic
  27. 27If3IfLogic
  28. 28Evualute when the mail was sentCodeLogic
  29. 29Evualute when the mail was sent1CodeLogic
  30. 30Generate query payloadSetLogic
  31. 31Select already scraped mailsPostgresService
  32. 32Download File1TelegramService
  33. 33Text1SetLogic
  34. 34Execute a SQL queryPostgresService
  35. 35Create Draft ResponseGmailService
  36. 36If2IfLogic
  37. 37MergeMergeLogic
  38. 38Sort1SortLogic
  39. 39No Operation, do nothingNo OpLogic
  40. 40If1IfLogic
  41. 41IfIfLogic
  42. 42Create URLCodeLogic
  43. 43Keep only the new leadsCompare DatasetsService
  44. 44Transcribe1Open AiModel
  45. 45Only from email campaignsFilterLogic
  46. 46Limit1LimitLogic
  47. 47No Operation, do nothing2No OpLogic
  48. 48Time ZoneCodeLogic
  49. 49LimitLimitLogic
  50. 50SortSortLogic
  51. 51No Operation, do nothing1No OpLogic
  52. 52Sort3SortLogic
  53. 53No Operation, do nothing4No OpLogic
  54. 54Run an ActorApifyService
  55. 55Already scrapedNo OpLogic
  56. 56Create rows with new leadsSupabaseService
  57. 57Set replied = Yes PostgresService
  58. 58SwitchSwitchLogic
  59. 59Sender EmailCodeLogic
  60. 60research about companyOpen AiModel

How it's built

Starts on
An incoming Telegram message
Steps
96, with 8 branches, 12 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
Apify, Gmail, Postgres, Supabase, Telegram
Model
Claude, OpenAI
Retrieval
Answers are drawn from documents you supply, not from the model alone

Questions

What does it need to run?

An n8n account, plus your own Apify, Gmail, Postgres, Supabase and Telegram accounts, and a key for Claude and OpenAI. 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 Claude and OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

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