🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Telegram + Google Sheets: chat summaries you can trust

Lisa Granqvist Partner Workflow Automation Expert

Your Telegram support chat starts out simple. Then the same questions show up again, details get lost in scrollback, and you end up answering from memory (or guessing) because finding the “right” message takes too long.

This is where Telegram Sheets summaries help. Support leads feel it when handoffs go messy. Founders notice it when they’re the fallback for every edge-case. And marketing managers run into the same chaos when community questions pile up.

This workflow turns Telegram chats into structured sessions in Google Sheets, then gives you on-demand summaries and session-based Q&A. You’ll see what it does, why it works, and what you need to run it reliably.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Telegram + Google Sheets: chat summaries you can trust

The Problem: Telegram Support Gets Amnesia Fast

Telegram is great for fast conversations, but it’s a terrible system of record. A “quick answer” turns into five follow-up messages. Then someone asks the same thing tomorrow, and you can’t remember what you promised, what context mattered, or which version of the truth you gave last time. You search, you scroll, you skim. It’s distracting, and honestly it makes you cautious because you know one wrong reply can create a real support issue.

It adds up fast. Here’s where it breaks down once volume is more than a handful of chats per day.

  • You re-answer questions because previous answers are buried in chat history.
  • Different teammates reply differently, which means customers get inconsistent guidance.
  • Session context gets mixed, so a “billing” chat accidentally inherits “technical” assumptions.
  • You have no searchable audit trail when you need to prove what was said and when.

The Solution: Session-Based Telegram Chat Logging + Summaries

This n8n workflow turns your Telegram bot into a session-aware assistant. Every message starts in Telegram, but the “memory” lives in Google Sheets, where sessions are tracked as active or expired. When a user types /new, the workflow creates a fresh session ID and sets it as current. When they use /resume, it reactivates a previous one instead of blending topics together. From there, OpenAI generates replies with contextual memory, and every prompt/response gets logged to a sheet for later search and audit.

When you need a recap, /summary pulls the session’s history from Google Sheets, compacts it, and sends a clean summary back to Telegram. And if someone asks, “What did we decide about pricing?” you can run /question to get an answer grounded in the session log instead of someone’s best guess.

What You Get: Automation vs. Results

Example: What This Looks Like

Say your team handles about 25 Telegram conversations a week, and you spend maybe 5 minutes per conversation searching old messages or re-explaining prior decisions. That’s roughly 2 hours of pure catch-up. With this workflow, a user runs /summary and gets the recap in under a minute, then /question pulls a specific answer from the same session log. The time cost becomes “send a command, skim a summary,” not “hunt through chat and hope.”

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Telegram for the bot users chat with.
  • Google Sheets to store sessions and chat logs.
  • OpenAI API key (get it from your OpenAI dashboard).

Skill level: Intermediate. You’ll connect accounts, map a few sheet columns, and test Telegram commands.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A Telegram message triggers everything. The Telegram bot receives a message, then checks Google Sheets to see which session is currently active for that user.

The workflow routes by command. A switch routes requests like /new, /current, /resume, /summary, and /question so each action stays predictable instead of being handled as “free-form chat.”

AI responds with session memory. For normal chat, an AI Agent uses an OpenAI Chat Model plus a compact memory buffer to stay aware of the current session context. That reply goes back to Telegram, and the prompt/response pair is appended to the log in Google Sheets.

Summaries and Q&A pull from stored history. When users request a summary or ask a targeted question, the workflow loads session messages from Google Sheets, assembles the relevant text, and runs a summarization or Q&A chain before sending the result to Telegram.

You can easily modify how long sessions stay “active” or how much history the memory uses based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Telegram Trigger

Start by setting up the Telegram trigger that receives user messages and kicks off the session logic.

  1. Add and open Telegram Message Trigger.
  2. Set Updates to message.
  3. Credential Required: Connect your telegramApi credentials.
  4. Save the node and ensure the webhook is registered by executing once in test mode.

Step 2: Connect Google Sheets

