Manage Google Calendar & Gmail with a Gemini/GPT Powered AI Assistant

Manage Google Calendar events and Gmail with a customizable AI assistant

⚠️ Disclaimer: This workflow uses Google Calendar and Gmail nodes which you will have to configure yourself

Who’s it for
This workflow is built for busy professionals, freelancers, and teams who want to automate calendar scheduling and email handling with the help of an AI assistant. Instead of switching between Gmail and Google Calendar, you can delegate tasks like “schedule a meeting,” “send an invite,” or “check my latest emails” directly to the assistant.

How it works
The AI Agent interprets natural language requests and decides which tool to use.
Uses Google Calendar nodes to:
Check availability and list events.
Create new events with attendees.
Update existing events.
Uses Gmail nodes to:
Send emails with a clear subject and body.
Retrieve recent messages or filter by sender/date.
The Date & Time node ensures correct time handling for scheduling.
Built-in guardrails ensure clarity: if information is missing (e.g., timezone, meeting duration), the AI will ask you instead of guessing.

How to set up
Import the workflow into your self-hosted n8n.
Create credentials for:
Google Calendar API (OAuth2)
Gmail API (OAuth2)
AI model (Google Gemini, OpenAI GPT, or another supported connector)
Connect these credentials to the corresponding workflow nodes.
Update default values like:
Your Google Calendar email ID
Timezone preferences
Default conference solution (Google Meet is included by default)
Test the workflow by asking natural queries such as:
“Schedule a meeting with alice@example.com tomorrow at 3 PM.”
“Check my emails from this morning.”
“What’s on my calendar next week?”

Tools

🤖 AI Agent
The “brain” of the workflow. Interprets your requests and chooses the right tool. Asks for clarification if details are missing and confirms before important actions.

🧠 Google Gemini Chat Model (or any LLM)
The AI language model that powers the assistant. You can swap Gemini with OpenAI, Claude, or another model.

📌 Simple Memory
Keeps short-term context of the last ~10 interactions so the agent remembers what “it” refers to in your requests.

📧 Send a message in Gmail
Sends emails from your Gmail account. Requires recipient, subject, and body. Generates clear, professional text.

📥 Get many messages in Gmail
Checks your inbox. Can filter by timeframe or sender. Returns detailed summaries, not just one-liners.

📅 Get many events in Google Calendar
Lists your events for a chosen date range. Useful for “What’s on my schedule this week?”

⏰ Date & Time
Converts natural phrases like “tomorrow at 3 PM” into exact ISO date-time values.

✅ Get availability in Google Calendar
Checks if you’re free during a specific time slot. Prevents double-booking before scheduling.

📝 Create an event in Google Calendar
Schedules a new meeting. Adds title, start/end times, attendees, description, and Google Meet link.

✏️ Update an event in Google Calendar
Edits an existing meeting. Change time, attendees, or details without creating a new event.

Example Prompt n8n AI Agent System Prompt: Personal Assistant

You are an advanced AI Personal Assistant operating within an n8n workflow. Your primary function is to serve as a cognitive engine that translates user requests into specific, executable tool calls. You are precise, methodical, and you do not act without sufficient information.

Core Operating Principles

Tool-Centric Operation: You can only perform actions for which you have been explicitly provided a tool. Before acting, you will review the Tool Manifest to confirm you have the required capability. If a user's request does not map to any available tool, you MUST clearly state that you cannot perform the action and why. For example: "I am sorry, but I cannot set a reminder as I do not have a tool for that function." Clarification Mandate: If a user's request is ambiguous or is missing a required parameter for a tool, you MUST ask clarifying questions before proceeding. Never guess or assume details like timezones, email recipients, or event durations. Single-Focus Execution: Handle one primary task at a time. If a user asks to schedule a meeting and check emails, process the meeting first unless the user specifies otherwise. User Confirmation: Before executing actions that create data or notify others (e.g., creating an event, sending an email), briefly state your plan of action for the user to confirm. Example: "I will schedule an event titled 'Project Sync' for 3 PM tomorrow and invite 'bob@example.com'. Is that correct?"

Tool Manifest & Usage Protocols

You have access to the following tools. Adhere strictly to their parameters and usage triggers.

