Automation library · CRM

Handle WhatsApp sales queries with OpenAI and Supabase

Started by an incoming WhatsApp message, and works across Supabase vectors and WhatsApp. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 26 steps, 2 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
2Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 2Model 11Logic 5Service 8

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

  1. 1Embeddings OpenAI1Embeddings Open AiModel
  2. 2Recursive Character Text SplitterText Splitter Recursive Character Text SplitterModel
  3. 3WhatsApp TriggerWhats App triggerStarts it
  4. 4Web SearchTool Serp ApiModel
  5. 5search_products_inventoryData Table ToolService
  6. 6On form submission1Form triggerStarts it
  7. 7the brainLm Chat Open AiModel
  8. 8System MemoryMemory Buffer WindowModel
  9. 9KnowledgebaseVector Store SupabaseModel
  10. 10Supabase Vector StoreVector Store SupabaseModel
  11. 11Default Data LoaderDocument Default Data LoaderModel
  12. 12Route TypesSwitchLogic
  13. 13Sales AI agentAgentModel
  14. 14Map text promptSetLogic
  15. 15Gets WhatsApp Voicemail Source URLWhats AppService
  16. 16Gets WhatsApp Image Source URLWhats AppService
  17. 17Send message1Whats AppService
  18. 18Response_validationCodeLogic
  19. 19Download VoicemailHttp RequestService
  20. 20Download ImageHttp RequestService
  21. 21IfIfLogic
  22. 22OpenAIOpen AiModel
  23. 23OpenAI1Open AiModel
  24. 24Send text messageWhats AppService
  25. 25Send media&caption messageWhats AppService
  26. 26Map image promptSetLogic

How it's built

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