1. Opening Problem Statement
Meet Nathan, a busy sales manager at Davey Enterprises. Nathan spends countless hours manually sending personalized emails to leads, tracking who he contacted, and trying to remember when to follow up — often resulting in missed opportunities and overwhelmed inboxes. With hundreds of contacts stored in a Google Sheet, Nathan risks sending repetitive, generic emails or forgetting to follow up. The process wastes several hours weekly, introduces human error, and weakens client engagement.
Imagine how much time Nathan loses switching back and forth between Gmail and his spreadsheet, crafting emails one by one. Mistakes like sending follow-ups too early or late damage his professional image and sales pipeline momentum. This is exactly the problem the n8n workflow presented here solves head-on.
2. What This Automation Does ⚙️
This workflow automates Nathan’s entire email outreach sequence, dynamically sending personalized first emails and timed follow-ups based on previous responses tracked directly in Google Sheets and Gmail. Here’s what it does specifically:
- Sends initial personalized emails to leads listed in Google Sheets, pulling in contact details like {name} and {company} dynamically.
- Monitors Gmail threads by subject and timing, checking if follow-up emails are needed based on previous emails sent.
- Automatically composes follow-up emails tailored with placeholders replaced by lead-specific data and sends them if the recipient hasn’t replied.
- Updates the “first_emailed” date in Google Sheets once the initial email is sent, maintaining accurate outreach logs.
- Prevents emails from going out on weekends, respecting recipients’ time and avoiding spammy behavior.
- Manages multiple email sequences with customizable messages and timing intervals, increasing outreach effectiveness.
Overall, this eliminates hours each week from manual email campaigns, reduces chances of errors in follow-ups, and ensures professional, consistent contact with leads.
3. Prerequisites ⚙️
- 📧 Gmail account with OAuth2 credentials setup in n8n.
- 📊 Google Sheets account containing your contacts and tracking columns, accessible via OAuth2 in n8n.
- ⚙️ Active n8n instance where you can import and activate this workflow, with access to OAuth2 credentials mentioned above.
Optional: For higher control and speed, self-hosting n8n is recommended. You can consider Hostinger as a reliable option for hosting your automation instance.
4. Step-by-Step Guide to Set Up Nathan’s Automated Email Campaign
Step 1: Create and Prepare Your Google Sheet
Click here to clone the example Google Sheet used in this workflow. This sheet must have columns titled:
– email (contact email addresses)
– first_emailed (left blank; this is auto-updated)
– Other columns matching placeholders like name, company, etc., for personalized email templates.
Open the sheet and review the headers to ensure they exactly match the placeholders you want to use.
Step 2: Configure the ‘Settings’ Node
Go to the Settings node in the workflow. Click it, then enter:
– Your Google Sheet URL in the sheet_url field.
– Desired email subject.
– The sender_name to display.
– The column name that contains emails (likely “email”).
– A unique mail_id to identify your email campaigns.
You should see your entered values clearly in the node’s parameter panel. This ensures all subsequent nodes refer correctly to your Google Sheet and email info.
Step 3: Adjust the Email Sequence Node
Click on the Email sequence node. This contains the email templates and the timing rules for follow-ups.
Inside, you’ll find JSON defining multiple emails with placeholders like {name} and {company}, and a send_on_day that sets how many days after the previous email the next should send.
For example, day 0 sends the first email, day 3 the first follow-up, day 8 a final follow-up.
Edit or add more sequences as needed. Remember to keep placeholders consistent with your Google Sheet columns.
Step 4: Connect Your Google Sheets OAuth2 Credentials
Find Get emails and Update last contacted time nodes. Both use Google Sheets via OAuth2.
Go to their credentials section and set your Google Sheets OAuth2 credentials (e.g., “Google Sheets account (David)”).
This authorizes read and update access to your sheet.
Step 5: Connect Your Gmail OAuth2 Credentials
Locate the nodes Get previous message threads, Get thread details, Reply to message, and Send new message.
Set Gmail OAuth2 credentials in each node.
This permits sending and reading Gmail threads necessary for follow-up logic.
Step 6: Set a Schedule Trigger for Hourly Checks
Find the Every hour node with a clock icon. This triggers the workflow hourly at the 12th minute.
You can adjust it to fit your campaign frequency but hourly is practical for prompt follow-ups.
Step 7: Customize Email Personalization in ‘Fill message placeholders’ Code Node
This Code node uses JavaScript to replace placeholders like {name} in your email messages with actual data from your Google Sheet.
Open this node and review the script. You can add console logs or modify the regex to support more placeholder formats if needed.
Step 8: Activate the Workflow
After verifying all configurations and credentials, click Activate at the top right of the n8n UI.
The automation will start sending emails and follow-ups based on your schedule conditions and sheet data.
5. Customizations ✏️
- Change email content: Edit the messages in the ‘Email sequence’ node’s JSON. Use HTML line breaks (
) for formatting. - Add more placeholders: Add columns to your Google Sheet matching placeholders and update ‘Package placeholder values’ code node to include them.
- Google Sheet URL: Update the sheet_url inside ‘Settings’ to point to a different contacts file.
- Timing of follow-ups: Modify send_on_day values in ‘Email sequence’ node to speed up or slow down follow-ups.
- Exclude weekends: The ‘Don’t email on weekends’ filter ensures no emails are sent Saturday or Sunday, but you could adjust or remove this filter by disabling the node.
6. Troubleshooting 🔧
Problem: “Missing data for placeholder ‘{name}'” error
Cause: Your Google Sheet is missing a column that matches a placeholder in your email templates.
Solution: Open your Google Sheet, add the required column (e.g., “name”), and re-run the workflow.
Problem: No emails sent at all
Cause: Credentials not set correctly or filters blocking execution.
Solution: Check your Google Sheets and Gmail OAuth2 credentials in the credential settings of the relevant nodes. Also, verify the “Don’t email on weekends” filter is passing correctly based on current day and time.
Problem: Replies not triggering follow-ups
Cause: Email threads aren’t being properly classified for reply detection.
Solution: Check the “Classify threads” code node for errors in the script. Ensure your “mail_id” and “sender_name” settings match exactly what your emails use.
7. Pre-Production Checklist ✅
- Verify your Google Sheet contains all required columns matching placeholders.
- Check OAuth2 credentials for Gmail and Google Sheets are active and authorized in n8n.
- Test the workflow manually with a small sample of emails before scaling up.
- Confirm no emails are sent on weekends by testing or toggling dates.
- Backup your Google Sheet data to prevent accidental overwrites.
8. Deployment Guide
Activate the workflow in your n8n environment by clicking the Activate toggle.
Ensure the hourly schedule trigger node is active.
Monitor execution logs in the n8n workflow run console to track email success or failures.
Use the Gmail API dashboard to monitor email quota usage and avoid limits.
Adjust your email templates and timing in the sequence node as campaign needs evolve.
9. FAQs
Can I use Outlook instead of Gmail in this workflow?
This current workflow uses Gmail nodes exclusively, so switching to Outlook would require swapping the Gmail nodes with Office 365 Email nodes and adjusting credentials.
Does sending these emails consume my Gmail API quota?
Yes, each email sent counts toward your Gmail API usage limits. Monitor your Google Cloud Console to track and stay within quotas.
Is my data safe using this workflow?
All data resides in your Google Sheets and Gmail account, accessed only by the authorized n8n instance with OAuth2. Ensure you secure your n8n environment and credentials.
Can this workflow handle hundreds of contacts?
Yes, n8n workflows can handle batching and looping over hundreds or thousands of rows, though monitor resource usage and execution time accordingly.
10. Conclusion
By setting up this n8n workflow, you’ve automated Nathan’s personalized email outreach from initial contact to timed follow-ups, saving hours each week and reducing human error. You now have a powerful system that dynamically personalizes messages, tracks email status, and respects recipient timing preferences like avoiding weekends.
Next, you might explore integrating CRM systems to log interactions automatically, use AI nodes for smarter message crafting, or add Slack notifications when replies arrive. This workflow is a solid foundation for professional email campaign automation tailored to your business needs.