These nodes manage session state and message history in Google Sheets. Use the same spreadsheet ID across all of them.

  1. Open Fetch Current Session and set Document ID to [YOUR_ID] and Sheet Name to Session.
  2. Ensure Filters match STATE = current and OptionsReturn First Match is enabled.
  3. Set Document ID to [YOUR_ID] and appropriate sheet names for these Google Sheets nodes: Expire Previous Session, Create New Session, Append Chat Log, Mark Session Expired, Set Current Session, Retrieve Session History, Load Session Messages.
  4. Credential Required: Connect your googleSheetsOAuth2Api credentials to all Google Sheets nodes listed above.
⚠️ Common Pitfall: The workflow uses [YOUR_ID] as a placeholder. Replace it with your actual Google Sheets document ID in every Google Sheets node to avoid empty results.

Step 3: Set Up Command Routing

Route incoming Telegram commands to the correct branch using the switch logic.

  1. Open Route Command or Text and verify the rules for New session, Current session, Resume session, Summary, and Question using expressions like {{ $('Telegram Message Trigger').item.json.message.text }}.
  2. Confirm each rule’s Right Value matches the command prefix: /new, /current, /resume, /summary, /question.
  3. Keep Fallback Output set to extra so non-command messages route to Telegram AI Agent.

Step 4: Configure Session Management Logic

These nodes expire old sessions, create new ones, and validate session availability.

  1. In Expire Previous Session, set Operation to update and map STATE to expire and SESSION to {{ $('Fetch Current Session').item.json.SESSION }}.
  2. In Create New Session, set Operation to append, map STATE to current, and SESSION to {{ $('Telegram Message Trigger').item.json.update_id }}.
  3. In Notify Session Enabled, set Text to New session activated and Chat ID to {{ $('Telegram Message Trigger').item.json.message.from.id }}.
  4. Set up Extract Resume Text to assign text from {{ $('Telegram Message Trigger').item.json.message.text }}, then validate parsing in Parse Resume Command (the code extracts /resume).
  5. In Mark Session Expired and Set Current Session, keep Operation as update and map SESSION to {{ $('Fetch Current Session').item.json.SESSION }} and {{ $('Parse Resume Command').item.json.resume }} respectively.
  6. In Check Session Exists, ensure the condition checks whether {{ $json }} is empty, then routes to Send Session Missing or Send Session Found.
Tip: Use the Report Current Session node with =The current session is {{ $('Fetch Current Session').item.json.SESSION }} to debug session state during testing.

Step 5: Set Up Telegram AI Agent

This branch handles standard messages by invoking an OpenAI-powered agent with memory, then logs the chat.

  1. Open Telegram AI Agent and set Text to {{ $('Telegram Message Trigger').item.json.message.text }}.
  2. Set System Message to Sei un assitente virtuale:\n\nData e ora corrente: {{ $now }}.
  3. Open Compact Memory Buffer and set Session Key to {{ $('Fetch Current Session').item.json.SESSION }}, Session ID Type to customKey, and Context Window Length to 100.
  4. Ensure OpenAI Conversation Model is connected to Telegram AI Agent as the language model. Credential Required: Connect your openAiApi credentials in OpenAI Conversation Model.
  5. In Dispatch Bot Reply, set Text to {{ $json.output }} and Chat ID to {{ $('Telegram Message Trigger').item.json.message.from.id }}.
  6. In Append Chat Log, map DATE to {{ $now }}, PROMPT to {{ $('Telegram Message Trigger').item.json.message.text }}, SESSION to {{ $('Fetch Current Session').item.json.SESSION }}, and RESPONSE to {{ $('Telegram AI Agent').item.json.output }}.
⚠️ Common Pitfall: Compact Memory Buffer is an AI memory sub-node. Add credentials to the parent model node (OpenAI Conversation Model), not to the memory node itself.

Step 6: Set Up Summary and Q&A Chains

This path summarizes a session or answers a question using stored session history.

  1. In Retrieve Session History and Load Session Messages, filter by SESSION using {{ $('Fetch Current Session').item.json.SESSION }}.
  2. In Build Summary Context and Assemble Full Text, keep the provided JavaScript that compiles PROMPT and RESPONSE into fullText.
  3. Configure Summarize Conversation with the prompt Write a concise summary of the following:\n\n\n"{{ $json.fullText }}"\n\n\nCONCISE SUMMARY:.
  4. Ensure OpenAI Summary Model is connected to Summarize Conversation. Credential Required: Connect your openAiApi credentials in OpenAI Summary Model.
  5. In Extract Question Text, set text to {{ $('Telegram Message Trigger').item.json.message.text }}, then let Parse Question Command extract the question via its code block.
  6. In Question Answer Chain, set Text to Question:\n{{ $json.question }} and keep the message prompt You have to answer the questions that are asked by analyzing the following text:\n\n{{ $json.fullText }}.
  7. Ensure OpenAI Q&A Model is connected to Question Answer Chain. Credential Required: Connect your openAiApi credentials in OpenAI Q&A Model.

