What You'll Need
- n8n Cloud or self-hosted n8n
- Hetzner VPS or Contabo VPS for self-hosting
- Claude API key from Anthropic
- Gmail or SMTP credentials for sending
- A list of subscriber emails (spreadsheet or database)
Table of Contents
- Why Automate Your Newsletter?
- Building the Core Workflow
- Integrating Claude for Content Generation
- Setting Up Email Distribution
- Testing and Scheduling
- Getting Started
Why Automate Your Newsletter?
I've been running newsletters for three years now, and I can tell you: doing it manually kills momentum. Every week you're drafting, editing, formatting, and manually sending to your list. By week four, you've burned out. By month two, your subscribers are getting ghosted.
Automation changed everything for me. Instead of spending 4-5 hours per week on my newsletter, I now spend 30 minutes setting up a workflow that does the heavy lifting. n8n handles the scheduling, Claude generates smart content based on my topic prompts, and your email provider sends it out to thousands of people.
The workflow I'm sharing with you today can:
- Generate newsletter content automatically using Claude's API
- Pull subscriber lists from Google Sheets or a database
- Send personalized emails at scale
- Log analytics so you know what worked
- Run on a schedule you define (weekly, daily, monthly—whatever)
Let's build it.
Building the Core Workflow
Open n8n Cloud and create a new workflow. I'm calling mine "AI Newsletter Generator."
The workflow structure is simple:
- Trigger – A schedule node fires weekly
- Generate Content – Claude API creates the newsletter body
- Fetch Subscribers – Pull your email list
- Send Emails – Distribute to each subscriber
- Log Results – Track success/failures
Let's start with the schedule trigger.
Step 1: Add a Schedule Trigger
In n8n, click + and search for "Schedule Trigger." Configure it:
{
"mode": "Every Week",
"dayOfWeek": "Monday",
"time": "09:00"
}
This fires every Monday at 9 AM. Adjust to your preference.
Step 2: Claude API Node
Add a new node and search for HTTP Request (we'll use it to call Claude's API directly since n8n doesn't have a native Claude node yet).
Configure the HTTP node:
{
"method": "POST",
"url": "https://api.anthropic.com/v1/messages",
"authentication": "Generic Credential Type",
"sendHeaders": true,
"headerParameters": {
"x-api-key": "YOUR_CLAUDE_API_KEY",
"anthropic-version": "2023-06-01",
"content-type": "application/json"
},
"sendBody": true,
"bodyParameters": {
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"system": "You are a professional newsletter writer. Create engaging, concise newsletter content based on the topic provided. Format with a catchy subject line, brief intro paragraph, 3 main points with explanations, and a call-to-action.",
"messages": [
{
"role": "user",
"content": "Write a newsletter about the latest trends in workflow automation and AI integration. Keep it under 300 words."
}
]
}
}
The key fields:
-
model: Claude 3.5 Sonnet is fast and cheap for this use case -
max_tokens: 1024 gives you about 750 words -
system: This prompt tells Claude how to format the newsletter -
messages: Your actual newsletter topic
The response will look like:
{
"id": "msg_123456",
"type": "message",
"content": [
{
"type": "text",
"text": "Subject: Your Weekly Automation Digest\n\nHi there!..."
}
]
}
We'll extract the content[0].text in the next step.
💡 Fast-Track Your Project: Don't want to configure this yourself? I build custom n8n pipelines and bots. Message me with code SYS3-DEVTO.
Integrating Claude for Content Generation
Step 3: Parse Claude Response
Add a Set Node to extract and format the Claude output:
{
"data": {
"newsletterContent": "{{ $nodes['HTTP Request'].data.body.content[0].text }}",
"generatedAt": "{{ now.toIso() }}",
"status": "generated"
}
}
This pulls the text Claude generated and adds metadata.
Step 4: Split Subject and Body
Claude will return a formatted newsletter with a subject line, but we need to split them. Add another Function Node:
const content = items[0].json.data.newsletterContent;
const lines = content.split('\n');
let subject = '';
let body = '';
const subjectIndex = lines.findIndex(line => line.startsWith('Subject:'));
if (subjectIndex !== -1) {
subject = lines[subjectIndex].replace('Subject:', '').trim();
body = lines.slice(subjectIndex + 2).join('\n');
} else {
subject = 'Your Weekly Newsletter';
body = content;
}
return [{
json: {
subject: subject,
body: body,
generatedAt: new Date().toISOString()
}
}];
Now we have a clean subject and body ready to email.
Setting Up Email Distribution
Step 5: Fetch Subscriber List
This is where many people use Google Sheets as a free database. If you haven't already, check out how to use Google Sheets as a free database with n8n for more details.
Add a Google Sheets node:
{
"operation": "Get All Rows",
"spreadsheetId": "YOUR_SHEET_ID",
"sheetName": "subscribers",
"options": {
"headerRow": 1
}
}
Your sheet should have columns: email, name, status. Filter for status = active to avoid sending to unsubscribed users.
Step 6: Loop and Send Emails
Add a Loop node to iterate through each subscriber. Inside the loop, add an SMTP Email node (or Gmail, depending on your preference):
{
"method": "SMTP",
"fromEmail": "your-email@yourcompany.com",
"fromName": "Your Newsletter",
"toEmail": "{{ $item.json.email }}",
"subject": "{{ $nodes['Set'].data.subject }}",
"textMimeType": "text/html",
"htmlBody": "<html><body><h2>{{ $item.json.name }}, here's this week's update:</h2><p>{{ $nodes['Set'].data.body }}</p><p><a href='https://yourcompany.com/unsubscribe?email={{ $item.json.email }}'>Unsubscribe</a></p></body></html>",
"smtpCredentials": "YOUR_SMTP_CREDENTIAL"
}
Key points:
- Use
$item.json.emailto address each subscriber - Personalize with
$item.json.name - Include an unsubscribe link (legal requirement under CAN-SPAM)
- Use HTML for better formatting
Step 7: Error Handling
Add an Error Handler node to catch failed sends:
{
"operation": "Continue",
"onError": true,
"errorOutput": {
"email": "{{ $item.json.email }}",
"error": "{{ $error.message }}",
"timestamp": "{{ now.toIso() }}"
}
}
This logs failures without stopping the entire workflow.
Testing and Scheduling
Step 8: Test with One Subscriber
Before going live, test with yourself. Modify your Google Sheet to have just one test email. Click Execute in n8n and check your inbox.
Look for:
- ✅ Subject line is correct
- ✅ Body formatting is clean
- ✅ Links work
- ✅ No HTML escaping issues
If Claude generates weird formatting, adjust the system prompt. Example:
"system": "You are a professional newsletter writer. Output ONLY HTML. Start with <h1>Subject: [subject]</h1>. Do not include markdown or asterisks."
Step 9: Production Scheduling
Once you're confident, update the Schedule Trigger to your real frequency:
{
"mode": "Every Week",
"dayOfWeek": "Monday",
"time": "09:00",
"timezone": "America/New_York"
}
n8n will run this automatically every Monday at 9 AM.
Step 10: Add Analytics (Optional but Recommended)
Create a second Google Sheet called "newsletter_logs" and add a Google Sheets node at the end of your workflow:
{
"operation": "Append",
"spreadsheetId": "YOUR_SHEET_ID",
"sheetName": "newsletter_logs",
"data": {
"date_sent": "{{ now.toIso() }}",
"subject": "{{ $nodes['Set'].data.subject }}",
"recipients_count": "{{ $nodes['Loop'].data.length }}",
"failed_count": "{{ $nodes['Error Handler'].data.length }}",
"status": "completed"
}
}
This tracks every send so you can spot patterns (e.g., "Mondays at 9 AM get better open rates").
Getting Started
You're ready to launch. Here's your checklist:
- Get n8n: Sign up for n8n Cloud or self-host on Hetzner / Contabo
- Set up Claude API: Get your key from Anthropic (free tier gives you $5 credit)
- Prepare your subscriber list: Upload to Google Sheets with email and name columns
- Build the workflow: Follow the steps above
- Test: Send one email to yourself
- Deploy: Set the schedule and let it run
A few advanced tweaks you might consider:
- Add the best free APIs for building automation workflows to your newsletter—pull trending tech news and include it in your Claude prompt
- Use Zapier or Make.com for simple integrations, but n8n is more powerful and costs less at scale
- If you want to add audio versions, check out Edge TTS for free text-to-speech
Outsource Your Automation
Don't have time? I build production n8n workflows, WhatsApp bots, and fully automated YouTube Shorts pipelines. Hire me on Fiverr — mention SYS3-DEVTO for priority. Or DM at chasebot.online.
Originally published on Automation Insider.
Top comments (0)