diff --git a/workflows/Daily AI News Summaries with Gemini 2.5 Flash to Telegram-6095/readme-6095.md b/workflows/Daily AI News Summaries with Gemini 2.5 Flash to Telegram-6095/readme-6095.md new file mode 100644 index 000000000..c06de35ef --- /dev/null +++ b/workflows/Daily AI News Summaries with Gemini 2.5 Flash to Telegram-6095/readme-6095.md @@ -0,0 +1,222 @@ +Daily AI News Summaries with Gemini 2.5 Flash to Telegram + +https://n8nworkflows.xyz/workflows/daily-ai-news-summaries-with-gemini-2-5-flash-to-telegram-6095 + + +# Daily AI News Summaries with Gemini 2.5 Flash to Telegram + +--- + +### 1. Workflow Overview + +This workflow automates the daily curation and delivery of AI technology news summaries by integrating real-time news scraping, AI-based analysis, and messaging. It is designed to: + +- Continuously monitor and fetch new AI news articles from a specified RSS feed. +- Extract full article content using AI-powered scraping. +- Use Google’s Gemini 2.5 language model (via Langchain integration) to synthesize and generate a concise, well-structured daily briefing. +- Format the briefing for Telegram-compatible HTML and deliver it as a message to a designated Telegram chat. + +**Target Use Cases:** + +- Automated daily briefings for AI researchers, analysts, or enthusiasts. +- Centralized digest of news from multiple AI news sources. +- Integration into team communication platforms for up-to-date information sharing. + +**Logical Blocks:** + +- **1.1 Input Reception:** Trigger and fetch new articles from the AI-News RSS feed. +- **1.2 Content Extraction:** Retrieve full article content from each news link using Jina AI. +- **1.3 AI Processing & Report Generation:** Use Gemini 2.5 LLM with a custom prompt to analyze and generate a structured news summary. +- **1.4 Delivery:** Send the formatted briefing as a Telegram message. + +--- + +### 2. Block-by-Block Analysis + +#### 1.1 Input Reception + +- **Overview:** + This block initiates the workflow by polling the AI-News RSS feed every minute to detect new articles. It outputs metadata including article titles and links. + +- **Nodes Involved:** + - AI-News Feed (RSS Feed Read Trigger) + +- **Node Details:** + + - **AI-News Feed** + - Type: RSS Feed Read Trigger + - Role: Polls the RSS feed at `https://www.artificialintelligence-news.com/feed/` every minute for new items. + - Configuration: Poll mode set to every minute; no filters applied. + - Inputs: None (trigger node) + - Outputs: Emits new article metadata (title, link, publication date, etc.) + - Version Requirements: Standard RSS trigger, no special version dependencies. + - Potential Failures: Network errors, invalid feed URL, feed downtime. + - Sticky Note: Describes this as the workflow start, triggering automatically every minute. + +#### 1.2 Content Extraction + +- **Overview:** + Processes each new article link from the RSS feed to fetch full article content using Jina AI’s scraping capabilities. + +- **Nodes Involved:** + - Read News from AI News Website + +- **Node Details:** + + - **Read News from AI News Website** + - Type: Jina AI Node + - Role: Scrapes or retrieves the full textual content of the article from the provided URL. + - Configuration: Uses the `link` field from the RSS feed as input URL; no additional options set. + - Inputs: Receives article metadata including the link from AI-News Feed node. + - Outputs: Article full content, cleaned and ready for analysis. + - Credentials: Requires Jina AI API credentials. + - Potential Failures: Link unreachable, content extraction failure, API rate limits or timeouts. + - Sticky Note: Explains it scrapes full article text using Jina AI. + +#### 1.3 AI Processing & Report Generation + +- **Overview:** + Synthesizes the scraped news articles into a concise, insightful report using the Gemini 2.5 language model via Langchain. The prompt instructs the AI to focus on key news, themes, and formatting compatible with Telegram HTML. + +- **Nodes Involved:** + - Gemini 2.5 Flash + - Generate Report + +- **Node Details:** + + - **Gemini 2.5 Flash** + - Type: Langchain Google Gemini Chat Node (lmChatGoogleGemini) + - Role: Provides AI language model capabilities to process input data and generate text. + - Configuration: Default options; references Google Gemini API credentials for authentication. + - Inputs: Receives prompt and input data from Generate Report node as an AI language model input. + - Outputs: AI-generated text (structured briefing). + - Credentials: Google Palm API credentials required for Gemini access. + - Potential Failures: API quota exceeded, authentication errors, network issues, model timeouts. + + - **Generate Report** + - Type: Langchain Chain LLM Node + - Role: Constructs a detailed prompt embedding scraped article content from two sources, instructing the Gemini model to produce a structured daily intelligence briefing with specific formatting rules for Telegram. + - Configuration: + - The prompt includes placeholders for article title, content, and publish date. + - Output restricted to a subset of HTML tags supported by Telegram (, , , , ,
, ), with lists formed by hyphenated lines.  
+      - The current date is dynamically inserted in British English format.  
+    - Inputs: Receives article content from “Read News from AI News Website” and AI model output from Gemini 2.5 Flash.  
+    - Outputs: Final formatted briefing text for Telegram.  
+    - Version: Version 1.7 of the Langchain Chain LLM node.  
+    - Potential Failures: Expression evaluation errors, prompt formatting issues, incomplete input data, model response inconsistencies.  
+    - Sticky Note: Described as the “brain” of the workflow that uses Gemini to generate the report.
+
+#### 1.4 Delivery
+
+- **Overview:**  
+  Sends the final AI-generated news briefing as an HTML-formatted message to a predefined Telegram chat.
+
+- **Nodes Involved:**  
+  - Send a text message
+
+- **Node Details:**
+
+  - **Send a text message**  
+    - Type: Telegram Node  
+    - Role: Sends a text message to a Telegram chat via bot API.  
+    - Configuration:  
+      - Message text set dynamically from the AI-generated report (`={{ $json.text }}`).  
+      - Chat ID set as `CHAT_ID` (to be replaced with actual destination chat).  
+      - Parse mode set to HTML to enable formatted output.  
+    - Inputs: Receives the final text from the Generate Report node.  
+    - Credentials: Requires Telegram API credentials (bot token).  
+    - Potential Failures: Invalid chat ID, bot permissions missing, network errors, message size limits.  
+    - Sticky Note: Final step delivering the briefing to Telegram.
+
+---
+
+### 3. Summary Table
+
+| Node Name                     | Node Type                         | Functional Role                          | Input Node(s)               | Output Node(s)           | Sticky Note                                                                                 |
+|-------------------------------|----------------------------------|----------------------------------------|-----------------------------|--------------------------|---------------------------------------------------------------------------------------------|
+| AI-News Feed                  | RSS Feed Read Trigger             | Triggers on new AI-News RSS articles   | None                        | Read News from AI News Website | Starting point; triggers every minute; fetches new articles from RSS feed.                 |
+| Read News from AI News Website| Jina AI Node                     | Extracts full article content           | AI-News Feed                | Generate Report           | Scrapes full article content using Jina AI from article link.                              |
+| Gemini 2.5 Flash              | Langchain Google Gemini Chat Node| Provides AI model processing             | Generate Report (ai_languageModel input) | Generate Report (ai_languageModel output) | Uses Gemini 2.5 LLM for text generation; requires Google Palm API credentials.             |
+| Generate Report               | Langchain Chain LLM Node          | Creates structured AI news summary      | Read News from AI News Website, Gemini 2.5 Flash  | Send a text message      | “Brain” node generating final formatted report; uses prompt with Telegram HTML formatting.|
+| Send a text message           | Telegram Node                    | Delivers report to Telegram chat        | Generate Report             | None                     | Sends AI-generated briefing to Telegram chat with HTML parse mode enabled.                 |
+| Sticky Note                  | Sticky Note                      | Documentation and explanations           | None                        | None                     | Various sticky notes describe each major block and nodes in detail.                        |
+
+---
+
+### 4. Reproducing the Workflow from Scratch
+
+1. **Create the RSS Feed Trigger Node:**  
+   - Add a node of type **RSS Feed Read Trigger**.  
+   - Configure the feed URL as: `https://www.artificialintelligence-news.com/feed/`.  
+   - Set polling to occur **every minute**.  
+   - Name this node: `AI-News Feed`.
+
+2. **Add Jina AI Node for Article Content Extraction:**  
+   - Add a node of type **Jina AI**.  
+   - Set the **URL** parameter to: `={{ $json.link }}` to dynamically use the article link from RSS feed.  
+   - Leave other options default.  
+   - Connect the output of `AI-News Feed` to this node’s input.  
+   - Provide **Jina AI API Credentials** under the node’s credentials section.  
+   - Name this node: `Read News from AI News Website`.
+
+3. **Set up Gemini 2.5 Flash Node (Google Gemini LLM):**  
+   - Add a node of type **Langchain Google Gemini Chat Node** (`lmChatGoogleGemini`).  
+   - No special parameters needed under options.  
+   - Assign valid **Google Palm API Credentials** to enable Gemini access.  
+   - Name this node: `Gemini 2.5 Flash`.
+
+4. **Add Langchain Chain LLM Node for Report Generation:**  
+   - Add a node of type **Langchain Chain LLM**.  
+   - Configure the prompt to include:  
+     - Instruction as an expert AI analyst synthesizing two news sources.  
+     - Input template embedding scraped article fields: `title`, `content`, `publishedTime`.  
+     - Required output format restricting to Telegram-supported HTML tags only: `, , , , , 
, `.  
+     - Use hyphen-prefixed lines for lists instead of `