AutomationMart
Home/Browse/Create a session-based Telegram chatbot with GPT-4o-mini and Google Sheets
n8n

Create a session-based Telegram chatbot with GPT-4o-mini and Google Sheets

n8nn8n31 modulesv1.0
Google SheetsOpenAITelegramLinkedIn

How It Works This workflow creates an AI-powered Telegram chatbot with session management, allowing users to: - Start new conversations (/new). - Check current sessions (/current). - Resume past sessions (/resume). - Get summaries (/summary). - Ask questions (/question). Key Components: - Session Management: - Uses Google Sheets to track active/expired sessions (storing SESSION IDs and STATE). - /new creates

At a glance

Create a session-based Telegram chatbot with GPT-4o-mini and Google Sheets is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Google Sheets, OpenAI, Telegram, LinkedIn. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Google Sheets, OpenAI, Telegram, LinkedIn
Modules
31
Price
Free
Version
v1.0
Create a session-based Telegram chatbot with GPT-4o-mini and Google Sheets workflow diagram

About this workflow

How It Works This workflow creates an AI-powered Telegram chatbot with session management, allowing users to: - Start new conversations (/new). - Check current sessions (/current). - Resume past sessions (/resume). - Get summaries (/summary). - Ask questions (/question). Key Components: - Session Management: - Uses Google Sheets to track active/expired sessions (storing SESSION IDs and STATE). - /new creates a session; /resume reactivates past ones. - AI Processing: - OpenAI GPT-4 generates responses with contextual memory (via Simple Memory node). - Summarization: Condenses past conversations when requested. - Data Logging: - All interactions (prompts/responses) are saved to Google Sheets for audit and retrieval. - User Interaction: - Telegram commands trigger specific actions (e.g., /question [query] fetches answers from session history). --- Main Advantages 1. Multi-session Handling Each user can create, manage, and switch between multiple sessions independently, perfect for organizing different conversations without confusion. 2. Persistent Memory Conversations are stored in Google Sheets, ensuring that chat history and session states are preserved even if the server or n8n instance restarts. 3. Commands for Full Control With intuitive commands like /new, /current, /resume, /summary, and /question, users can manage sessions easily without needing a web interface. 4. Smart Summarization and Q&A Thanks to OpenAI models, the workflow can summarize entire conversations or answer specific questions about past discussions, saving time and improving the chatbot’s usability. 5. Easy Setup and Scalability By using Google Sheets instead of a database, the workflow is easy to clone, modify, and deploy — ideal for quick prototyping or lightweight production uses. 6. Modular and Extensible Each logical block (new session, get current session, resume, summarize, ask question) is modular, making it easy to extend the workflow with additional features like analytics, personalized greetings, or integrations with CRM systems. --- Setup Steps Prerequisites: - Telegram Bot Token: Create via BotFather. - Google Sheets: - Duplicate this template. - Two sheets: Session (active/inactive sessions) and Database (chat logs). - OpenAI API Key: For GPT-4 responses. Configuration: 1. Telegram Integration: - Add your bot token to the Telegram Trigger and Telegram Send nodes. 2. Google Sheets Setup: - Authenticate the Google Sheets nodes with OAuth. - Ensure sheet names (Session, Database) and column mappings match the template. 3. OpenAI & Memory: - Add your API key to the OpenAI Chat Model nodes. - Adjust contextWindowLength in the Simple Memory node for conversation history length. 4. Testing: - Use Telegram commands to test: - /new: Starts a session. - /question [query]: Tests AI responses. - /summary: Checks summarization. 5. Deployment: - Activate the workflow; the bot will respond to Telegram messages in real-time. --- Need help customizing? Contact me for consulting and support or add me on Linkedin.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Save new leads from Outgrow to a Google Sheets spreadsheet

Every time a new lead is created in Outgrow, Make will automatically add that lead to your Google Sheets spreadsheet as a new row. The template uses this [example spreadsheet](https://docs.google.com/spreadsheets/d/1I3Q8Y-JYs2E2Ol8_VawI7oCGkrwgvlPUwIz_IYJ4e2w/edit?usp=sharing).

Free

Slack AI ChatBot : context-aware, replies to mentions AND also DMs

Click here to access this Workflow for free. --- Get your own custom ChatGPT inside your Slack Workspace Description This n8n workflow enables a fully autonomous AI assistant within your Slack Workspace. It listens for both public mentions and direct messages (DMs), and replies in real-time using a large language model (OpenAI's GPT-4o by default). The assistant can dynamically fetch previous messages for better context, providing smart, coherent, and personalized responses. --- 🔧 Key Features

Free

Generate responses using Perplexity AI and ChatGPT and send them via Telegram

Automatically generate responses using Perplexity AI and ChatGPT then send them via Telegram. Enhance communication by integrating AI-driven replies directly into your Telegram chats.

Free

Send Thankster cards from new Google Sheets spreadsheet rows

Every time a new row is added to a Google Sheets spreadsheet, Make will automatically send a new card in Thankster. The template uses this [example spreadsheet](https://docs.google.com/spreadsheets/d/1wzql8DegSuxW61SH0AmOkuU1ZB9Fj7SPFWKkXq1nrnQ/edit?usp=sharing).

Free

Create a new contact in HighLevel for every new row in Google Sheets

Automatically add new Google Sheets entries as contacts in HighLevel. Streamline your workflow by syncing data between Google Sheets and HighLevel effortlessly.

Free

AI orchestrator: dynamically selects models based on input type

This workflow is designed to intelligently route user queries to the most suitable large language model (LLM) based on the type of request received in a chat environment. It uses structured classification and model selection to optimize both performance and cost-efficiency in AI-driven conversations. It dynamically routes requests to specialized AI models based on content type, optimizing response quality and efficiency. --- Benefits Smart Model Routing: Reduces costs by u

Free

Daily validated business ideas using n8n and Upwork

How it works - Runs at set times to fetch new Upwork job listings. - Checks each job’s total or hourly budget and keeps only higher-budget ones. - Extracts the job description for those selected jobs. - Uses AI to identify the core business idea from each description. - Records the idea and job details into a Google Sheet. - Can also be triggered manually to process a single job description. Set up steps - Required: Upwork API key, AI service key, and a Google Sheet. - Import: Bring the JSON int

Free

🛠️ HighLevel tool MCP server 💪 all 17 operations

Need help? Want access to this workflow + many more paid workflows + live Q&A sessions with a top verified n8n creator? Join the community Complete MCP server exposing all HighLevel Tool operations to AI agents. Zero configuration needed - all 17 operations pre-built. ⚡ Quick Setup 1. Import this workflow into your n8n instance 2. Activate the workflow to start your MCP server 3. Copy the webhook URL from the MCP trigger node 4. Connect AI agents using the MCP URL 🔧 How it Works • MCP Trigger: S

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free