Automation library · Chat assistants

Classify and auto-reply to Gmail with OpenAI

Started by an arriving email, and works across Gmail, Google Sheets and Telegram. It hands the judgement calls to OpenAI. 34 steps, 1 branch, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

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

The flow

Starts it 2Model 5Logic 2Service 25

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

  1. 1Gmail Trigger1Gmail triggerStarts it
  2. 2When clicking ‘Execute workflow’Manual triggerStarts it
  3. 3Read_all_EmailsGmailService
  4. 4FTAI InfoGoogle Sheets ToolService
  5. 5Email Classifier AgentOpen AiModel
  6. 6Get row(s) in sheetGoogle SheetsService
  7. 7Loop Over ItemsSplit In BatchesLogic
  8. 8Creating Email1Open AiModel
  9. 9SwitchSwitchLogic
  10. 10Send Demo EmailsGmailService
  11. 11Clean InboxTelegramService
  12. 12Delete a messageGmailService
  13. 13Auto Reply1GmailService
  14. 14High Priority1GmailService
  15. 15Customer Support1GmailService
  16. 16Promotion1GmailService
  17. 17Finance/Billing1GmailService
  18. 18Mark as Read1GmailService
  19. 19Creating Draft1Open AiModel
  20. 20PromotionsOpen AiModel
  21. 21Finance / Billing DeptOpen AiModel
  22. 22Remove From Inbox1GmailService
  23. 23Draft1GmailService
  24. 24Mark as Read2GmailService
  25. 25Send to Finance Dept1GmailService
  26. 26Notify (2)1TelegramService
  27. 27Mark as ReadGmailService
  28. 28Remove From Inbox2GmailService
  29. 29Mark as Read3GmailService
  30. 30Remove From InboxGmailService
  31. 31Notify (3)1TelegramService
  32. 32Remove From Inbox3GmailService
  33. 33Notify (1)1TelegramService
  34. 34Notify (4)1TelegramService

How it's built

Starts on
An arriving email
Steps
34, with 1 branch, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Sheets, Telegram
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Sheets and Telegram accounts, and a key for OpenAI. 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. 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.