Automation library · Chat assistants

Build RAG-powered WhatsApp chatbots for docs with OpenAI

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

LargeCalls a model: OpenAIRetrieval

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

The flow

Starts it 2Model 11Logic 7Service 12

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

  1. 1OpenAI Chat ModelLm Chat Open AiModel
  2. 2Embeddings OpenAIEmbeddings Open AiModel
  3. 3When clicking "Execute Workflow"Manual triggerStarts it
  4. 4Simple MemoryMemory Buffer WindowModel
  5. 5Document ChunkerText Splitter Recursive Character Text SplitterModel
  6. 6OpenAI Embeddings GeneratorEmbeddings Open AiModel
  7. 7WhatsApp TriggerWhats App triggerStarts it
  8. 8Knowledge Base AgentAgentModel
  9. 9MongoDB Vector SearchVector Store Mongo DBAtlasModel
  10. 10Google Docs ImporterGoogle DocsService
  11. 11Document Section LoaderDocument Default Data LoaderModel
  12. 12MongoDB Vector Store InserterVector Store Mongo DBAtlasModel
  13. 13Route TypesSwitchLogic
  14. 14Send ResponseWhats AppService
  15. 15Map text promptSetLogic
  16. 16Gets WhatsApp Voicemail Source URLWhats AppService
  17. 17Gets WhatsApp Image Source URLWhats AppService
  18. 18Gets WhatsApp Document Source URLWhats AppService
  19. 19Download VoicemailHttp RequestService
  20. 20Download ImageHttp RequestService
  21. 21Download DocumentHttp RequestService
  22. 22OpenAIOpen AiModel
  23. 23OpenAI1Open AiModel
  24. 24Map file extensionsCodeLogic
  25. 25Map image promptSetLogic
  26. 26Route Document TypesSwitchLogic
  27. 27Map document promptSetLogic
  28. 28Extract from PDFExtract From FileService
  29. 29Map JSONSetLogic
  30. 30Extract from XLSExtract From FileService
  31. 31Extract from XLSXExtract From FileService
  32. 32Send Unsupported ResponseWhats AppService

How it's built

Starts on
An incoming WhatsApp message
Steps
32, with 2 branches
Size
Large: read it before trusting it with anything live
Connects to
Google Docs, 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 Docs 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 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.