This n8n template builds Stacey , an AI assistant that runs inside Telegram. Stacey listens to your messages, understands what you want using AI, and intelligently routes commands to MCP-connected tools — like Gmail, Google Calendar, a blog writer, and more.
For optimal performance, we recommend using OpenAI’s GPT-4o model. In this template, Google Gemini is used as a free alternative.
This workflow is designed for:
Listens to Telegram messages (text and voice)
Transcribes audio using Whisper (optional)
Uses Stacey , an AI agent powered by Gemini (or GPT-4o if you upgrade), to:
Responds to the user naturally with confirmations and outputs
Before using this workflow, make sure you have:
A self-hosted or cloud-based n8n instance
A Telegram Bot Token from @BotFather
Google OAuth2 credentials for:
Optional: OpenAI or Whisper API key for voice transcription
Optional: Tavily API key for live web search
Gemini (Google AI) is preconfigured in the template but can be swapped
Go to Settings → Credentials and add:
Telegram API : Your bot token from BotFather
Google OAuth2 :
https://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/calendarGemini / Palm API : Used for the language model
(Optional) OpenAI Whisper : For voice transcription
(Optional) Tavily : For real-time internet searches
Go to n8n
Click Workflows → Import from File
Upload ai_assistant.json
Connect your saved credentials to the correct nodes:
✅ Step 2.5: Import the Content Creator Sub-Workflow
The Content Creator is implemented as a modular sub-workflow and invoked through the Map Server as part of the MCP logic.
To set it up:
Go to Workflows → Import from File
Upload content_creator_tool.json (provided in your files)
Save it with a name like “Content Creator Tool”
🔗 Integration with MCP:
This tool is triggered via the MCP Map Server using an Execute Workflow node
The AI agent chooses this tool when the user request involves writing blog posts, emails, product descriptions, etc.
Make sure the tool ID or name in the Map Server matches what the AI agent uses in its logic
You can customize this sub-workflow to:
Add branching for different content types (e.g., blog vs. email)
Send outputs directly to Gmail, Google Docs, or Sheets
Talk to @BotFather
Use /newbot to create a bot and get your token
Paste this token into:
Telegram Trigger node (Telegram Trigger1)Telegram Send Message node (Response1)Make sure your bot’s privacy is set correctly (use /setprivacy)
Open the “AI Agent” node
In the systemMessage field, you'll find a prompt that defines Stacey:
You can customize Stacey’s:
This template includes:
Send EmailReply to EmailGet EmailsLabel EmailsCreate/Update/Delete EventsContent CreatorSearch Web with TavilyCalculatorTo extend:
MCP Server TriggerAI Agent nodeOpen Telegram and message your bot:
The bot will:
Download File and Transcribe nodesTelegram not responding?
Gmail actions not working?
AI not responding or behaving poorly?
Created by David Olusola
Free to use, modify, and resell with attribution.
If this helped you, please rate the template or follow me on the n8n Creator Page.


