Automated Telegram Group Message History Summarization - n8n Workflow

Use this n8n workflow to automatically summarize recent Telegram chat history using an AI agent powered by OpenRouter. This efficient n8n templates solution sends the digest back to the chat.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Teams needing timely, automated digests of busy Telegram group chats.
Automation specialists looking to integrate external messaging APIs using specialized n8n node components (TelePilot).
Users interested in advanced LangChain integrations within an n8n workflow environment.
Developers seeking robust n8n templates for scheduled AI processing.

Overview

This sophisticated automation solves the problem of information overload in active Telegram group chats. By deploying this specific n8n workflow, users can receive concise, AI-generated summaries of recent conversations at scheduled intervals. The n8n automation utilizes a specialized TelePilot n8n node to interact seamlessly with the Telegram API, fetching message history. The collected data is then filtered and aggregated before being fed to an AI Agent powered by OpenRouter for summarization. This makes the resulting n8n template an essential tool for efficient communication management without manually sifting through hundreds of messages.

How it Works

The n8n workflow is designed for scheduled execution, starting with the Schedule Trigger n8n trigger.


  1. Initiation and Identification: The n8n workflow starts by using the Get Chat Id By Name TelePilot n8n node to locate the target Telegram group's ID.

  2. Data Retrieval: The Last Messages History TelePilot n8n node retrieves a batch of recent messages from that identified chat.

  3. Preprocessing: The messages are separated using the Split Out n8n node. They are then refined using the Filter Last 2 hours and Skip Empty Message n8n node steps, ensuring that only current, substantive text messages are passed forward.

  4. Aggregation: The Aggregate n8n node combines the cleaned messages back into a single text payload, optimizing the input for the LLM.

  5. AI Summarization: The text enters the AI Agent n8n node. This agent, configured with the OpenRouter Chat Model (and optionally MongoDB Chat Memory), processes the extensive chat history and generates a concise summary.

  6. Delivery: Finally, the generated summary text is sent back to the original Telegram chat using the Send Summary To Chat TelePilot n8n node, completing the scheduled cycle of this complex n8n workflow.

Installation Guide


  1. Import the n8n Workflow: Copy the provided JSON data and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Install Custom Nodes: This n8n workflow relies on the community n8n node package @telepilotco/n8n-nodes-telepilot. You must install this package via the N8N Settings menu (Community Nodes).

  3. Set Up Credentials: Configure API keys for both the TelePilot n8n node and the OpenRouter Chat Model n8n node. If using the memory feature, ensure your MongoDB credentials are also set up.

  4. Configure Parameters: Adjust the Schedule Trigger n8n trigger to your desired frequency. Ensure the chat name in the Get Chat Id By Name n8n node matches your target Telegram group exactly. Review the filtering logic in the Filter Last 2 hours n8n node if a different time window is needed.

  5. Activation: Save and activate this powerful n8n template to begin automating your Telegram summarization.

Node Details

Schedule Trigger n8n trigger: Initiates the n8n workflow automatically at predefined intervals (e.g., hourly).
Get Chat Id By Name (TelePilot n8n node): Locates the required Telegram chat ID by name for subsequent data retrieval.
Last Messages History (TelePilot n8n node): Fetches the specified quantity of historical messages from the identified Telegram chat.
Filter Last 2 hours (Filter n8n node): A critical filter used to limit the data set, ensuring the AI only summarizes very recent messages.
Aggregate n8n node: Collects all individually processed, filtered messages back into a single item list, preparing the data for the LangChain component.
AI Agent (LangChain n8n node): The core reasoning component of this n8n workflow. It orchestrates the summarization task using the integrated language model.
OpenRouter Chat Model (LangChain n8n node): Provides the large language model backend necessary for generating high-quality text summaries for this specific n8n template.
Send Summary To Chat (TelePilot n8n node): Executes the final publishing step, sending the AI-generated summary text directly back to the specified Telegram group chat, finalizing the run of the n8n workflow.

Related n8n Workflows

Paid

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by

Integration architect with 15+ years of experience building seamless system connections and AI-powered automation solutions. Founder of Mingles.ai an AI automation startup specializing in intelligent workflow optimization. Expert in connecting complex systems, APIs, and creating custom n8n automations that transform business operations.

Featured*