Automation library · CRM

Reply to social media and email sales inquiries with OpenAI

Started by another system calling it, and works across Email, Google Sheets and Pinecone. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 30 steps, 1 branch: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAIRetrieval

30 stepsLarge: read it before trusting it with anything live
1Branch: places the flow splits
0Loops or waits
3Services it connects to

The flow

Starts it 6Model 7Logic 9Service 8

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

  1. 1Sync Knowledge Base (Manual)Manual triggerStarts it
  2. 2OpenAI Embeddings (Ingest)Embeddings Open AiModel
  3. 3Meta Webhook (IG + FB)WebhookStarts it
  4. 4TikTok WebhookWebhookStarts it
  5. 5Email Trigger (IMAP)Email Read ImapService
  6. 6OpenAI Embeddings (Query)Embeddings Open AiModel
  7. 7OpenAI Chat ModelLm Chat Open AiModel
  8. 8Structured Output ParserOutput Parser StructuredModel
  9. 9Error TriggerError triggerStarts it
  10. 10Fetch Offerings Data SourceGoogle SheetsService
  11. 11Upsert Offerings to PineconeVector Store PineconeModel
  12. 12Ack Meta (200 OK)Respond To WebhookStarts it
  13. 13Normalize Meta EventCodeLogic
  14. 14Ack TikTok (200 OK)Respond To WebhookStarts it
  15. 15Normalize TikTok EventCodeLogic
  16. 16Normalize Email EventCodeLogic
  17. 17Retrieve Relevant OfferingsVector Store PineconeModel
  18. 18RAG Sales Reply AgentAgentModel
  19. 19Format Error DetailsCodeLogic
  20. 20Build KB ChunksCodeLogic
  21. 21Merge InteractionsMergeLogic
  22. 22Assemble ContextCodeLogic
  23. 23Format Final ReplyCodeLogic
  24. 24Send Error AlertEmail SendService
  25. 25Route by PlatformSwitchLogic
  26. 26Reply on InstagramHttp RequestService
  27. 27Reply on FacebookHttp RequestService
  28. 28Reply on TikTokHttp RequestService
  29. 29Reply via EmailEmail SendService
  30. 30Log InteractionGoogle SheetsService

How it's built

Starts on
Another system calling it
Steps
30, with 1 branch
Size
Large: read it before trusting it with anything live
Connects to
Email, Google Sheets, Pinecone
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 Email, Google Sheets and Pinecone accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

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 30 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 30 steps before you point it at anything that matters.