Get the file
Join Discord and open #freebies. The flow file and setup help are there.
This workflow reads replies to your emails, asks OpenAI what each person wants, and answers them in the same Gmail thread. If someone asks to be removed, it confirms, adds them to your email platform's suppression list and logs it. You need an IMAP login and a Gmail connection for the same mailbox, an OpenAI key, and an email platform with a suppression API.
You can read how I built the email triage flow.
The flow file and setup help are in #freebies on our Discord.

One workflow, one trigger, two paths at the end. Every step below is a real node in the file (node names in quotes).
OUR_DOMAIN, OUR_EMAILS).It sends replies straight away. There is no approval step in this file, so test it on a spare inbox first.
Wiring: "structure the email content" has to connect to "prepare ai prompt". This file already includes that wire. If it is missing after import, drag it, or nothing reaches the AI step.
The file is also published as this flow in the n8n template gallery.
your-esp-api-host.com/...) and YOUR_ESP_API_KEY. Change the URL to your provider's format.YOUR_GMAIL_LABEL_ID) and one for replied threads (YOUR_GMAIL_LABEL_ID_2).YOUR_PHONE_NUMBER (prompt and help line), OUR_DOMAIN and OUR_EMAILS in the code node, YOUR_DATA_TABLE_ID, YOUR_N8N_PROJECT_ID.$env.YOUR_ERROR_WORKFLOW_ID). Set your own error workflow or clear the setting.Four steps. The file in #freebies is rup-ai-email-triage.json.
Join Discord and open #freebies. The flow file and setup help are there.
In n8n, create a new workflow, open the three-dot menu, choose Import from File and pick the JSON from #freebies. Credentials are not in the file, so nodes that need one will show a warning until you connect it.
Add the IMAP, Gmail and OpenAI credentials, create the Data table and the two Gmail labels, then replace the ESP URL, API key and the YOUR_... placeholders. Connect "structure the email content" to "prepare ai prompt" if it is not connected.
Send a test reply to the watched mailbox from another address and run the workflow once. You should see a reply land in the thread and a new row in the Data table. Turn the workflow on when you are happy with the tone.
It reads replies to your emails, uses OpenAI to work out whether each person wants help, is not interested or wants to opt out, and answers in the same Gmail thread. Opt-outs are confirmed, sent to your email platform's suppression list and logged in an n8n Data table.
It sends them. The Gmail node replies in the thread as soon as the model answers, so test on a spare inbox and tune the prompt before pointing it at real contacts. If you want a person to check first, change the reply step to create a Gmail draft instead.
When the model marks an email as an opt-out, the flow sends a one or two line confirmation with no pitch, posts the sender's address to your ESP's suppression endpoint, logs the action and moves the thread out of the inbox under an opt-out label.
No. The IMAP trigger only picks up unread messages with reply headers (In-Reply-To or References), and a filter keeps only subjects that contain "Re: ". New cold emails and newsletters are skipped, and handled threads are labelled and archived so they are not picked up again.
You need an IMAP login and a Gmail OAuth2 connection for the same mailbox, an OpenAI API key, and an email platform with a suppression list API. The log lives in an n8n Data table, so no extra database is needed.
Yes. It uses standard n8n credentials rather than environment variables, so it runs on n8n Cloud or self-hosted n8n. You need a version with Data tables, which arrived in n8n 1.113.1.
Goat O Mate is a community of builders shipping marketing and AI automations together.
Session 1 is coming soon. Join the Discord to hear first. We set up n8n together and ship a first AI automation.
Join Discord