Automation library · AI assistants

How to transform unstructured email data into structured format

Started by someone opening a chat with it, and works across Email, Gmail and n8n data table. It hands the judgement calls to Gemini and OpenAI. 12 steps: a working afternoon to understand properly.

MediumCalls a model: Gemini, OpenAI

12 stepsMedium: a working afternoon
0Branches: places the flow splits
0Loops or waits
3Services it connects to

The flow

Starts it 3Model 6Service 3

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

  1. 1Gmail TriggerGmail triggerStarts it
  2. 2OpenAI Chat ModelLm Chat Open AiModel
  3. 3OpenAI Chat Model1Lm Chat Open AiModel
  4. 4Email Trigger (IMAP)Email Read ImapService
  5. 5Microsoft Outlook TriggerMicrosoft Outlook triggerStarts it
  6. 6When chat message receivedChat triggerStarts it
  7. 7EmailsData Table ToolService
  8. 8Google Gemini Chat ModelLm Chat Google GeminiModel
  9. 9Parsing AgentAgentModel
  10. 10Structured Output ParserOutput Parser StructuredModel
  11. 11Email AgentAgentModel
  12. 12Insert rowData TableService

How it's built

Starts on
Someone opening a chat with it
Steps
12
Size
Medium: a working afternoon
Connects to
Email, Gmail, n8n data table
Model
Gemini, OpenAI

Questions

What does it need to run?

An n8n account, plus your own Email and Gmail accounts, and a key for Gemini and OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls Gemini and OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 12 steps is enough that you should read each one before running it.

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