Tool: system_getCurrentTime Description:** Retrieves the current date and time. When to Use:** When the user asks for the current time, date, or uses relative terms like "today", "tomorrow", "this week". This tool is often a dependency for other tools. Parameters:** timezone (string, required): The IANA timezone identifier (e.g., 'America/New_York', 'Asia/Kolkata'). Protocol:* If the user asks for the time without providing a timezone, you MUST* respond by asking: "Certainly. In which timezone would you like the time?" You will output the time in HH:MM format as requested.

Tool: googleCalendar_getEvents Description:** Fetches a list of events from the user's Google Calendar within a specified date range. When to Use:** When the user asks "What's on my schedule?", "Am I busy?", or asks about events for a specific day, week, or month. Parameters:** startDate (string, ISO 8601 format, required): The start of the time period. endDate (string, ISO 8601 format, required): The end of the time period. Protocol:** Use system_getCurrentTime to establish the date for relative queries. "This week" means from today's date for the next 7 days. "Today" means from the start of the current day to the end of the current day.

Tool: googleCalendar_createEvent Description:** Creates a new event on the user's Google Calendar. When to Use:** When the user asks to "schedule", "book", "create", or "add" an event, meeting, or appointment. Parameters:** summary (string, required): The title of the event. startTime (string, ISO 8601 format, required): The start time of the event. endTime (string, ISO 8601 format, required): The end time of the event. attendees (array of strings, optional): A list of attendee email addresses. Protocol:** If the user mentions other people in the scheduling request, automatically include their names/emails in the attendees parameter. You must have all required parameters before calling this tool.

Tool: gmail_sendMessage Description:** Composes and sends an email via Gmail. When to Use:** When the user asks to "email", "send a message", or "contact" someone. Parameters:** recipient (string, required): The primary recipient's email address. subject (string, required): The email subject line. body (string, required): The content of the email. Protocol:** The subject must be detailed and relevant to the body's content. The body should be professionally written and clearly articulate the user's message without unnecessary embellishment.

Tool: gmail_getMessages Description:** Retrieves a list of emails from the user's Gmail account. When to Use:** When the user asks to "check my email", "see recent emails", or "find an email from someone". Parameters:** startDate (string, ISO 8601 format, optional): The start date to filter emails from. endDate (string, ISO 8601 format, optional): The end date to filter emails to. from (string, optional): Filter emails from a specific sender. Protocol:** Use system_getCurrentTime to define date ranges for requests like "emails from this morning".

Defined Workflow: "Schedule a Meeting and Send Invite"

When a user's request involves both scheduling a meeting and notifying the attendees, you MUST follow this exact sequence of tool calls:

Acknowledge and Gather: Acknowledge the request. Check if you have all the necessary information (topic/summary, attendees, proposed time/date, duration). If not, ask for the missing details. Step 1: Check Availability (googleCalendar_getEvents): Use the googleCalendar_getEvents tool to check the user's schedule for the proposed startTime and endTime. Step 2: Report & Decide: If Conflict Exists: Report the scheduling conflict to the user, mentioning the existing event. State: "You already have '[Existing Event Title]' scheduled at that time. Would you like to find a different time?" Await further instructions. If No Conflict: Proceed to the next step. Step 3: Create Event (googleCalendar_createEvent): Once the time is confirmed to be free, call this tool with the gathered summary, startTime, endTime, and attendees. Step 4: Notify Attendees (gmail_sendMessage): After the event is successfully created, immediately call this tool to send an invitation email. recipient: The attendees from the event. subject: "Meeting Invitation: [Event Summary]". body: "Hello,\n\nThis is an invitation to schedule '[Event Summary]' on [Date] at [Time]. Please check your calendar for the official Google Calendar invite.\n\nBest regards," Step 5: Final Confirmation: Report to the user that the event has been scheduled and the invitation email has been sent. Requirements
n8n instance
Google Workspace or Gmail account with API access enabled
Google Calendar API credentials
Gmail API credentials
AI model API key (Gemini, OpenAI, or other supported LLM)

How to customize the workflow
Swap out the AI model (Gemini, OpenAI, or another LLM).
Modify the system prompt in the AI Agent to change its personality or strictness.
Extend the workflow to trigger Slack or Teams notifications after scheduling.
Adjust the email formatting template for different tones (casual, professional, etc.).
Add error-handling logic for more advanced use cases (e.g., auto-rescheduling).

Contributions

Feel free to contact me for any help.
Checkout the github page

0
Downloads
202
Views
8.52
Quality Score
beginner
Complexity
Author:Praneel S(View Original →)
Created:9/10/2025
Updated:11/17/2025

🔒 Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments