Run a Telegram RAG support chatbot with OpenAI, Pinecone, and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 20 nodes and runs on Telegram events (message). Along the way it connects Telegram, OpenAI and Google Sheets. It also calls api.openai.com over HTTP.
How it runs
Trigger: On Telegram events (message).
- 2. Code - Detect Message Type (Code): runs custom JavaScript code
- 3. Switch - Route by Message Type (Switch): routes items into 5 branches
- 13. Code - Build Query Text from Any Input (Code): runs custom JavaScript code
- 4. Telegram - Get Voice File URL (Telegram): work with file
- 7. Telegram - Get Photo File URL (Telegram): work with file
- 10. Telegram - Get Document File URL (Telegram): work with file
- 14. HTTP - OpenAI Embed Query (HTTP Request): calls api.openai.com (POST)
- 5. HTTP - Download Voice File (HTTP Request): calls an HTTP API
- 8. HTTP - Download Photo File (HTTP Request): calls an HTTP API
- 11. HTTP - Download Document File (HTTP Request): calls an HTTP API
…plus 9 more steps. See the full node list below.
Services it uses
HTTP calls to: api.openai.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (8)
- Telegram Trigger
n8n-nodes-base.telegramTrigger - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - Telegram
n8n-nodes-base.telegram - HTTP Request
n8n-nodes-base.httpRequest - OpenAI
@n8n/n8n-nodes-langchain.openAi - Extract from File
n8n-nodes-base.extractFromFile - Google Sheets
n8n-nodes-base.googleSheets
From the author
Quick overview This workflow turns a Telegram bot into a multi-modal support chatbot that accepts text, voice, images, and PDFs, converts them to text, retrieves relevant knowledge from Pinecone using OpenAI embeddings, generates a grounded answer with OpenAI…