An intelligent automation workflow built with n8n that manages cold email outreach campaigns, tracks delivery status in Google Sheets, and uses AI for personalization.
(Note: The scraping tools feeding this pipeline are proprietary and not included in this repo.)
This workflow is the "engine" behind a lead generation business. It takes raw lead data and turns it into sent emails automatically:
- Reads Leads: Pulls verified leads from a Google Sheet.
- Logic Check: Checks if the lead has already been contacted to prevent spam.
- AI Personalization: Uses Groq LLM to customize the email intro based on the company name.
- Sends Email: Dispatches the email via Gmail API with randomized delays.
- Updates Status: Writes "sent" back to the Google Sheet for tracking.
Built by: [SHIVAM KUMAR] | Engineering Student @ DTU
Tech Stack: n8n, Google Sheets API, Gmail API, Groq AI
- Duplicate Prevention: Intelligent logic to skip rows marked as "sent".
- Human-Like Behavior: Time delays (15 second) to mimic manual sending.
- AI-Powered: Generates unique opening lines for each email to improve open rates.
- Error Handling: Automatically handles failed sends and logs errors.
- Scalable: Can handle hundreds of rows (with proper time-spacing).
- Trigger: Manual execute or Scheduled (Cron).
- Google Sheets Node: Reads the "Leads" sheet.
- Loop Node: Iterates through each row.
- If Node:
Status != "sent"?- True: Proceed to send.
- False: Skip row.
- AI Agent (Groq): "Write a short, professional opening line for [Company Name]."
- Gmail Node: Sends email with the generated content.
- Google Sheets Node: Updates
Statuscolumn tosent. - Wait Node: Pauses for 180-300 seconds (Safety Buffer).
- n8n (self-hosted or cloud)
- Google Cloud Console Project (with Gmail & Sheets API enabled)
- Groq API Key (for AI features)
-
Import the Workflow:
- Download
agency_coldEmails.jsonfrom this repo. - Open your n8n dashboard → Click "Import from File".
- Select the JSON file.
- Download
-
Configure Credentials:
- Gmail: Add your OAuth2 credentials or App Password.
- Google Sheets: Authenticate your account.
- Groq: Add your API key.
-
Prepare Your Sheet:
- Create a Google Sheet with these columns:
Name | Email | Website | Status - Paste the Sheet ID into the Google Sheets node.
- Create a Google Sheet with these columns:
-
Run:
- Click "Execute Workflow" to start the campaign.
To avoid Gmail spam filters, I have configured the workflow with conservative limits:
- Delay: I have add delay of just 15 sec for 100 email but it is advisable to add 3 minutes minimum between emails for 100+ emails.
- Batch Size: Process 20-30 leads per run.
You can modify the "System Prompt" in the AI Agent node to change the tone of the emails (e.g., Formal vs. Casual).
- Agency Outreach: Automating sales calls for digital marketing agencies.
- Freelance Lead Gen: Selling niche lead lists (Real Estate, Healthcare) with outreach included.
- Event Invites: Sending personalized invites to a guest list.
Shivam
Engineering Student @ DTU
- LinkedIn: [https://www.linkedin.com/in/dtushivamkumar/]
- Portfolio: [https://shivamcodelogs.vercel.app/]
I am available for freelance work to build custom n8n automations for your business.
MIT License - Workflow JSON is free to use.
