Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Email Automation

Email Automation

Draft and approve Gmail replies and follow-ups with OpenAI

When a new email arrives, it handles email with OpenAI / ChatGPT using Data Table, Gmail.

What it does

## Answer Gmail leads with OpenAI drafts you approve and follow up with quiet ones ### Who's it for Small businesses and agencies that get leads by email and want help on both ends: answering the ones who write, and following up with the ones who went quiet, with a person approving every word that leaves. ### How it works One leads table and two triggers. When a new email arrives 1. The Gmail trigger picks up new unread emails (no promotions, social, updates, forums or no-reply senders). 2. Every email is matched to your leads table by the sender's address. A lead who writes is marked replied, so the weekly follow-up never chases someone who already answered. 3. OpenAI classifies the email and drafts a reply from your business facts and, for a lead, what you noted about them. 4. A Code node checks the draft. Money, complaints, an empty or long draft, a broken answer or an amount that is not in your facts go to the owner to answer. 5. Otherwise the owner gets an approval email. Send this reply sends it in the same thread and logs the contact on the lead; Do not send, or no answer in 2 days, sends nothing. Every Monday 1. The quiet leads are picked from the table: last contact older than the quiet period, never replied, never unsubscribed, never followed up. 2. One Gmail search catches anyone who wrote back since; they are marked replied and skipped. 3. OpenAI writes a short personal follow-up from each lead's notes. Code checks it (length, links, numbers, placeholders, promises, first name) and falls back to your fixed text. 4. Each follow-up is saved as a Gmail draft, the lead is marked as followed up, and the owner gets one summary. Nothing is sent on its own. ### How to set up 1. Create a data table with the columns email, name, notes (text), last_contact_at, followed_up_at (date) and replied, unsubscribed (boolean). Select it in the five Data table nodes. 2. Connect Gmail in the trigger and the Gmail nodes, and OpenAI in both model nodes. 3. Fill in Your settings: owner email, your name and business, business facts, tone, word limits, quiet days, weekly cap, follow-up subject and your offer in one sentence. 4. Send yourself a test email from an address in the table, run the Monday trigger once by hand with a test lead, then activate. ### Requirements - n8n with Data tables - A Gmail account - An OpenAI API key ### How to customize the workflow - Handle on

The steps

  1. A new email arrives
  2. Every Monday at 10:00
  3. Your settings
  4. New email or weekly run?
  5. Get all leads
  6. Match each email to a lead
  7. Sender is a lead?
  8. Mark the lead as replied
  9. Classify and draft a reply
  10. OpenAI model (replies)
  11. Check the reply
  12. Safe to suggest?
  13. Ask the owner to approve
  14. Approved?

31 steps in total.

Similar automations