Automation library · Customer support

Answer multi-channel support queries with OpenAI RAG

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

LargeCalls a model: OpenAIRetrieval

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

The flow

Starts it 8Model 13Logic 29Service 10

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

  1. 1Email Trigger (IMAP)Email Read ImapService
  2. 2Webhook Trigger (Live Chat)WebhookStarts it
  3. 3WhatsApp TriggerWhats App triggerStarts it
  4. 4Slack Trigger (Mentions)Slack triggerStarts it
  5. 5Discord Webhook TriggerWebhookStarts it
  6. 6OpenAI Chat Model (RAG)Lm Chat Open AiModel
  7. 7OpenAI Chat Model (Sentiment)Lm Chat Open AiModel
  8. 8OpenAI Chat Model (Escalation)Lm Chat Open AiModel
  9. 9Weekly Maintenance ScheduleSchedule triggerStarts it
  10. 10OpenAI Embeddings (Retrieve)Embeddings Open AiModel
  11. 11Chat MemoryMemory Postgres ChatModel
  12. 12Error TriggerError triggerStarts it
  13. 13Ingest Knowledge Base (Manual)Manual triggerStarts it
  14. 14Docs Text SplitterText Splitter Recursive Character Text SplitterModel
  15. 15OpenAI Embeddings (Docs)Embeddings Open AiModel
  16. 16Workflow ConfigurationSetLogic
  17. 17RAG Support AgentAgentModel
  18. 18Sentiment AnalysisChain LlmModel
  19. 19Escalation ReasoningChain LlmModel
  20. 20Weekly ConfigurationSetLogic
  21. 21Knowledge Base SearchVector Store SupabaseModel
  22. 22Alert Workflow FailureSlackService
  23. 23Ingestion ConfigurationSetLogic
  24. 24Docs LoaderDocument Default Data LoaderModel
  25. 25Supabase Docs InsertVector Store SupabaseModel
  26. 26Normalize PayloadCodeLogic
  27. 27Restore Context (Answer)CodeLogic
  28. 28Restore Context (Sentiment)CodeLogic
  29. 29Restore Context (Escalation)CodeLogic
  30. 30Fetch Weekly MetricsGoogle SheetsService
  31. 31Load Source DocumentsCodeLogic
  32. 32Automated Email?IfLogic
  33. 33Confidence ScoringCodeLogic
  34. 34Prepare Ticket ObjectSetLogic
  35. 35Aggregate Weekly MetricsCodeLogic
  36. 36Purge Existing DocsSupabaseService
  37. 37Ignored (Automated Email)No OpLogic
  38. 38Has Valid Message?IfLogic
  39. 39Check Confidence ThresholdIfLogic
  40. 40Create Zendesk TicketZendeskService
  41. 41Send Weekly SummarySlackService
  42. 42Purge Old Chat MemoryPostgresService
  43. 43Archive Weekly MetricsPostgresService
  44. 44Reload Documents After PurgeCodeLogic
  45. 45Remove Duplicate MessagesRemove DuplicatesLogic
  46. 46Ignored (Empty Message)No OpLogic
  47. 47Check SentimentIfLogic
  48. 48Escalation ReasonCodeLogic
  49. 49Escalation Alert to Support TeamSlackService
  50. 50New Message?IfLogic
  51. 51Is Live Chat? (Empty)IfLogic
  52. 52Channel RouterSwitchLogic
  53. 53Log Escalation to SheetsGoogle SheetsService
  54. 54Message Within Limit?IfLogic
  55. 55Is Live Chat? (Duplicate)IfLogic
  56. 56Respond to Live Chat (Ignored)Respond To WebhookStarts it
  57. 57Format Email ResponseSetLogic
  58. 58Format Webhook ResponseSetLogic
  59. 59Format WhatsApp ResponseSetLogic
  60. 60Format Discord ResponseSetLogic

How it's built

Starts on
An incoming WhatsApp message
Steps
77, with 12 branches
Size
Large: read it before trusting it with anything live
Connects to
Discord, Email, Google Sheets, Postgres, Slack, Supabase, Supabase vectors, WhatsApp, Zendesk
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 Discord, Email, Google Sheets, Postgres, Slack, Supabase, Supabase vectors, WhatsApp and Zendesk 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 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.