# Leads generation workflow with OpenAI and Google Sheets: n8n workflow

> Started by an incoming WhatsApp message, and works across Google Sheets, Pinecone, Slack, Telegram and one other.

Source: https://millionrounds.com/workflow/leads-generation-workflow-with-openai-and-google-sheets (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Lead generation](https://millionrounds.com/workflows?category=Lead+generation#library)

# 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.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fleads-generation-workflow-with-openai-and-google-sheets)

**26 steps** Large: read it before trusting it with anything live

**4** Branches: places the flow splits

**0** Loops or waits

**5** Services it connects to

## The flow

Starts it 3 Model 5 Logic 10 Service 8

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

- 1 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 2 **Postgres Chat Memory** Memory Postgres Chat *Model*
- 3 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 4 **WhatsApp Trigger** Whats App trigger *Starts it*
- 5 **Telegram Trigger** Telegram trigger *Starts it*
- 6 **Slack Trigger** Slack trigger *Starts it*
- 7 **getMemories** Google Sheets Tool *Service*
- 8 **getNotes** Google Sheets Tool *Service*
- 9 **saveMemory** Google Sheets Tool *Service*
- 10 **saveNotes** Google Sheets Tool *Service*
- 11 **saveLeads** Google Sheets Tool *Service*
- 12 **AI Agent** Agent *Model*
- 13 **Pinecone Vector Store1** Vector Store Pinecone *Model*
- 14 **Switch** Switch *Logic*
- 15 **Switch1** Switch *Logic*
- 16 **Is user message?** If *Logic*
- 17 **Switch2** Switch *Logic*
- 18 **Edit Fields3** Set *Logic*
- 19 **Edit Fields** Set *Logic*
- 20 **Edit Fields1** Set *Logic*
- 21 **Edit Fields2** Set *Logic*
- 22 **No Operation, do nothing** No Op *Logic*
- 23 **WhatsApp Business Cloud** Whats App *Service*
- 24 **Telegram** Telegram *Service*
- 25 **Slack** Slack *Service*
- 26 **Merge** Merge *Logic*

## 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.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fleads-generation-workflow-with-openai-and-google-sheets)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Pinecone](https://millionrounds.com/workflows?service=Pinecone#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)[WhatsApp](https://millionrounds.com/workflows?service=WhatsApp#library)

## Workflows like it

Also lead generation, with the same services where possible, closest in size first.

- [**Extract Google Maps business leads with Apify and OpenAI** 26 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/extract-google-maps-business-leads-with-apify-and-openai)
- [**US medical leads finder – GPT + Serper + Findymail + Sheets** 26 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/us-medical-leads-finder-gpt-serper-findymail-sheets)
- [**Automate gym lead nurturing with WhatsApp and Google Sheets** 26 steps · Google Sheets](https://millionrounds.com/workflow/automate-gym-lead-nurturing-with-whatsapp-and-google-sheets)
- [**Manage lead follow-ups with Google Sheets and SMTP** 26 steps · Email, Google Sheets](https://millionrounds.com/workflow/manage-lead-follow-ups-with-google-sheets-and-smtp)
- [**Qualify and score WhatsApp Pune real estate leads with Claude** 26 steps · Google Sheets](https://millionrounds.com/workflow/qualify-and-score-whatsapp-pune-real-estate-leads-with-claud)
- [**Scrape Google Maps businesses and contacts with CoreClaw** 26 steps · Google Sheets](https://millionrounds.com/workflow/scrape-google-maps-businesses-and-contacts-with-coreclaw)
