# Automated multi-platform sales agent with RAG and CRM: n8n workflow

> Started by an incoming WhatsApp message, and works across Google Calendar, Postgres and WhatsApp.

Source: https://millionrounds.com/workflow/automated-multi-platform-sales-agent-with-rag-and-crm (Millionrounds; every figure on the page links to its filing or article)

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

# Automated multi-platform sales agent with RAG and CRM

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

Large Calls a model: Gemini, OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fautomated-multi-platform-sales-agent-with-rag-and-crm)

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

**4** Branches: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 10 Model 20 Logic 8 Service 22

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

- 1 **Calendar Agent** Tool Workflow *Model*
- 2 **CRM Agent** Tool Workflow *Model*
- 3 **Postgres Chat Memory** Memory Postgres Chat *Model*
- 4 **WhatsApp** Whats App trigger *Starts it*
- 5 **When chat message received** Chat trigger *Starts it*
- 6 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 7 **Google Gemini Chat Model1** Lm Chat Google Gemini *Model*
- 8 **Embeddings Google Gemini1** Embeddings Google Gemini *Model*
- 9 **Simple Memory** Memory Buffer Window *Model*
- 10 **Create Charge** Stripe Tool *Service*
- 11 **Create Discount Coupon** Stripe Tool *Service*
- 12 **Get Customer Card** Stripe Tool *Service*
- 13 **Get Customer** Stripe Tool *Service*
- 14 **Create Customer** Stripe Tool *Service*
- 15 **Update Customer** Stripe Tool *Service*
- 16 **Delete Customer** Stripe Tool *Service*
- 17 **Google Gemini Chat Model4** Lm Chat Google Gemini *Model*
- 18 **Billing Agent** Tool Workflow *Model*
- 19 **Facebook Trigger** Webhook *Starts it*
- 20 **Instagram Trigger** Webhook *Starts it*
- 21 **Gemini** Lm Chat Google Gemini *Model*
- 22 **Contact Form** Form trigger *Starts it*
- 23 **When Executed by Another Workflow** Execute Workflow trigger *Starts it*
- 24 **Window Buffer Memory** Memory Buffer Window *Model*
- 25 **Create Event with Attendee** Google Calendar Tool *Service*
- 26 **Create Event** Google Calendar Tool *Service*
- 27 **Get Events** Google Calendar Tool *Service*
- 28 **Delete Event** Google Calendar Tool *Service*
- 29 **Update Event** Google Calendar Tool *Service*
- 30 **Google Gemini Chat Model2** Lm Chat Google Gemini *Model*
- 31 **Create Opportunity** Postgres Tool *Service*
- 32 **List Records** Postgres Tool *Service*
- 33 **Update Contact** Postgres Tool *Service*
- 34 **Delete Contact** Postgres Tool *Service*
- 35 **Delete Opportunity** Postgres Tool *Service*
- 36 **Update Opportunity** Postgres Tool *Service*
- 37 **Google Gemini Chat Model3** Lm Chat Google Gemini *Model*
- 38 **Create Contact** Postgres Tool *Service*
- 39 **AI Agent** Agent *Model*
- 40 **Get Lead** Postgres *Service*
- 41 **Edit Fields - chat** Set *Logic*
- 42 **technical_and_sales_knowledge** Tool Vector Store *Model*
- 43 **Postgres PGVector Store** Vector Store PGVector *Model*
- 44 **Billing Agent1** Agent *Model*
- 45 **Respond to Webhook - facebook post** Respond To Webhook *Starts it*
- 46 **Respond to Webhook - facebook get** Respond To Webhook *Starts it*
- 47 **Respond to Webhook - instagram post** Respond To Webhook *Starts it*
- 48 **Respond to Webhook - instagram get** Respond To Webhook *Starts it*
- 49 **Personalised First Message** Agent *Model*
- 50 **Create Contact1** Postgres *Service*
- 51 **CRM Agent2** Agent *Model*
- 52 **Calendar Agent1** Agent *Model*
- 53 **Switch1** Switch *Logic*
- 54 **Handle Message Types** Switch *Logic*
- 55 **No Operation, do nothing** No Op *Logic*
- 56 **Response1** Set *Logic*
- 57 **Try Again2** Set *Logic*
- 58 **If is not echo - facebook** If *Logic*
- 59 **If is not echo - instagram** If *Logic*
- 60 **Send First Message** Whats App *Service*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 77, with 4 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Calendar, Postgres, WhatsApp
- **Model:** Gemini, 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 Calendar, Postgres and WhatsApp accounts, and a key for Gemini and 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 Gemini 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 77 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 77 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%2Fautomated-multi-platform-sales-agent-with-rag-and-crm)
- **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 Calendar](https://millionrounds.com/workflows?service=Google+Calendar#library)[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[WhatsApp](https://millionrounds.com/workflows?service=WhatsApp#library)

## Workflows like it

Also money admin, with the same services where possible, closest in size first.

- [**WhatsApp expense tracker with OpenAI and Postgres** 52 steps · calls a model · Postgres, WhatsApp](https://millionrounds.com/workflow/whatsapp-expense-tracker-with-openai-and-postgres)
- [**WhatsApp productivity assistant with OpenAI and Gmail** 47 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/whatsapp-productivity-assistant-with-openai-and-gmail)
- [**WhatsApp expense tracker with OpenRouter and Postgres** 45 steps · calls a model · Postgres, WhatsApp](https://millionrounds.com/workflow/whatsapp-expense-tracker-with-openrouter-and-postgres)
- [**Track and classify expenses with Mindee OCR and OpenAI** 32 steps · calls a model · Google Drive, Postgres](https://millionrounds.com/workflow/track-and-classify-expenses-with-mindee-ocr-and-openai)
- [**Credit card payment reminder & tracking-for Taiwan banks** 31 steps · Gmail, Google Calendar](https://millionrounds.com/workflow/credit-card-payment-reminder-and-tracking-for-taiwan-banks)
- [**Score leads and send WhatsApp proposals with Gemini** 28 steps · calls a model · Apify, GoHighLevel](https://millionrounds.com/workflow/score-leads-and-send-whatsapp-proposals-with-gemini-2)
