Keeping up with daily AI updates can be a challenge → new models, tools, and breakthroughs appear almost every day. To simplify this process, we built an AI-powered “Newsletter Agent” using n8n, an open-source workflow automation platform.
This agent automatically finds trending AI topics, writes educational newsletters using Google Gemini AI, formats the content, and sends it to subscribers → all without manual work.
🌐 The Concept
The idea was to automate daily newsletter creation and delivery → so the system itself handles:
◆ Finding a trending AI topic
◆ Writing the newsletter
◆ Formatting and cleaning the text
◆ Fetching email contacts
◆ Sending the email automatically The result? A fully autonomous digital writer and publisher, powered by n8n + Gemini AI.
⚙️ Workflow Overview
The entire automation was created inside n8n’s visual editor. Here’s how it works step-by-step:
1. Schedule Trigger → Runs the workflow daily or weekly.
2. AI Topic Selector → Uses Gemini to find a trending AI topic from the last 24–48 hours.
3. AI Newsletter Writer → Generates a complete, structured newsletter.
4. Extract & Format Content → Cleans and converts raw AI output into HTML.
5. Google Sheets → Fetches subscriber email addresses dynamically.
6. Aggregate Node → Combines all emails into a single list.
7. Send AI Newsletter (Gmail) → Sends a well-designed HTML email automatically.
🧠 AI Topic Selector
This step is powered by Google Gemini. It searches recent AI trends and picks one relevant topic → like “Prompt Engineering Techniques” or “AI Workflow Automation.”
A short, structured prompt instructs Gemini to act as a curator, selecting only the most valuable and recent topics.
This ensures every newsletter stays fresh, relevant, and industry-aligned.
✍️ AI Newsletter Writer
Once the topic is selected, another Gemini node writes the newsletter content automatically. It includes:
● Topic introduction
● Why it matters
● Key concepts
● Real-world use cases
● Pro tips and takeaways
The AI follows predefined HTML formatting for Cambria font, highlighted sections, and clean headings → ready for email delivery.
💻 Content Formatting & Cleanup
The AI’s raw output often contains structured data or unwanted escape characters. A Code node (JavaScript) was added to:
➥ Extract clean HTML
➥ Remove metadata or formatting errors
➥ Trim unnecessary text
This ensures that the final newsletter looks professional when rendered inside an email.
📋 Fetching Subscribers via Google Sheets
Instead of static emails, the agent pulls recipient data directly from a connected Google Sheet. Anyone can add or update email addresses without opening n8n.
This simple integration makes the workflow scalable and easy to maintain → perfect for teams or communities.
📦 Data Aggregation
Before sending, the Aggregate node compiles all emails into a single clean string.
This avoids duplication and ensures a smooth send process.
It’s a small but essential step that keeps data management organized inside n8n.
📨 Sending the Newsletter
The final email is sent automatically using Gmail integration inside n8n. The email design includes:
● Gradient header (AI Deep Dive)
● Topic badge
● White content section with readable text
● Footer with tagline
It’s a simple, elegant layout optimized for readability and consistency.
🚀 Why This Workflow Matters
The “Newsletter Agent” combines the creative power of AI with the automation strength of n8n, offering:
◆ Zero manual effort → everything runs on schedule.
◆ Dynamic content → real-time AI-generated insights.
◆ Smart email management → integrates seamlessly with Google Sheets.
◆ Scalable setup → ideal for teams or tech newsletters.
This setup shows how AI and workflow automation can handle content creation reliably at scale.
🎓 Best Practices
💡 Use structured prompts for predictable AI outputs.
💡 Keep formatting consistent using HTML and CSS inside n8n.
💡 Regularly test AI responses for accuracy and tone.
💡 Maintain your subscriber list directly from Google Sheets.
💡 Review the first few outputs manually before full automation.
⚠️ Common Mistakes
❌ Using unstructured prompts can lead to messy or irrelevant newsletters.
❌ Ignoring HTML cleanup may cause broken email layouts.
❌ Forgetting to update the email list can reduce deliverability.
🔮 What’s Next
The next evolution of this workflow could include:
◆ Auto-posting newsletters on LinkedIn or Medium using n8n integrations.
◆ Summarizing newsletters into social media snippets.
◆ Adding analytics to track open rates and engagement.
Automation like this paves the way for intelligent, continuous content delivery → letting teams focus on creativity, not logistics.
🎯 Key Takeaways
✅ AI + n8n = Content Automation
✅ Gemini generates meaningful newsletters daily.
✅ Google Sheets keeps subscriber management simple
✅ Gmail ensures smooth, branded delivery