Automation library · Chat assistants

Email management system with OpenAI and Pinecone DB

Started by an arriving email, and works across Gmail, Pinecone and Telegram. It puts OpenAI and OpenRouter behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 34 steps, 2 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI, OpenRouterRetrieval

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

The flow

Starts it 1Model 17Logic 3Service 13

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

  1. 1Gmail TriggerGmail triggerStarts it
  2. 2Embeddings OpenAIEmbeddings Open AiModel
  3. 3Label as FinanceGmail ToolService
  4. 4Label as Sales OpportunitiesGmail ToolService
  5. 5Embeddings OpenAI1Embeddings Open AiModel
  6. 6GPT 4o miniLm Chat Open RouterModel
  7. 7GPT 4o mini1Lm Chat Open RouterModel
  8. 8GPT 4o mini2Lm Chat Open RouterModel
  9. 9GPT 4o mini3Lm Chat Open RouterModel
  10. 10OutputFormatOutput Parser StructuredModel
  11. 11Label as InternalGmail ToolService
  12. 12Output FormatOutput Parser StructuredModel
  13. 13Output Format1Output Parser StructuredModel
  14. 14GPT 5 miniLm Chat Open RouterModel
  15. 15Inbox RouterText ClassifierModel
  16. 16Database of FAQs and PoliciesVector Store PineconeModel
  17. 17Finance AgentAgentModel
  18. 18Leads AgentAgentModel
  19. 19Database of Business ServicesVector Store PineconeModel
  20. 20Customer Support AgentAgentModel
  21. 21Internal AgentAgentModel
  22. 22No Operation, do nothingNo OpLogic
  23. 23Route by Email TypeSwitchLogic
  24. 24Needs Review?IfLogic
  25. 25Reply EmailGmailService
  26. 26Send a summary of email and from whoTelegramService
  27. 27Send a message to Receivables TeamGmailService
  28. 28Send a message to Payments TeamGmailService
  29. 29Send a message to user to review the email directlyTelegramService
  30. 30Email DraftGmailService
  31. 31Label as Customer SupportGmailService
  32. 32Notify Amount ReceivedTelegramService
  33. 33Notify Amount to PayTelegramService
  34. 34Send a message to user to review drafted replyTelegramService

How it's built

Starts on
An arriving email
Steps
34, with 2 branches
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Pinecone, Telegram
Model
OpenAI, OpenRouter
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 Gmail, Pinecone and Telegram accounts, and a key for OpenAI and OpenRouter. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an arriving email.

Does it use AI?

Yes. It calls OpenAI and OpenRouter. 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 34 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 34 steps before you point it at anything that matters.