How to Build a Zero-Cost AI Executive Assistant Using n8n, Gemini Pro, and MongoDB
How I built a free n8n workflow for an executive email assistant with Google AI, Gemini Pro, and MongoDB.
Executive Summary
The Problem: Administrative tasks like email triaging, task entry, and calendar scheduling consume an average of 5+ hours weekly with zero value creation.
The Solution: Deploying an autonomous AI Agent using n8n that reads emails, checks availability, schedules meetings, and creates database tasks.
The ROI: Inbox zero, eliminated manual data entry, and 20+ hours saved monthly at zero operational cost.
The Limitations of Standard Automation
Traditional automation relies on rigid, rule-based logic (If X, then Y). Unstructured data, such as client emails, breaks these workflows because natural language requires interpretation. Building an “Agentic Workflow” solves this. Instead of following strict paths, an AI Agent uses a Large Language Model (LLM) to reason, extract intent, and independently select the correct external tools to execute the task.
The Architecture and Tech Stack
This workflow acts as a digital Chief of Staff, operating continuously in the background. The system relies on four primary components:
The Engine (n8n): A self-hosted node-based workflow automation platform that connects the APIs and orchestrates the logic.
The Logic Model (Google Gemini Pro): The reasoning layer responsible for parsing unstructured email text, identifying meeting requests versus tasks, and formatting output data.
The Memory (MongoDB): Provides persistent state memory, allowing the agent to recall previous context from ongoing email threads.
The Tools (Google Workspace & Notion APIs): The external applications the agent manipulates to execute the work.
Step-by-Step Implementation Guide
Step 1: Configure the Trigger and Ingestion
Set the workflow to run on a scheduled trigger (e.g., every night at 10:00 PM) or attach it directly to a Webhook listening for new emails. Utilize the Gmail API node, specifically filtering for messages with the UNREAD status. Limit the batch size to prevent hitting API rate limits during testing.
Step 2: Initialize the AI Agent and Memory
Add the n8n “AI Agent” node. This differs from a standard LLM node as it supports function calling. Connect the Google Gemini Pro model to the agent. Next, attach a MongoDB Chat Memory node. This ensures that if a client replies to a previous thread changing a meeting time, the agent has the historical context to update the event rather than creating a duplicate.
Step 3: Define the Toolset
The agent requires explicit instructions on how to interact with external platforms. Create three separate tool nodes:
Calendar Scheduler: Connected to the Google Calendar API. Instruct the agent to use this only when an email contains specific time and duration data.
Task Creator: Connected to the Notion API. Instruct the agent to map extracted deliverables, client names, and deadlines into the respective database columns.
Inbox Cleanup: Connected to the Gmail API with the operation set to “Mark as Read.” This is a critical safeguard to prevent the workflow from processing the same email in an infinite loop.
Step 4: Establish the System Prompt
The system prompt dictates the agent’s behavior and operational strictness. Inject the current date and timezone dynamically ({{ $now }}) into the prompt so the LLM can accurately calculate relative dates (e.g., “tomorrow at 3 PM”). Command the agent to analyze the email, utilize the appropriate tool, and generate a plain-text summary of actions taken.
Step 5: Configure the Output Report
Route the output of the AI Agent node to a final Gmail node. Set the recipient to your own email address and pass the agent’s generated summary into the message body. This provides a daily audit log of all automated actions.
Conclusion
Replacing manual administrative work with an agentic n8n workflow shifts focus from operational maintenance to high-value execution. Start by isolating a single repetitive pipeline—such as email to task creation—validate the data parsing, and scale the toolset incrementally.
n8n workflow
json
Istiyaq Khan Razin
AI Workflow Engineer & Founder of IKK Studio
Sylhet-based AI Workflow Engineer and creative technologist. Founder of IKK Studio helping builders, YouTubers, and engineers scale content and automation with Python, n8n, and generative AI systems.
How to Run OpenClaw, n8n & Ollama on Google Colab for FREE: Complete Self-Hosted AI Automation Guide
Learn how to run OpenClaw, n8n, and Ollama completely free on Google Colab. Step-by-step guide to self-hosted AI automation without OpenAI API costs.
How I Built a Fully Automated Client Onboarding System Using n8n, Gemini, and Telegram
How I Built a Fully Automated Client Onboarding System Using n8n, Gemini, and Telegram with a free n8n workflow.