Per vedere accedi...

Gmail MCP Workflow - AI-Powered Email Management

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

MCP Gmail Workflow – AI-Powered Email Management

✨ What It Does

A smart n8n workflow that connects Gmail with an AI agent (via MCP), letting you send, read, and organize emails using natural language.

βš™οΈ Key Features

🧠 AI Commands: β€œSend email to John about the budget”
πŸ“₯ Inbox Control: Mark read/unread, apply/remove labels
πŸ—‚ Smart Organization: Auto-label based on content
πŸ€– MCP-Ready: Works with Claude, ChatGPT, etc.

🎯 Use Cases

β€œπŸ“€ Send a follow-up to the client about yesterday's meeting”
β€œπŸ“¬ Mark all newsletters as read and label 'Newsletter'”
β€œπŸ§Ύ Summarize latest email from Sarah”
β€œπŸ—ƒ Label all Project X emails as 'Project-X-2024'”
β€œβ­ Find unread emails from my manager and mark as important”
πŸ›  Setup Guide
πŸ”‘ Prerequisites

n8n (self-hosted or cloud)
Gmail API credentials
MCP-compatible AI (optional but powerful)

πŸ“₯ 1. Import Workflow

Copy JSON β†’ Open n8n β†’ Import β†’ Paste β†’ Done βœ…

πŸ” 2. Gmail OAuth2 Setup

Create Google project β†’ Enable Gmail API
Create OAuth2 creds β†’ Add n8n redirect URI
In n8n: Add Gmail OAuth2 β†’ Paste Client ID/Secret β†’ Connect

🧩 3. Update Credential References

Find your credential ID in n8n
Update each Gmail node with your ID

🧠 4. MCP Trigger (Optional)

Use provided webhook URL in your AI system
Send test prompts to verify connection

πŸ§ͺ 5. Test Key Actions

βœ… β€œSend a test email”
βœ… β€œRead latest email”
βœ… β€œLabel last email as 'Test'”
βœ… β€œMark latest email as unread”

βš™οΈ 6. Advanced Tips

Create custom labels in Gmail
Use HTTPS + webhook auth
Add retries and error handling in n8n
🧯 Troubleshooting
❗ Gmail Auth Error? β†’ Re-auth and check redirect URI
❗ Webhook not firing? β†’ Check endpoint + manual test
❗ Label errors? β†’ Use correct label names or IDs
βœ… Required Gmail Scopes:
gmail.modify
gmail.send
πŸ“ˆ Best Practices
πŸ” Test regularly
πŸ”’ Use minimal permissions
🏷 Consistent label naming
πŸ” Monitor execution + webhook logs
πŸŽ‰ You're All Set!
Control Gmail with your voice or text through AI. Make managing emails smarter, faster, and 100% automated πŸ’Œ

Do you want to automate your business?

Let's talk about your project