Summarize Telegram-shared webpages with OpenAI GPT-4o
Ready for 3.0What this workflow does
This AI workflow has 13 nodes and runs on Telegram events (message). Along the way it connects Telegram and OpenAI Chat Model.
How it runs
Trigger: On Telegram events (message).
- Configuration (Edit Fields (Set)): sets 3 fields: openai_model, max_page_size, include_raw_url_in_prompt
- Extract URL (Code): runs custom JavaScript code
- URL Valid? (If): checks a condition and branches into true / false
- Fetch Webpage (HTTP Request): calls an HTTP API
- Send Invalid URL Error (Telegram): uses Telegram
- Extract Page Content (HTML): parses or builds HTML
- Prepare Summary Input (Edit Fields (Set)): sets 3 fields: page_title, page_text, source_url
- Summarize Page (AI Agent): runs an AI agent, with model: OpenAI Model; output parser: Summary Output Parser
- Format Summary (Edit Fields (Set)): sets 1 field: telegram_text
- Send Summary to Telegram (Telegram): uses Telegram
Services it uses
Scraping pages by hand? Firecrawl is a simpler option (10% off for new users).
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 (10)
- Telegram Trigger
n8n-nodes-base.telegramTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - HTML
n8n-nodes-base.html - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Telegram
n8n-nodes-base.telegram
From the author
Quick overview This workflow listens for Telegram messages containing a URL, fetches and cleans the webpage content, summarizes it with an OpenAI chat model, and replies in the same Telegram chat with a formatted summary including key points and action items.…