Automation library · Data collection

Adaptive email auto-responder with OpenAI and Gmail

Started by an arriving email, and works across Gmail, Google Sheets and Supabase vectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 29 steps, 4 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAIRetrieval

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

The flow

Starts it 2Model 13Logic 8Service 6

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

  1. 1Embeddings OpenAIEmbeddings Open AiModel
  2. 2OpenAI Chat ModelLm Chat Open AiModel
  3. 3OpenAI Chat Model1Lm Chat Open AiModel
  4. 4Structured Output ParserOutput Parser StructuredModel
  5. 5Google Sheets TriggerGoogle Sheets triggerStarts it
  6. 6OpenAI Chat Model2Lm Chat Open AiModel
  7. 7Embeddings OpenAI1Embeddings Open AiModel
  8. 8Recursive Character Text SplitterText Splitter Recursive Character Text SplitterModel
  9. 9Gmail Trigger1Gmail triggerStarts it
  10. 10Supabase Vector StoreVector Store SupabaseModel
  11. 11AI AgentAgentModel
  12. 12Auto-fixing Output ParserOutput Parser AutofixingModel
  13. 13If1IfLogic
  14. 14Information ExtractorInformation ExtractorModel
  15. 15Supabase Vector Store1Vector Store SupabaseModel
  16. 16Default Data LoaderDocument Default Data LoaderModel
  17. 17If2IfLogic
  18. 18IfIfLogic
  19. 19Get Dynamic Prompt1Google SheetsService
  20. 20Markdown1MarkdownLogic
  21. 21SwitchSwitchLogic
  22. 22Get Dynamic PromptGoogle SheetsService
  23. 23MarkdownMarkdownLogic
  24. 24GmailGmailService
  25. 25Gmail1GmailService
  26. 26Google Sheets1Google SheetsService
  27. 27Original ReplyMarkdownLogic
  28. 28Google SheetsGoogle SheetsService
  29. 29Edit FieldsSetLogic

How it's built

Starts on
An arriving email
Steps
29, with 4 branches
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Sheets, Supabase vectors
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 Gmail, Google Sheets and Supabase vectors 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. 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 29 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 29 steps before you point it at anything that matters.