Skip to main content

Telegram support bot with OpenAI, Pinecone and human expert escalation

Workflow preview

Workflow preview
100%
Telegram support bot with OpenAI, Pinecone and human expert escalation preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Template name Smart AI Support Assistant for Telegram Short description Smart AI Support Assistant for Telegram automatically answers repeated questions in your group using a Q&A knowledge base in ...

Best for

  • Support Chatbot automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, n8n-nodes-base.switch, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.telegram, @n8n/n8n-nodes-langchain.vectorstorepinecone, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.documentdefaultdataloader

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Igor Chernyaev.

Original n8n.io source

1.1 Workflow description

Title
Telegram support bot with OpenAI, Pinecone and human expert escalation
Workflow name
Telegram support bot with OpenAI, Pinecone and human expert escalation

Template name
Smart AI Support Assistant for Telegram

Short description
Smart AI Support Assistant for Telegram automatically answers repeated questions in your group using a Q&A knowledge base in Pinecone and forwards new or unclear questions to a human expert.

Long description (Description поле)

How it works

  1. Question detection listens to messages in a Telegram group and checks whether each new message is a real question or an expert reply.
  2. Knowledge base search looks for an existing answer in the Pinecone vector store for valid questions from the group.
  3. Auto‑reply from cache sends the saved answer straight back to the group when a good match is found, without involving the expert.
  4. Escalation to expert creates a ticket and forwards unanswered questions to the expert in a private chat with the same bot.
  5. Expert learning loop saves the expert’s reply to Pinecone so that similar questions are answered automatically in the future.

Setup steps

  • Connect Telegram Trigger to a single Telegram bot that is added as an admin to the group/supergroup and receives all user messages.
  • Use the same bot for the expert: the expert’s private chat with this bot is where tickets and questions are delivered.
  • Set up Pinecone: create an index, note the environment and index name, and add your Pinecone API key to n8n credentials.
  • Add your AI model API key (for example, OpenAI) and select the model used for embeddings and answer rewriting.
  • Configure any environment variables or n8n credentials for project IDs and spaces/namespaces used in Pinecone.
  • Test the full flow: send a question in the group, confirm that a ticket reaches the expert in a private chat, reply once, and check that the next similar question is answered automatically from the cache.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 2 - QuestionOrReply_Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.3

Block 3 - QuestionFilter_Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - ValidQuestion_IF

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 5 - CreateTicket_Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - SendToExpert_Message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 7 - Reformulate_Message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 8 - ExpertReply_Message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 9 - IsExpert_Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - IsExpert_IF

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 11 - PrepareReplyFlag_Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Pinecone Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1.3

Block 13 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 14 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 15 - Recursive Character Text Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 16 - Pinecone_ParseResult_Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Set_QA_for_Pinecone

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Embeddings OpenAI1

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 19 - EditFields_AddUserID_Metadata

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - AddUserID_Metadata_Reply

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 21 - Pinecone_Add_Answer

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1.3

Block 22 - GetFirstResult

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 23 - Check If Answer Exists

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 24 - Send Auto Answer

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Showing the first 24 of 44 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Telegram support bot with OpenAI, Pinecone and human expert escalation
Complexity advanced
Nodes 44
Categories Support Chatbot, AI RAG
Author Igor Chernyaev
Published 28 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11324/11324.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Telegram support bot with OpenAI, Pinecone and human expert escalation do?

Template name Smart AI Support Assistant for Telegram Short description Smart AI Support Assistant for Telegram automatically answers repeated questions in your group using a Q&A knowledge base in ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI RAG use case.