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

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

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.

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 Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free