Automation library · Lead generation

Leads generation workflow with OpenAI and Google Sheets

Started by an incoming WhatsApp message, and works across Google Sheets, Pinecone, Slack, Telegram and one other. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 26 steps, 4 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAIRetrieval

26 stepsLarge: read it before trusting it with anything live
4Branches: places the flow splits
0Loops or waits
5Services it connects to

The flow

Starts it 3Model 5Logic 10Service 8

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

  1. 1OpenAI Chat ModelLm Chat Open AiModel
  2. 2Postgres Chat MemoryMemory Postgres ChatModel
  3. 3Embeddings OpenAIEmbeddings Open AiModel
  4. 4WhatsApp TriggerWhats App triggerStarts it
  5. 5Telegram TriggerTelegram triggerStarts it
  6. 6Slack TriggerSlack triggerStarts it
  7. 7getMemoriesGoogle Sheets ToolService
  8. 8getNotesGoogle Sheets ToolService
  9. 9saveMemoryGoogle Sheets ToolService
  10. 10saveNotesGoogle Sheets ToolService
  11. 11saveLeadsGoogle Sheets ToolService
  12. 12AI AgentAgentModel
  13. 13Pinecone Vector Store1Vector Store PineconeModel
  14. 14SwitchSwitchLogic
  15. 15Switch1SwitchLogic
  16. 16Is user message?IfLogic
  17. 17Switch2SwitchLogic
  18. 18Edit Fields3SetLogic
  19. 19Edit FieldsSetLogic
  20. 20Edit Fields1SetLogic
  21. 21Edit Fields2SetLogic
  22. 22No Operation, do nothingNo OpLogic
  23. 23WhatsApp Business CloudWhats AppService
  24. 24TelegramTelegramService
  25. 25SlackSlackService
  26. 26MergeMergeLogic

How it's built

Starts on
An incoming WhatsApp message
Steps
26, with 4 branches
Size
Large: read it before trusting it with anything live
Connects to
Google Sheets, Pinecone, Slack, Telegram, WhatsApp
Model
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 Google Sheets, Pinecone, Slack, Telegram and WhatsApp accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming WhatsApp message.

Does it use AI?

Yes. It calls 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 26 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 26 steps before you point it at anything that matters.