Automate Personalized Emails with n8n, OpenAI & Airtable (No Code!)

Harendra BarotHarendra Barot
3 min read

If you're looking for a simple way to automatically send intelligent emails using data from Airtable and the power of OpenAI, then you're in the right place. In this guide, I’ll walk you through building an n8n automation that pulls data from Airtable, generates content with OpenAI, and sends it via Gmail—all without writing a single line of code!

⚙️ Tools Required:


🧠 Use Case

Imagine you're maintaining a list of leads or users in Airtable. Every time a new record is added (e.g., a new lead), you want:

  1. OpenAI to write a personalized email.

  2. Gmail to send that email automatically.


🛠️ Step-by-Step Guide

✅ Step 1: Set Up Your Airtable

  1. Create a base (e.g., "Leads") in Airtable.

  2. Add fields like:

    • Name

    • Email

    • Company

    • Interest

You’ll use this data to craft a custom prompt for OpenAI.


⚡ Step 2: Create an n8n Workflow

  1. Open your n8n instance and click “New Workflow.”

🔔 Step 3: Add Airtable Trigger

  1. Click + → Search and add Airtable Trigger.

  2. Connect your Airtable account (use Airtable API key).

  3. Choose the base and table you created.

  4. Set trigger type to Create or Update.

📌 This step starts the flow whenever a new Airtable record is added or modified.


🤖 Step 4: Add OpenAI Node

  1. Click + → Add OpenAI node.

  2. Select “Message Model”.

  3. Add your OpenAI API key.

  4. In the Prompt, write something like:

You are responsible for customers orders. Your task is to collect incoming information about new orders and create a clear summary that will be sent via email to the team. The email should be signed with 'Customer Success Team'

Here are the details of the customers orders:


Order Number: {{ $json.fields['Order number'] }}
Customer:{{ $json.fields.Customer }}
Product:{{ $json.fields.Product }}
Quantity:{{ $json.fields.Quantity }}
Price:{{ $json.fields.Price }}
Date:{{ $json.fields.Date }}
Status:{{ $json.fields.Status }}


Please provide the following output parameters:

Email subject:
Email content:
  1. Set the model (e.g., gpt-4o).

  2. Set Max Tokens if needed.

💡 Tip: You can use Markdown or HTML in the response to format the email.


📤 Step 5: Add Gmail Node

  1. Click + → Add Gmail node.

  2. Authenticate with your Gmail account.

  3. Set:

    • To: {{$json["Email"]}}

    • Subject: “Thank You for Your Interest!”

    • Message: {{$node["OpenAI"].json["message"]}}

🎯 This sends the AI-generated email to the user's email address.


✅ Step 6: Test the Flow

  1. Save and activate the workflow.

  2. Add a new record to your Airtable.

  3. Watch the magic happen! ✨


📊 Bonus: Use Cases

  • Marketing Campaigns
    Auto-generate outreach emails based on user interests.

  • Customer Support
    Respond to tickets stored in Airtable with AI-generated answers.

  • Content Automation
    Auto-generate blog outlines or summaries via email.


🧠 Final Thoughts

This no-code automation empowers you to streamline communications, save time, and engage smarter. With just a few clicks, you're tapping into the full power of OpenAI—without needing to code.

If you found this useful, share it or drop a comment below. I’d love to hear how you're using AI + automation in your workflows!

0
Subscribe to my newsletter

Read articles from Harendra Barot directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Harendra Barot
Harendra Barot

I'm an IT professional and business analyst, sharing my day-to-day troubleshooting challenges to help others gain practical experience while exploring the latest technology trends and DevOps practices. My goal is to create a space for exchanging ideas, discussing solutions, and staying updated with evolving tech practices.