Build a Telegram AI Assistant with n8n & Baserow Memory

This workflow creates a powerful Telegram AI assistant that listens to voice, photo, and text messages, storing and retrieving long-term memories and notes with Baserow. It solves the problem of managing personal interactions, memory, and note-taking automatically with AI, enhancing personalized user engagement.
webhook
agent
telegram
+10
Workflow Identifier: 1088
NODES in Use: Webhook, Set, If, Switch, Telegram, OpenAI, Baserow, LangChain Agent, Aggregate, Merge, ConvertToFile, ExtractFromFile, Postgres
Automate Telegram AI with n8n and Baserow

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

Learn how to Build this Workflow with AI:

What this workflow does

This workflow is an AI assistant inside n8n that works with Telegram and Baserow.
It takes voice, text, and photo messages from Telegram, turns voice into text, understands photos, and keeps important notes saved in Baserow.
The assistant then uses AI to reply nicely and helpfully on Telegram.
This saves time by organizing messages automatically and making replies smart and personal.


Who should use this workflow

This automation fits people who use Telegram for work and personal chats and want to keep track of important messages easily.
It is good if you get voice notes, pictures, or text you want to remember or act on without searching manually.


Tools and services used

  • Telegram Bot API: Receives messages and sends replies on Telegram.
  • OpenAI API: Converts voice to text, analyzes images, and generates AI replies.
  • Baserow database: Stores long-term memories and notes from messages.
  • Postgres database (optional): Keeps recent chat memory to improve AI reply context.
  • n8n automation platform: Runs all workflow steps and connects the tools.

How this workflow works: Inputs → Processing → Output

Inputs

  • Voice, photo, or text messages sent to the Telegram bot.
  • User details for access control.

Processing steps

  • Webhook: Captures incoming Telegram messages.
  • User validation: Checks if messenger matches an allowed user ID.
  • Message type detection: Routes voice, text, and photo messages separately.
  • Voice processing: Downloads audio, then transcribes speech to text using OpenAI.
  • Photo processing: Downloads images, converts to base64, and analyzes content with OpenAI.
  • Text processing: Extracts message text for AI understanding.
  • Memory retrieval: Gets stored notes and memories from Baserow to add context.
  • AI reply generation: Uses LangChain agent with OpenAI GPT to create personalized responses using memory context.
  • Memory saving: Adds new notes or memories to Baserow automatically if AI finds important info.
  • Optional session memory: Stores recent chats in Postgres to improve AI replies contextually.

Output


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

1. Import workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor where you want to run the automation.
  3. Use the “Import from File” option to load the downloaded workflow.

2. Setup credentials and settings

  1. Add your Telegram Bot API token in the Telegram nodes.
  2. Insert OpenAI API key in relevant transcription, image analysis, and GPT nodes.
  3. Connect your Baserow account and update table IDs for Memories and Notes.
  4. Check and update the user ID and names in the Validation nodes to your Telegram details.

3. Testing and activation

  1. Send a test voice, text, or photo message to your Telegram bot to see if the workflow triggers and replies.
  2. If it works, toggle the workflow from draft to active to run it live.

Optional: For stronger control over your data and better privacy use, consider self-host n8n.


Possible issues and how to fix

  • If webhook does not trigger, check the webhook path is exactly set to “gram” and HTTP method is POST in the Webhook node.
    Also confirm Telegram webhook points to correct n8n URL.
  • If AI replies are not personal or too general, review the system prompt and ensure Baserow memories are fetched properly in the LangChain agent node.
  • If voice transcription fails, verify the audio binary data path is mapped correctly from Telegram file download to the OpenAI transcription node input.

Customizations and extensions

  • Change OpenAI model in the LangChain agent to GPT-4 or other supported versions for smarter replies.
  • Add new AI tools or APIs like calendar or contacts in the system prompt for richer AI help.
  • Edit the prompt in LangChain agent to control when notes or memories are saved based on keywords or message content.
  • Support multiple users by adding more Telegram users in the Validation nodes with their IDs and names.
  • Connect Baserow tables to no-code UI tools for manual browsing or editing of saved memories and notes.

Summary

✓ Automatically process Telegram voice, text, and photo messages.
✓ Turn voice into text and analyze images using AI.
✓ Save and recall important notes and memories in Baserow.
✓ Generate personalized AI replies that keep conversations flowing.
✓ Free up your time by automating message organization and replies.

Automate Telegram AI with n8n and Baserow

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, the workflow can use different AI services supported in n8n, but prompt formats and credentials need updating accordingly.
Yes, all transcription, image analysis, and chat replies use OpenAI API credits based on your subscription plan.
Data flows securely through n8n credentials; for extra control, self-hosting n8n is recommended.
By adjusting the Validation nodes to include more user IDs and names, the workflow can support multiple users.

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.