No Products in the Cart
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
A smart n8n workflow that connects Gmail with an AI agent (via MCP), letting you send, read, and organize emails using natural language.
π§ 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.
βπ€ 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)
Copy JSON β Open n8n β Import β Paste β Done β
Create Google project β Enable Gmail API
Create OAuth2 creds β Add n8n redirect URI
In n8n: Add Gmail OAuth2 β Paste Client ID/Secret β Connect
Find your credential ID in n8n
Update each Gmail node with your ID
Use provided webhook URL in your AI system
Send test prompts to verify connection
β
βSend a test emailβ
β
βRead latest emailβ
β
βLabel last email as 'Test'β
β
βMark latest email as unreadβ
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 π