Gmail + OpenAI: consistent emails without rewrites
You open an email thread, you know what you need to say, and then you burn 20 minutes trying to say it “the right way.” Worse, you send it anyway, then reread it and cringe.
This is the kind of problem that hits customer support leads first, but sales reps and busy founders feel it too. Gmail OpenAI emails automation gives you a clean, on-brand draft in a chosen tone so you stop rewriting the same message all day.
Below is the exact workflow, what it fixes, and how you can run it as a simple form your team uses whenever an email needs to sound consistent.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Gmail + OpenAI: consistent emails without rewrites
flowchart LR
subgraph sg0["Email Generator Form Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>Email Generator Form"]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Extract Form Data", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Build AI Prompt"]
n3@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
n4@{ icon: "mdi:robot", form: "rounded", label: "Generate Email", pos: "b", h: 48 }
n5@{ icon: "mdi:swap-vertical", form: "rounded", label: "Format Output", pos: "b", h: 48 }
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>Display Generated Email"]
n5 --> n6
n4 --> n5
n2 --> n4
n1 --> n2
n3 -.-> n4
n0 --> n1
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n4 ai
class n3 aiModel
class n2 code
classDef customIcon fill:none,stroke:none
class n0,n2,n6 customIcon
The Problem: Email Drafts Take Too Long to Get “Right”
Most teams don’t struggle to think of a reply. They struggle to shape it. You start with messy notes, half-sentences from a call, maybe a few bullets from a CRM, then you try to turn that into a polished email that won’t confuse the recipient or spark a second round of questions. Small differences in tone create big downstream issues. A “quick” email becomes a 30-minute rewrite, and the longer the thread gets, the more mental load it takes to keep your voice consistent across people.
It adds up fast. Here’s where it breaks down in real life.
- People spend about 15–30 minutes drafting emails that should take five.
- Teams end up sounding like five different brands because everyone writes differently.
- Important context gets lost when you copy-paste from notes and forget one detail.
- Managers are stuck editing and re-editing instead of coaching or closing deals.
The Solution: A Tone-Based AI Email Generator Your Team Uses as a Form
This n8n workflow turns a simple intake form into a reliable email drafting assistant. Someone fills in the basics (recipient details, subject, context, and the tone they want), and the workflow immediately turns that input into a structured prompt for OpenAI. From there, OpenAI generates a complete email draft in the tone you selected, with formatting that actually looks like an email, not a blob of text. Finally, the workflow presents the result back to the user so they can copy it into Gmail and send, or tweak a line or two before it goes out.
The workflow starts with a form submission. It maps and cleans the fields, builds a tone-specific prompt, then asks OpenAI to draft the email. The finished email is displayed as the final output, ready for you to use.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say your support team answers 15 customer emails a day. If each message takes about 15 minutes to draft and polish, that’s roughly 4 hours of writing daily. With this workflow, the agent spends maybe 2 minutes filling in the form and picking a tone, then waits a moment for the AI draft, and does a quick 1–2 minute review before sending. Realistically, you get about 2–3 hours back per day, and the replies stop swinging between “too stiff” and “too casual.”
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- OpenAI for generating the email draft.
- Gmail to send the final email after review.
- OpenAI API key (get it from the OpenAI API keys page).
Skill level: Beginner. You will connect an OpenAI credential, customize a few tone instructions, and test the form once.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A user submits the Email Intake Form. They add the recipient details, subject, and what they’re trying to accomplish, then choose a tone (Professional, Friendly, Formal, or Casual).
The workflow cleans and structures the input. n8n maps the fields into a predictable format so the prompt doesn’t drift depending on who typed what.
OpenAI generates the draft. A code step composes the prompt with the selected tone, then the OpenAI chat model drafts the email content in a single pass (with an agent step to keep formatting usable).
The finished email is shown as the output. The workflow prepares display data and returns the draft in a results form so it’s easy to copy into Gmail and send.
You can easily modify the tone options to match your brand voice based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Form Trigger
Set up the form that users will fill out to generate the email draft.
- Add and open Email Intake Form.
- Set Form Title to
AI Email Generator. - Set Form Description to
Generate professional emails with your chosen tone. - Create fields exactly as follows: Recipient Name (required), Email Subject (required), Email Context (textarea, required), and Tone (dropdown with options
Professional,Friendly,Formal,Casual).
Step 2: Map Form Inputs into Structured Fields
Normalize the form response into consistent keys for the prompt builder.
- Add Map Form Fields after Email Intake Form.
- Create a string field recipient with value
={{ $json['Recipient Name'] }}. - Create a string field subject with value
={{ $json['Email Subject'] }}. - Create a string field context with value
={{ $json['Email Context'] }}. - Create a string field tone with value
={{ $json['Tone'] }}.
Step 3: Set Up the AI Prompt and Model
Build a detailed prompt and connect the OpenAI model used to generate the email.
- Add Compose AI Prompt after Map Form Fields and paste the provided JavaScript into Code to generate the
promptstring. - Add Draft Email Content after Compose AI Prompt.
- In Draft Email Content, set Text to
={{ $json.prompt }}and Prompt Type todefine. - Add OpenAI Chat Engine and set Model to
gpt-3.5-turbo, with Max Tokens500and Temperature0.7. - Connect OpenAI Chat Engine to Draft Email Content via the AI language model connection.
- Credential Required: Connect your
openAiApicredentials in OpenAI Chat Engine. The AI credentials should be added to OpenAI Chat Engine, not Draft Email Content.
Step 4: Configure the Output Display
Format the AI output and display it back to the user.
- Add Prepare Display Data after Draft Email Content.
- Map email_body to
={{ $json.output }}. - Map subject to
={{ $('Map Form Fields').item.json.subject }}, tone to={{ $('Map Form Fields').item.json.tone }}, and recipient to={{ $('Map Form Fields').item.json.recipient }}. - Add Show Email Result after Prepare Display Data and set Operation to
completion. - Set Completion Title to
✅ Email Generated Successfully!. - Set Completion Message to
=**Subject:** {{ $json.subject }} **Tone:** {{ $json.tone }} **Recipient:** {{ $json.recipient }} --- {{ $json.email_body }} --- *Copy the email above and add your signature before sending.*.
= so expressions render properly.Step 5: Test and Activate Your Workflow
Validate end-to-end execution and make the workflow live.
- Click Execute Workflow and open the Email Intake Form test URL.
- Submit a sample request and confirm that Draft Email Content returns a full email in Prepare Display Data.
- Verify the final formatted result appears in Show Email Result with the correct subject, tone, recipient, and body.
- Once confirmed, toggle the workflow to Active to enable production use.
Common Gotchas
- OpenAI credentials can expire or get rotated. If things break, check the OpenAI API keys page and your n8n credential settings first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 30 minutes if your OpenAI key is ready.
No. You’ll mostly connect your OpenAI credential and edit the tone text if you want it to sound more like your brand.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs, which are usually a few cents per email depending on model and length.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. Update the tone instructions in the “Compose AI Prompt” code step to include a few hard rules (greeting style, signature format, taboo phrases), then add or rename tones in the form so your team picks from your real options. Common tweaks include adding a “Support (empathetic)” tone, enforcing shorter paragraphs, and injecting product terminology so the AI stops guessing.
Usually it’s an expired or wrong API key.
It depends more on your n8n plan and OpenAI rate limits than the workflow itself. On n8n Cloud Starter you get a monthly execution cap, and each email draft counts as an execution. If you self-host, there’s no execution limit, but your server still has to keep up. In practice, most small teams can run hundreds or thousands of drafts a month without thinking about it, as long as you’re not blasting requests in parallel.
For tone-controlled drafting, n8n is usually the more flexible option because you can shape prompts, add logic, and self-host without paying per tiny step. Zapier and Make are fine for very simple “send this when that happens” flows, but they get pricey when you start adding branching, formatting, and retries. Also, the AI and code steps are easier to reason about in n8n once you’ve seen them laid out. If you’re choosing between tools and you want a second opinion, Talk to an automation expert.
You set the tone once, then your team stops second-guessing every sentence. The workflow handles the repetitive polishing so you can hit send with confidence.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.