Opening Problem Statement
Meet Jane, a crypto trader who spends countless hours every day scouring various news websites to catch up on the latest developments in the cryptocurrency market. She tracks news from Cointelegraph, Bitcoin Magazine, Coindesk, and several other sources. The sheer volume of articles floods her inbox and web tabs, making it difficult to filter relevant news about her favorite coins like Bitcoin or Ethereum. Jane often misses critical updates or wastes precious time trying to synthesize market sentiment from disparate articles. This inefficiency leads to missed trading opportunities and stress caused by information overload.
Jane’s specific pain is the overwhelming manual research process for crypto news aggregation, filtering based on relevant keywords, sentiment analysis, and summarization to make quick, informed decisions. Every missed detail can cost money, and the time lost adds up quickly.
What This Automation Does
This n8n workflow is designed to automate the collection, filtering, and summarization of cryptocurrency news, then deliver a clear market sentiment report directly to a Telegram bot user. When a user sends the name of a cryptocurrency or company to the Telegram bot, the automation:
- Pulls fresh articles from 10 major crypto news RSS feeds including Cointelegraph, Bitcoin Magazine, Coindesk, and others.
- Merges and consolidates all news articles into a single stream.
- Uses an AI-powered agent to extract a single keyword from the user’s query for precise filtering.
- Filters merged articles to only those relevant to the extracted keyword.
- Constructs a detailed AI prompt listing filtered news articles.
- Leverages OpenAI GPT-4o to summarize the current news and analyze overall market sentiment around that keyword.
- Formats the AI-generated summary into a Telegram message and sends it to the user’s chat.
This saves users like Jane hours each day, reduces information overload, and provides actionable insights into crypto market sentiment.
Prerequisites ⚙️
- n8n account to build and run the workflow (self-hosting is possible for enterprise control).
- Telegram Bot account with bot token set up via @BotFather 📱.
- OpenAI account with API access for GPT-4o AI models 🔐.
- Access to public RSS feeds for crypto news sources (included in the workflow). 📊
Step-by-Step Guide
Step 1: Create Your Telegram Bot and Get Credentials
Open Telegram and chat with @BotFather. Use /newbot command to create a new bot and get the bot token. In n8n, navigate to Credentials > Create new > Telegram API, and paste your bot token. You should see a confirmation the credentials were saved. Common mistake: Using the wrong token or forgetting to save.
Step 2: Add OpenAI Credentials
Sign up at OpenAI, get your API key for GPT-4o. In n8n, go to Credentials > Create new > OpenAI and enter your API key. Confirm connection. Mistake: Mixing up API keys or using expired keys.
Step 3: Setup Telegram Trigger Node
Add a Telegram Trigger node titled Send Crypto or Company Name for Analysis. Configure it to listen for incoming messages (updates: message). Connect it to the next node that extracts session ID. Visual check: When you send your first message to the bot, the node receives the update. Mistake: Not linking Telegram credentials properly.
Step 4: Store User Chat ID
Use a Set node named Adds the sessionId to extract the chat ID from the Telegram message ($json.message.chat.id) and assign it to a new field sessionId. This allows later nodes to know which user to reply to. Mistake: Incorrect field mapping.
Step 5: Extract Keyword Using AI Agent
Use the Crypto News & Sentiment Agent node (LangChain agent) that takes the user’s message text and returns a single-word keyword for filtering news. This improves relevance by avoiding random matches. Mistake: Forgetting to set the correct input text expression.
Step 6: Aggregate News from Multiple RSS Sources
Configure multiple RSS Feed Read nodes each with URLs for major crypto news sites, for example, Cointelegraph, Bitcoin Magazine, Coindesk, Bitcoinist, NewsBTC, Cryptopotato, 99Bitcoins, Cryptobriefing, and Crypto.news. These nodes run in parallel to pull fresh news articles. Mistake: Using outdated or broken RSS URLs.
Step 7: Merge All Articles
Use the Merge node called Merge All Articles to combine all fetched news articles into a single big list to process together. You should see a consolidated list of items after this step. Mistake: Wrong merge mode or missing input connections.
Step 8: Filter Articles by Extracted Keyword
Insert a Code node Filter by Query with JavaScript code that filters the merged news items by searching the keyword (from Set Query) in the article title, snippet, or full content. This narrows down articles to only those relevant to the user’s query. Mistake: Case sensitivity or referencing incorrect nodes.
const term = $node["Set Query"].json.query.toLowerCase();
return items.filter(item => {
const j = item.json;
const title = (j.title || "").toLowerCase();
const snippet = (j.contentSnippet || j.description || "").toLowerCase();
const fullContent = (j.content || "").toLowerCase();
return title.includes(term)
|| snippet.includes(term)
|| fullContent.includes(term);
});
Step 9: Build AI Prompt for News Summarization
Add a Code node Build Prompt which creates a formatted prompt listing the filtered article titles and links, asking GPT-4o to summarize news and market sentiment in three clear parts. Mistake: Incorrect string templates or missing fields.
const q = $node["Set Query"].json.query;
const list = items
.map(i => `- ${i.json.title} (${i.json.link})`)
.join("n");
const prompt = `
You are a crypto-industry news analyst.
Summarize current news and market sentiment for **${q}** based on these articles:
${list}
Answer in 3 parts:
1. Summary of News
2. Market Sentiment
3. Links to reference news articles
`;
return [{ json: { prompt } }];
Step 10: Summarize News & Market Sentiment Using GPT-4o
Send the built prompt to the Summarize News & Sentiment (GPT-4o) node, an OpenAI node configured to use GPT-4o. It analyzes the prompt and returns a concise summary and sentiment analysis to guide users on market mood. Mistake: Incorrect model selection or message structure.
Step 11: Format Telegram Message
A Set node called Prepare Telegram Message picks up the AI summary from the previous step and assigns it to the summary field for sending by Telegram. Mistake: Wrong JSON path leads to empty messages.
Step 12: Send Response to User on Telegram
Finally, the Telegram node Sends Response delivers the summarized news and sentiment back to the original user chat through your Telegram bot. Remember to dynamically set the chatId to send it properly by using stored sessionId or actual chat ID. Mistake: Hardcoded chatId without dynamic binding.
Customizations ✏️
- Add More RSS Feeds: Add new RSS Feed Read nodes with URLs of your preferred crypto news sites. Connect their outputs to the Merge All Articles node to broaden coverage.
- Modify AI Model or Prompt: Change the OpenAI model in the Summarize News & Sentiment (GPT-4o) node to newer versions or modify the system message for different analysis tones.
- Change Telegram Message Format: In the Prepare Telegram Message node, customize the output string to add emojis or extra data like timestamps or price alerts.
- Keyword Extraction Logic: Adjust the Crypto News & Sentiment Agent prompt or replace it with a custom function node if you want different keyword extraction behavior.
- Set Dynamic Chat ID: To fully personalize messages, bind the
chatIdin the Sends Response node dynamically using the sessionId field instead of hardcoded ID.
Troubleshooting 🔧
Problem: Telegram node doesn’t send messages.
Cause: Incorrect chatId or missing Telegram bot permissions.
Solution: Verify the chatId is set dynamically from the stored sessionId field and enable Privacy mode off in @BotFather.
Problem: No relevant news articles found after filtering.
Cause: Keyword extraction output doesn’t match article content.
Solution: Check if the Crypto News & Sentiment Agent returns the right keyword and adjust the Code filter’s case sensitivity or the prompt configuration.
Problem: OpenAI API errors.
Cause: Invalid API key or exceeding usage limits.
Solution: Verify API key and monitor usage quotas in your OpenAI dashboard.
Pre-Production Checklist ✅
- Test Telegram bot by sending sample crypto names like “Bitcoin” or “Ethereum” and verify responses.
- Check if all RSS feeds return fresh article data using their nodes individually.
- Ensure the Crypto News & Sentiment Agent outputs clear single-word keywords as expected.
- Run the filtering code node manually with sample data to confirm filtering correctness.
- Make sure OpenAI credentials are working by testing the summarization node in isolation.
- Backup your workflow JSON before major changes for easy rollback.
Deployment Guide
Once tested, activate your workflow by switching it from inactive to active in n8n. Make sure your webhook URL for Telegram trigger is accessible from outside (proper internet exposure or tunneling). Monitor execution via the n8n dashboard to catch any errors in real-time and review logs. Set alerts in n8n or Telegram for critical failures if needed.
FAQs
Q1: Can I use another AI model instead of GPT-4o?
Yes, you can switch models in the summarization node, but ensure the prompt remains compatible with the model capabilities.
Q2: Does this workflow consume a lot of OpenAI credits?
Summarization uses GPT-4o on batched news, so it’s a moderately intensive use case. Monitor usage and optimize prompt length to manage costs.
Q3: Is my news data stored externally?
No, all data processing happens within your n8n workflow and API calls. Only public RSS URLs and AI calls are made.
Q4: Can this handle multiple users simultaneously?
Yes, sessionId handling and Telegram trigger support multiple concurrent chats.
Conclusion
By following this guide, you have built a powerful n8n automation that transforms scattered cryptocurrency news from multiple sources into crisp summaries and sentiment insights delivered instantly via Telegram. This not only saves hours of manual research but also empowers quicker, smarter crypto trading or investment decisions. You’ve effectively automated the entire chain from data gathering to AI analysis to message dispatch.
Next, consider expanding with price alert integrations, deeper sentiment analytics across social media, or multi-language support for international crypto communities. Keep refining and innovating to stay ahead in the fast-moving crypto markets!