Building a master agent for Telegram with n8n
The vision: one assistant to rule them all
What if you could have a single AI assistant that handles your entire digital life through Telegram? That's exactly what I built with n8n: a Master Agent that orchestrates 10+ specialized sub-agents, each expert in their domain.
The architecture
The system follows a hub-and-spoke model:
How it works
The sub-agents
Each sub-agent is a separate n8n workflow with its own specialized tools:
Key design decisions
Session Management: Each conversation gets a unique session ID stored in n8n's Data Table. After 10 minutes of inactivity, a new session starts to keep context fresh.
Natural Language: The system prompt instructs the agent to respond conversationally, never exposing technical details or JSON traces.
Time Awareness: The current date/time is injected into every prompt, enabling accurate handling of relative dates ("tomorrow", "next week").
Graceful Failures: When an agent can't find information, it says so directly without suggesting alternatives.
The results
This Master Agent has become my daily companion:
All through a single Telegram conversation.
Want to build your own?
The beauty of n8n is that you can start simple and add agents incrementally. Begin with one or two integrations, nail the UX, then expand. The Master Agent pattern scales beautifully—just add new sub-agents as workflow tools.