by Luciano Gutierrez
🤖 AI-Powered Gmail MCP Server for n8n Description This n8n workflow template leverages an external AI Model Control Plane (MCP) Server to automate various Gmail tasks, such as composing emails, replying to threads, and handling follow-ups using dynamically generated content. It uses the native n8n Gmail nodes available from v1.88.0 onwards. Who is this template for? Ideal for developers, automation engineers, and power users using self-hosted n8n (v1.88.0+) who want to integrate artificial intelligence directly into their email workflows via a dedicated MCP Server for enhanced control and customization over AI interactions. What problem does this workflow solve? ⚙️ Reduces Manual Effort: Decreases the work involved in writing, sending, and following up on emails in Gmail. ✅ Consistency and Quality: Ensures standardized, professional responses free from typos by leveraging controlled AI prompts. 🔄 Complete Automation: Automates the entire email cycle: from the initial send, through waiting for a reply, to sending automated follow-ups based on AI logic. Workflow Overview This template provides a structured approach to integrating Gmail with an MCP Server: 📡 MCP Trigger (“MCP_GMAIL”): An n8n Webhook node that receives HTTP calls from your MCP Server. It standardizes the inputs (like recipient, subject, AI prompt) for all subsequent Gmail nodes. (You will need to configure your MCP Server to call this webhook URL). 📤 SEND_EMAIL (Gmail Node v2.1): Sends new messages. The email body (message field) is typically populated by content generated from an AI prompt processed by your MCP server and passed via the trigger. 🔄 REPLY_EMAIL (Gmail Node v2.1): Automatically replies to existing conversations (threads). It uses AI-generated content (via MCP) to formulate the reply based on the thread context. Requires Message ID and/or Thread ID. 📥 GET_EMAIL (Gmail Node v2.1): Fetches data for a specific message (using Message ID) for analysis, processing, or archiving. Useful for retrieving context before replying. ⏳ SEND_AND_WAIT (Gmail Node v2.1): Sends an email and pauses the workflow execution until a reply is received in that specific conversation (thread). This is crucial for building automated follow-up sequences. It then outputs data from the reply message. Note:* All Gmail nodes in this template use the native n8n *Gmail Tool*, integrated since v1.88.0. No additional installation of community nodes is required. See the official n8n documentation for more details on node configuration. Prerequisites Ensure you have the following before importing: 🚀 A self-hosted n8n instance running version 1.88.0 or higher. ☁️ A Google Cloud project with the Gmail API correctly enabled. 🔑 Gmail OAuth2 credentials configured in your n8n instance. Navigate to Settings > Credentials > New > Google > Gmail (OAuth2 API) to set this up if you haven't already. 🧠 Access to your MCP Server and an API Key (or other authentication method) required to interact with it via HTTP requests. How to Import and Configure Follow these steps to get the template running: In your n8n interface, navigate to Templates → Import from URL. Paste the JSON link provided for this workflow template. Configure the necessary credentials within n8n under Credentials: Gmail OAuth2: Select the Google OAuth2 credential you previously configured that has access to the desired Gmail account. MCP API Key: You'll likely need to configure credentials for interacting with your MCP Server. This might involve setting up a Header Auth credential in n8n with your MCP API Key, or configuring the HTTP Request node within the workflow directly, depending on your MCP's authentication scheme. Link this credential where needed (e.g., in the Trigger node if MCP calls n8n with auth, or in HTTP Request nodes if n8n calls MCP). Activate the Workflow: Ensure the workflow toggle is set to "Active" in the top right corner. Webhook URL: Copy the Webhook URL from the "MCP_GMAIL" Trigger node (Test or Production URL as needed) and configure your MCP Server to send requests to this URL. Recommendation: Rename the nodes with clear, descriptive names relevant to your specific use case (e.g., ✨ Generate Sales Email Body via MCP, 📥 Fetch Customer Replies). Utilize the workflow notes (sticky notes on the canvas) to document specific logic, prompt details, or configuration choices for future reference. Customization & Technical Guidance Tailor the workflow to your specific needs: 🔍 Search Filters: In nodes that fetch emails (like GET_EMAIL or if you add a Gmail - Get Many node), refine the search using the Search field (standard Gmail search operators) or filter by Label Names to process specific emails (e.g., unread from a specific sender, emails with a certain label). ✍️ AI Fine-Tuning (Prompt Engineering): The core of the AI integration happens in the prompts sent to your MCP Server. Modify these prompts (often constructed within function nodes or directly in the trigger input expected from MCP) in the message or body fields passed to the send/reply nodes. Adjust prompts to control: Tone & Style: Formal, informal, empathetic, technical, etc. Content & Format: Request bullet points, summaries, specific data extraction. Dynamic Variables: Inject data from previous n8n nodes (e.g., customer name, order details, previous email content) into the prompt for context-aware generation. Example: `"Reply to the following email thread [{{ $json.thread_content }}] addressing the customer {{ $json.customer_name }} about their query..."` 🔗 Post-Response Actions: Extend the workflow after key actions, especially the SEND_AND_WAIT node. Add nodes to: Log results to a database (MySQL, PostgreSQL, Airtable). Update CRM records (HubSpot, Salesforce). Send notifications (Slack, Discord, Telegram). Trigger other n8n workflows. 🛡️ Error Handling: Implement robust error handling. Connect the red output pins (error output) of critical nodes (like Gmail nodes or HTTP Requests to MCP) to an Error Trigger node. From there, you can: Log detailed error information to a monitoring tool or spreadsheet. Send failure notifications. Implement retry logic (using loops or specific retry settings on nodes). Route to alternative paths or fallback workflows.
by Jan Oberhauser
Triggers workflow all two minutes Reads data from a Google Spreadsheet (in example Sheet Data columns A to G) Write the data unchanged in two different Spreadsheets with same Sheet name and columns, expressions are optional)
by The { AI } rtist
Este workflow te permite crear un Bot para dar la Bienvenida y despedida en tu grupo de telegram. How To, Paso a Paso: https://comunidad-n8n.com/construye-tu-bot-con-n8n Comunidad de telegram: https://t.me/comunidadn8n
by Harshil Agrawal
This workflow allows you to create an affiliate, add metadata, and add the affiliate to a program. Tapfiliate node: This node allows you to create a new affiliate in Tapfiliate. Tapfiliate1 node: This node allows you add metadata to the affiliate that you created previously. Based on your use-case, you may or may not require this node. Tapfiliate2 node: This node allows you to add the affiliate that you created previously to a program. Based on your use-case, you might want to replace the Start node with a trigger node that gets you the information of an affiliate.
by Harshil Agrawal
This workflow allows you to add new leads in Lemlist from Airtable. Airtable node: This node lists all the emails that are stored in your Table. You may have the email addresses stored in a Google Sheet, CRM, or database. Replace the Airtable node with the respective node to get the list of the email addresses. Lemlist node: This node creates new leads for a campaign in Lemlist taking the information from the previous node. Lemlist1 node: This node returns the information of a lead from Lemlist.
by Max Tkacz
This workflow shows you how to post a message to a Slack channel and add a file attachment. It also shows you the general pattern for working with Binary data in n8n (any file like a PDF, Image etc). Specifically, this workflow shows how to download a file from a URL into your workflow, and then upload it to Slack. Video walkthrough Watch this 3 min Loom video for a walkthrough and more context on this general pattern:
by Jonathan
This workflow uses a WooCommerce trigger that will run a new product has been added, It will then post the product to Telegram and Twitter. To use this workflow you will need to set the credentials to use for the WooCommerce, Twitter and Telegram nodes.
by Harshil Agrawal
This workflow allows you to receive updates when a new contact is added in Autopilot and add them to a base in Airtable. Autopilot Trigger node: The Autopilot Trigger node will trigger the workflow when a new contact is added in Autopilot. Set node: We use the Set node to ensure that only the data that we set in this node gets passed on to the next nodes in the workflow. Airtable node: This node will store the data coming from the previous node in a table in Airtable.
by Nicholas Lewanowicz
A goal for 2022 is to write 1 thing I do each day. Combined with this workflow you will get daily messages via Telegram and when you reply to them they will be saved in a Google Sheet. Note: Make sure to configure your Telegram and Google Sheet credentials! You will also need to modify the functions to have your Telegram username and bot name.*
by Jonathan
This workflow uses a WooCommerce trigger that will run when an order has been placed. If the value of this is over 100 it will post it to a Slack channel. To use this workflow you will need to set the credentials to use for the WooCommerce and Slack nodes, You will also need to pick a channel to post the message to.
by Pauline
This workflow allows you to transform a meeting booking into Notion's task in order to centralize all of your activity. Calendly trigger**: This node triggers the workflow when a new event gets scheduled. Dropcontact**: This node will find the verified email of the contact and enrich it to be able to contact him Notion**: This node will create a new task in Notion using the information from the previous node.
by Jan Oberhauser
Gets triggered by Telegram once a user sends a message Checks if the message contains a sticker If a sticker got found it sends a message with its ID else it informs the user that no sticker was found in message