Initializing systems...
n8n , Telegram

How I Built a Fully Automated Client Onboarding System Using n8n, Gemini, and Telegram

Istiyaq Khan

A step-by-step breakdown of the dual-agent architecture that handles inquiries, collects project details, and sends invoices — without me touching a keyboard.


As the founder of IKK Studio, I was drowning in repetitive tasks. Every new client meant the same dance: explaining services, collecting requirements, manually creating invoices, and sending follow-ups. It was eating 10+ hours every week — time I could have spent building actual systems.

So I built an automated solution. A dual-agent AI system that handles the entire client journey from first message to invoice delivery. Here's exactly how it works.


The Problem: Manual Client Onboarding Doesn't Scale

When you're a solopreneur or running a small agency, every minute spent on admin is a minute not spent on high-value work. My specific pain points were:

  • Repeating service explanations to every prospect
  • Manual data collection via scattered messages
  • Invoice creation taking 15-20 minutes per client
  • Slow response times when I was busy with actual work

I needed a system that could qualify leads, collect requirements, and close deals — while I focused on delivery.


The Solution: Dual-Agent n8n Architecture

I built a fully automated workflow using n8n, Google Gemini Pro, Telegram, Google Sheets, MongoDB, and Gmail. The system operates 24/7 and uses a dual-agent design to separate customer-facing and administrative functions.

Key Components

ComponentPurpose
Telegram BotPrimary user interface — clients message here
n8n AI Agents (2)Customer Agent + Admin Agent with different permissions
Google Gemini ProNatural language processing and reasoning
MongoDBPersistent chat memory for both conversation threads
Google SheetsLive service catalog and customer database
GmailAutomated HTML invoice delivery

How the System Works: Step-by-Step

Step 1: Intelligent Routing

When someone messages the Telegram bot, n8n validates their chat ID. Messages from my admin number route to the Admin Agent. Everything else goes to the Customer Agent.

This security layer ensures only I can access backend functions like updating pricing or viewing customer records.

Step 2: Customer Agent — The 24/7 Sales Rep

The Customer Agent handles the entire client onboarding flow:

  1. Greets the prospect professionally
  2. Fetches live service data from Google Sheets (prices, descriptions, availability)
  3. Consults the client on their specific needs
  4. Collects required information:
    • Full name
    • Email address
    • Selected service
    • Project details
    • Agreed payment amount
  5. Confirms details with the client before saving
  6. Writes the booking to the Google Sheets database

The agent uses MongoDB chat memory to maintain context across long conversations. If a client pauses and returns hours later, the agent remembers where they left off.

Step 3: Automated Invoice Generation

Here's where the magic happens. A separate workflow monitors the Google Sheets database using n8n's Google Sheets Trigger. When a new booking row is added:

  1. HTML invoice generation — A formatted HTML template pulls data from the new row (client name, email, service, amount, date)
  2. Gmail dispatch — The HTML invoice is sent to the client's email
  3. Telegram notifications — Both the client and I receive confirmation messages

The invoice uses professional HTML styling with the IKK Studio brand. No manual work required.

Step 4: Admin Agent — Secure Backend Management

The Admin Agent gives me natural language control over the business backend:

  • "Update video editing price to $150" → Updates the Google Sheets service catalog
  • "Add new service: Motion Graphics - $200" → Adds offering to database
  • "Show me recent bookings from last week" → Retrieves and formats customer records
  • MongoDB persistence ensures context is maintained across commands

The agent acts as a digital Chief of Staff, manipulating data through natural conversation instead of manual spreadsheet editing.


The Results: Zero-Touch Client Onboarding

Before: 10+ hours weekly on admin, slow response times, manual invoices
After: Fully automated system handling inquiries, data collection, and invoicing

Key Wins:

  • Immediate responses — 24/7 availability without burnout
  • Standardized data collection — No more missing information
  • Instant invoicing — Clients receive professional invoices within seconds
  • Scalable architecture — Same system handles 10 or 100 clients

Technical Architecture Deep Dive

AI Agent Configuration

Both agents use Google Gemini Pro as the reasoning engine, but with different system prompts:

Customer Agent Prompt:

Role: You are the automated customer service representative for IKK Studio.
Objective: Present available services, collect project details, and finalize bookings.
...

Admin Agent Prompt:

Role: You are the backend administrative assistant for IKK Studio.
Objective: Manage the service catalog and retrieve customer records efficiently.
...

Memory Implementation

MongoDB provides persistent state for both conversation threads. The schema uses the Telegram chat ID as the session key, enabling:

  • Multi-turn conversations
  • Context recall across sessions
  • Separate memory spaces for customer vs admin interactions

Security Considerations

  • Telegram chat ID validation restricts admin functions
  • OAuth2 credentials for Google Sheets and Gmail
  • Separate database collections for different data types

Why This Matters for South Asian Creators

As a founder based in Bangladesh, I built this system with constraints in mind:

  • Zero subscription costs — Uses free tiers of n8n, Google APIs, MongoDB
  • No payment barriers — Telegram and Google services work reliably in South Asia
  • Scalable from day one — Same system works for a solo founder or a growing team

This isn't just automation. It's building infrastructure that compounds.


Building Your Own System

Want to implement something similar? Here's your roadmap:

  1. Start with one flow — Customer service OR invoicing, not both
  2. Use n8n's AI Agent node — Handles tool calling automatically
  3. Invest in system prompts — Clear instructions = reliable outputs
  4. Test thoroughly — AI agents make mistakes; catch them early
  5. Add memory gradually — Start stateless, add MongoDB later

Conclusion

This dual-agent architecture transformed how IKK Studio operates. The system handles the mundane work — service explanations, data collection, invoice creation — freeing me to focus on high-leverage activities.

The tools are accessible. The architecture is replicable. The only barrier is execution.

If you're building systems like this or want help implementing automation for your business, I'm documenting the journey at IKK Studio. Let's connect.


🔗 Click Here to View the File

    I Built a Fully Automated Client Onboarding System Using n8n, Gemini, and Telegram