Automate Your Telegram Personal Assistant with n8n and LangChain

Discover how this n8n workflow turns your Telegram messages into smart assistant actions by routing queries to email, calendar, contacts, and more. Save time and automate your personal assistant tasks effortlessly.
telegramTrigger
agent
toolWorkflow
+6
Workflow Identifier: 1123
NODES in Use: telegramTrigger, switch, telegram, openAi, agent, toolWorkflow, memoryBufferWindow, toolHttpRequest, toolCalculator
Automate Telegram assistant with n8n and LangChain

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow turns Telegram into a smart personal assistant that understands messages and voice notes.

It solves the problem of wasting time managing many scattered tasks like emails, calendar, and contacts manually.

The workflow reads messages, decides what the user needs, and runs the right tool automatically.

The user gets quick replies on Telegram and saves hours every week handling tasks.


Who should use this workflow

Someone who uses Telegram daily for work and wants to automate common personal assistant tasks.

The user should have many small tasks like sending emails, managing calendar events, searching the web, or creating content.

This workflow fits well if managing these tasks manually is time-consuming or confusing.


Tools and services used

  • Telegram Bot API: Receives messages and voice inputs.
  • OpenAI API: Transcribes voice notes and processes text with GPT-4o.
  • LangChain in n8n: Runs an intelligent agent that decides task routing based on message content.
  • External n8n workflows: Separate automation flows for email, calendar, contacts, content creation, web search, and calculations.
  • Tavily API (optional): Allows web searches from within the assistant.

Inputs, processing, and outputs

Inputs

  • Text messages sent by the user on Telegram.
  • Voice messages sent on Telegram, recorded by user.

Processing steps

  • The Telegram Trigger node receives new inputs.
  • A Switch node checks if message is text or voice.
  • If voice, the Telegram node downloads audio file, and OpenAI transcription converts it to text.
  • Text messages or transcribed voice are set to a consistent text format for AI.
  • The LangChain Ultimate Assistant Agent uses AI to understand the user’s command and routes it to the correct toolWorkflow node.
  • When contact info is needed for email or calendar tasks, the contact lookup agent fetches data automatically.
  • Tools handle tasks like sending emails, creating calendar events, searching the web, writing content, or performing calculations.
  • Context is saved per chat with memoryBufferWindow to keep conversations aware of recent history.

Outputs

  • The AI answer is sent back to the user directly in Telegram as a message.
  • The user sees task results or replies instantly in their chat window.

Beginner step-by-step: How to use this workflow in n8n

1. Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor and click “Import from File”. Select the downloaded workflow file.

2. Configure credentials

  1. Add Telegram Bot API credentials (bot token) to the Telegram Trigger and Telegram nodes.
  2. Add the OpenAI API Key for using GPT-4o and transcription models in the OpenAI nodes.

3. Update workflow references

  1. Check each toolWorkflow node and update IDs to match your external automation workflows for email, calendar, contact, content, web search, and calculator.
  2. Modify any email addresses, calendar folder IDs, or contact tables as needed.

4. Test the workflow

  1. Send a text message or voice note to your Telegram bot.
  2. Check if the workflow detects the input, transcribes voice if needed, routes correctly, and replies back.

5. Activate for production

  1. Turn the workflow “Active” in n8n to start listening for real messages.
  2. Monitor logs and execution history to check for any errors.
  3. For stable uptime, consider self-host n8n on a good server or VPS.

Possible issues and troubleshooting

  • Webhook errors: Make sure Telegram bot token is correct and webhook URL is properly set in Telegram bot settings.
  • Transcription fails: Verify OpenAI API key and transcription node settings are correct.
  • Agent routing errors: Check the Ultimate Assistant prompt formatting and that all linked toolWorkflow nodes have correct workflow IDs.

Customizations ideas

  • Add new toolWorkflow nodes to expand capabilities, then update Ultimate Assistant prompt with new tools.
  • Change OpenAI transcription model to try different voice-to-text accuracy.
  • Edit Ultimate Assistant system prompt to adjust routing rules or add instructions.
  • Add triggers for other messaging platforms like WhatsApp or Slack by copying the Telegram trigger node.
  • Adjust memoryBufferWindow node limits to keep more or less chat history.

Summary of results

✓ Users can send voice or text requests through Telegram to automate personal assistant tasks.

✓ AI decides the right tool to use and runs task workflows automatically.

✓ Task results come back instantly as Telegram messages.

✓ Reduces hours of manual task management each week.

✓ Keeps conversation context for better recall in follow-ups.

Automate Telegram assistant with n8n and LangChain

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow downloads voice messages and uses the OpenAI transcription model to convert audio into text for AI processing.
Dedicated external automation workflows connected as toolWorkflow nodes manage email sending, calendar events, and contact lookups.
It uses a memoryBufferWindow node keyed by Telegram chat ID to save recent conversation data for improved AI interactions.
Yes, new toolWorkflow nodes can be added and the Ultimate Assistant prompt updated for more features. You can also duplicate triggers for apps like WhatsApp or Slack.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.