Step 7: Configure Output Nodes

Telegram outputs send status, summary, and Q&A responses back to the user.

  1. In Deliver Summary, set Text to {{ $json.response.text }} and Chat ID to {{ $('Build Summary Context').item.json.chat_id }}.
  2. In Deliver Answer, set Text to {{ $json.text }} and Chat ID to {{ $('Assemble Full Text').item.json.chat_id }}.
  3. In Send Session Found and Send Session Missing, keep the status messages =The current session is {{ $json.SESSION }} and =This session doesn't exist.
  4. Credential Required: Connect your telegramApi credentials to all Telegram nodes: Notify Session Enabled, Dispatch Bot Reply, Send Session Found, Send Session Missing, Deliver Summary, Deliver Answer, Report Current Session.

Step 8: Test and Activate Your Workflow

Validate the full workflow by simulating Telegram commands and confirming Google Sheets updates.

  1. Click Execute Workflow and send a Telegram message like /new or a normal question to your bot.
  2. Verify a new row appears in the Session sheet and chat entries append to the Database sheet via Append Chat Log.
  3. Test /summary and /question to confirm Deliver Summary and Deliver Answer send responses.
  4. When all steps succeed, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Google Sheets credentials can expire or need the right permissions. If the workflow stops logging, check the Google Sheets node authentication in n8n first, then confirm the target spreadsheet is still shared to that account.
  • If you’re using Wait nodes or external processing, timing can vary. Bump up the wait duration if downstream nodes fail because they’re receiving empty or partial message history.
  • OpenAI prompts tend to start generic. Add your brand voice and “what not to say” guidance early, or you will be editing answers forever.

Frequently Asked Questions

How long does it take to set up this Telegram Sheets summaries automation?

About 30 minutes if your bot and sheet are ready.

Do I need coding skills to automate Telegram chat summaries?

No. You’ll mostly connect Telegram, Google Sheets, and OpenAI in n8n. The workflow already includes the command parsing, so you’re configuring more than building.

Is n8n free to use for this Telegram Sheets summaries workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs, which are typically a few cents per summary or longer answer.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this Telegram Sheets summaries workflow for a different set of commands?

Yes, but keep it simple at first. You can modify the “Route Command or Text” switch to add new commands, then reuse the existing patterns that write to Sheets and send a Telegram reply. Common tweaks include renaming commands to match your tone, changing what gets stored in the chat log columns, and adjusting the memory window so the bot uses more (or less) history in replies.

Why is my Telegram connection failing in this workflow?

Most of the time it’s a bot token issue. Regenerate the token with BotFather, update the Telegram Trigger and Telegram Send credentials in n8n, and retest by sending /current. If it still fails, check that your workflow is active and that Telegram isn’t delivering updates to a different bot instance.

How many chats can this Telegram Sheets summaries automation handle?

A lot, as long as your Sheets and plan can keep up. On n8n Cloud, your limit is mostly executions per month based on plan, and summaries/Q&A use more compute than basic logging. If you self-host, there’s no execution cap, but performance depends on your server and how big your Google Sheet gets. Practically, most small teams run hundreds of messages a day without drama if the sheet structure stays clean.

Is this Telegram Sheets summaries automation better than using Zapier or Make?

Often, yes. Multi-session chat logic, branching commands, and “pull history then summarize it” flows are where n8n tends to feel more natural, and self-hosting is a big deal if you expect volume. Zapier and Make can still work, but they get awkward when you need session state and memory, not just “message in, message out.” The real question is maintenance: if you want something you can extend (new commands, new logging, different models), n8n is usually the calmer choice. If you’re unsure, Talk to an automation expert and sanity-check the approach before you commit.

Once your Telegram chats have sessions, summaries, and a searchable trail in Google Sheets, the whole thing feels lighter. The workflow handles the repetition so you can focus on real support.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal