Skip to content

Automated AI-powered Gmail responder using n8n, Google Gemini, and Gmail API.

Notifications You must be signed in to change notification settings

jaydeb2023/AI-Email-Response-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 

Repository files navigation

πŸ€– AI Email Response Agent (n8n + Google Gemini + Gmail)

An AI-powered email automation system built using n8n, Google Gemini, and Gmail API that automatically reads incoming emails, understands their context, and replies intelligently β€” reducing manual workload and improving communication speed.


πŸš€ Features

  • πŸ“₯ Reads incoming emails automatically via Gmail IMAP
  • 🧠 Understands message context using Google Gemini AI
  • βœ‰οΈ Sends dynamic, polite, and context-aware replies automatically
  • πŸ”„ Fully automated with n8n workflow orchestration
  • πŸ“Š Optional Python layer for logging and analytics

βš™οΈ Tech Stack

  • n8n (Workflow Automation)
  • Google Gemini Chat Model (LLM)
  • Gmail API (IMAP & SMTP)
  • Python (optional for monitoring/logs)

🧩 Architecture

Incoming Email (Gmail IMAP)
        β”‚
        β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚  Email Trigger β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚   AI Agent (Gemini) β”‚ β†’ Understands and drafts reply
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚ SendAndWait Email Node  β”‚ β†’ Sends email back to sender
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Setup Instructions

  1. Create an account at n8n.io (or run locally)

  2. Add:

    • Email Trigger (IMAP) β†’ Connect Gmail
    • AI Agent (Gemini) β†’ Add Gemini API key
    • SendAndWait Email β†’ Set your SMTP Gmail credentials
  3. Add this logic:

    From Email: your_email@gmail.com
    To Email: {{ $json["from"]["value"][0]["address"] }}
    Subject: Re: {{ $json.subject }}
    Message: {{ $json.output || $json.data || $json.textPlain }}
    
  4. Test with your own email account (send yourself a message)


🎯 Outcome

βœ… Autonomous Email Support Agent βœ… Hands-free intelligent replies βœ… Useful for customer service, HR, sales, and client management automation


πŸ“Έ Demo Screenshot

(Add your n8n workflow screenshot here β€” like the one you shared) /images/workflow.png

---image

🏷 Keywords

AI Agent β€’ n8n β€’ Gmail API β€’ Gemini β€’ Automation β€’ Email Bot β€’ Python β€’ Workflow AI


πŸ‘€ Author

Jaydeb Sarader πŸ“ Kolkata, India πŸ’Ό Aspiring AI Automation Engineer πŸ”— LinkedIn Profile

About

Automated AI-powered Gmail responder using n8n, Google Gemini, and Gmail API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published