mirror of
https://github.com/nusquama/n8nworkflows.xyz.git
synced 2025-11-27 01:35:37 +08:00
creation
This commit is contained in:
@@ -0,0 +1,265 @@
|
||||
Real-time Forex Sentiment Analysis & Alerts with Gemini AI to Discord
|
||||
|
||||
https://n8nworkflows.xyz/workflows/real-time-forex-sentiment-analysis---alerts-with-gemini-ai-to-discord-5703
|
||||
|
||||
|
||||
# Real-time Forex Sentiment Analysis & Alerts with Gemini AI to Discord
|
||||
|
||||
### 1. Workflow Overview
|
||||
|
||||
This workflow enables **real-time Forex market sentiment analysis** by aggregating multiple Forex news RSS feeds, processing the combined data with Google Gemini AI for natural language analysis, and delivering actionable alerts to a Discord channel. The primary use case is to monitor Forex news sentiment on major currency pairs (specifically EUR/USD), generating insights and alerts for traders or analysts.
|
||||
|
||||
The workflow is logically divided into the following blocks:
|
||||
|
||||
- **1.1 Scheduled Data Collection:** Periodic triggering to fetch latest Forex news from multiple RSS feed sources.
|
||||
- **1.2 Data Aggregation:** Merging all RSS feed data streams into a single unified dataset.
|
||||
- **1.3 Date Filtering and Preprocessing:** Filtering the merged news data by date/time and applying further filtering logic.
|
||||
- **1.4 Sentiment Analysis via AI Agent:** Processing filtered news data with Google Gemini AI and a custom LangChain agent for Forex sentiment evaluation.
|
||||
- **1.5 Alert Dispatching:** Sending the sentiment analysis results as formatted messages to a Discord channel.
|
||||
|
||||
---
|
||||
|
||||
### 2. Block-by-Block Analysis
|
||||
|
||||
#### 2.1 Scheduled Data Collection
|
||||
|
||||
- **Overview:**
|
||||
This block triggers at scheduled intervals to fetch the latest Forex-related news from various RSS sources, covering technical, fundamental, and general Forex news.
|
||||
|
||||
- **Nodes Involved:**
|
||||
- Schedule Trigger
|
||||
- RSS Read - GOOGLE
|
||||
- RSS Read - fxstreet news
|
||||
- RSS Read - FXSTREET
|
||||
- RSS Read - DAILYFX technical
|
||||
- RSS Read - DAILYFX fundamental
|
||||
- RSS Read - DAILYFX forexnews
|
||||
- RSS Read - DAILYFX forex articles
|
||||
- RSS Read - FOREX LIVE technicals
|
||||
- RSS Read - FOREX LIVE central banks
|
||||
- RSS Read - FOREX LIVE forexorders
|
||||
|
||||
- **Node Details:**
|
||||
|
||||
- **Schedule Trigger**
|
||||
- Type: Schedule Trigger
|
||||
- Role: Initiates the workflow on a configured time interval (e.g., every hour or minute) to fetch fresh news.
|
||||
- Configuration: Default parameters (time interval not explicitly detailed in JSON).
|
||||
- Connections: Outputs to all RSS read nodes simultaneously.
|
||||
- Failures: Misconfiguration or network failure could cause no trigger.
|
||||
|
||||
- **RSS Read Nodes** (11 nodes named with various Forex news sources)
|
||||
- Type: RSS Feed Read
|
||||
- Role: Fetch latest RSS feed items from specified Forex news websites.
|
||||
- Configuration: Each node configured with a distinct RSS feed URL (URLs not shown in JSON but implied by node names).
|
||||
- Inputs: Triggered by Schedule Trigger.
|
||||
- Outputs: Each outputs latest news items to the Merge node.
|
||||
- Edge cases: RSS feed downtime, malformed feeds, or empty responses could cause missing data or errors.
|
||||
|
||||
#### 2.2 Data Aggregation
|
||||
|
||||
- **Overview:**
|
||||
This block merges all RSS feed data into a single dataset for unified analysis.
|
||||
|
||||
- **Nodes Involved:**
|
||||
- Merge
|
||||
|
||||
- **Node Details:**
|
||||
|
||||
- **Merge**
|
||||
- Type: Merge
|
||||
- Role: Combines multiple input streams from all RSS feed reads into one output stream.
|
||||
- Configuration: Default merge mode (likely ‘append’ or ‘wait for all’).
|
||||
- Inputs: All RSS Read nodes feed into this node (multiple inputs).
|
||||
- Outputs: Sends merged news items to the Date Filter node.
|
||||
- Edge cases: If one or more feeds fail or produce no data, merge must handle partial inputs gracefully.
|
||||
|
||||
#### 2.3 Date Filtering and Preprocessing
|
||||
|
||||
- **Overview:**
|
||||
Filters the merged news items based on date/time or other criteria to restrict the dataset to relevant recent news. Applies additional filtering logic before AI processing.
|
||||
|
||||
- **Nodes Involved:**
|
||||
- Date Filter
|
||||
- Filter1
|
||||
- Code
|
||||
|
||||
- **Node Details:**
|
||||
|
||||
- **Date Filter**
|
||||
- Type: Filter
|
||||
- Role: Removes news items not within a specified date/time range (e.g., today’s date or last hour).
|
||||
- Configuration: Date range criteria configured to keep only recent news.
|
||||
- Inputs: From Merge node.
|
||||
- Outputs: To Filter1 node.
|
||||
- Edge cases: Timezone mismatches or missing date fields in news items may cause incorrect filtering.
|
||||
|
||||
- **Filter1**
|
||||
- Type: Filter
|
||||
- Role: Applies additional filtering logic, possibly checking for keywords or sentiment relevance.
|
||||
- Configuration: Custom condition expressions or checks (not detailed).
|
||||
- Inputs: From Date Filter.
|
||||
- Outputs: To Code node.
|
||||
- Edge cases: Expression evaluation failures or unexpected data formats.
|
||||
|
||||
- **Code**
|
||||
- Type: Code (JavaScript)
|
||||
- Role: Custom preprocessing or transformation of filtered news data before AI analysis.
|
||||
- Configuration: Custom user code (not specified) to prepare data.
|
||||
- Inputs: From Filter1.
|
||||
- Outputs: To the EURUSD News and Sentiment Analyst node.
|
||||
- Edge cases: Script errors or unexpected data structures can cause failures.
|
||||
|
||||
#### 2.4 Sentiment Analysis via AI Agent
|
||||
|
||||
- **Overview:**
|
||||
This block processes the prepared news data through Google Gemini AI via a LangChain agent specialized for EURUSD Forex sentiment analysis.
|
||||
|
||||
- **Nodes Involved:**
|
||||
- Google Gemini Chat Model
|
||||
- EURUSD News and Sentiment Analyst
|
||||
|
||||
- **Node Details:**
|
||||
|
||||
- **Google Gemini Chat Model**
|
||||
- Type: LangChain AI Language Model (Google Gemini)
|
||||
- Role: Provides AI natural language processing capabilities for sentiment analysis.
|
||||
- Configuration: Uses Google Gemini AI credentials and model defaults.
|
||||
- Inputs: Connected as an AI language model resource to EURUSD News and Sentiment Analyst.
|
||||
- Outputs: Feeds processed AI model responses to the agent node.
|
||||
- Edge cases: Authentication errors, rate limits, or network issues with Google Gemini API.
|
||||
|
||||
- **EURUSD News and Sentiment Analyst**
|
||||
- Type: LangChain Agent
|
||||
- Role: Custom AI agent that analyzes Forex news sentiment specifically for EURUSD currency pair using data from the Code node and AI model.
|
||||
- Configuration: Custom prompt templates and agent logic (not detailed in JSON).
|
||||
- Inputs: Receives data from Code node and AI model responses from Google Gemini Chat Model.
|
||||
- Outputs: Provides sentiment analysis results to Discord node.
|
||||
- Edge cases: AI model output quality variability, timeout, or errors in prompt handling.
|
||||
|
||||
#### 2.5 Alert Dispatching
|
||||
|
||||
- **Overview:**
|
||||
Sends the AI-generated Forex sentiment analysis results as formatted messages to a Discord channel for real-time alerts.
|
||||
|
||||
- **Nodes Involved:**
|
||||
- Discord
|
||||
|
||||
- **Node Details:**
|
||||
|
||||
- **Discord**
|
||||
- Type: Discord Node
|
||||
- Role: Sends messages to a predefined Discord channel via webhook or bot.
|
||||
- Configuration: Uses existing Discord credentials and webhookId for message delivery.
|
||||
- Inputs: Receives messages from EURUSD News and Sentiment Analyst node.
|
||||
- Outputs: None (final node).
|
||||
- Edge cases: Discord API rate limits, webhook misconfiguration, or network errors.
|
||||
|
||||
---
|
||||
|
||||
### 3. Summary Table
|
||||
|
||||
| Node Name | Node Type | Functional Role | Input Node(s) | Output Node(s) | Sticky Note |
|
||||
|-----------------------------|--------------------------------------|---------------------------------------|-----------------------------------------------|-----------------------------------|-------------|
|
||||
| Schedule Trigger | Schedule Trigger | Initiates periodic workflow run | None | RSS Read - GOOGLE, RSS Read - fxstreet news, RSS Read - FXSTREET, RSS Read - DAILYFX technical, RSS Read - DAILYFX fundamental, RSS Read - DAILYFX forexnews, RSS Read - DAILYFX forex articles, RSS Read - FOREX LIVE technicals, RSS Read - FOREX LIVE central banks, RSS Read - FOREX LIVE forexorders | |
|
||||
| RSS Read - GOOGLE | RSS Feed Read | Fetches Forex news RSS feed | Schedule Trigger | Merge | |
|
||||
| RSS Read - fxstreet news | RSS Feed Read | Fetches Forex news RSS feed | Schedule Trigger | Merge | |
|
||||
| RSS Read - FXSTREET | RSS Feed Read | Fetches Forex news RSS feed | Schedule Trigger | Merge | |
|
||||
| RSS Read - DAILYFX technical | RSS Feed Read | Fetches Forex technical news | Schedule Trigger | Merge | |
|
||||
| RSS Read - DAILYFX fundamental | RSS Feed Read | Fetches Forex fundamental news | Schedule Trigger | Merge | |
|
||||
| RSS Read - DAILYFX forexnews | RSS Feed Read | Fetches Forex news | Schedule Trigger | Merge | |
|
||||
| RSS Read - DAILYFX forex articles | RSS Feed Read | Fetches Forex articles | Schedule Trigger | Merge | |
|
||||
| RSS Read - FOREX LIVE technicals | RSS Feed Read | Fetches Forex technicals news | Schedule Trigger | Merge | |
|
||||
| RSS Read - FOREX LIVE central banks | RSS Feed Read | Fetches Forex central banks news | Schedule Trigger | Merge | |
|
||||
| RSS Read - FOREX LIVE forexorders | RSS Feed Read | Fetches Forex order news | Schedule Trigger | Merge | |
|
||||
| Merge | Merge | Combines all RSS feed data | All RSS Read nodes | Date Filter | |
|
||||
| Date Filter | Filter | Filters news by date/time | Merge | Filter1 | |
|
||||
| Filter1 | Filter | Additional filtering | Date Filter | Code | |
|
||||
| Code | Code | Custom preprocessing | Filter1 | EURUSD News and Sentiment Analyst | |
|
||||
| Google Gemini Chat Model | LangChain AI Language Model | Provides AI processing | Connected as AI model to EURUSD News and Sentiment Analyst | EURUSD News and Sentiment Analyst | |
|
||||
| EURUSD News and Sentiment Analyst | LangChain Agent | AI agent analyzing Forex sentiment | Code, Google Gemini Chat Model | Discord | |
|
||||
| Discord | Discord | Sends alerts to Discord channel | EURUSD News and Sentiment Analyst | None | |
|
||||
| Sticky Note (multiple) | Sticky Note | Comments/notes | None | None | |
|
||||
|
||||
---
|
||||
|
||||
### 4. Reproducing the Workflow from Scratch
|
||||
|
||||
1. **Create Schedule Trigger Node**
|
||||
- Type: Schedule Trigger
|
||||
- Configure interval as desired (e.g., every 15 minutes or hourly).
|
||||
- This node will start the workflow.
|
||||
|
||||
2. **Create RSS Feed Read Nodes (11 total)**
|
||||
For each of the following:
|
||||
- RSS Read - GOOGLE
|
||||
- RSS Read - fxstreet news
|
||||
- RSS Read - FXSTREET
|
||||
- RSS Read - DAILYFX technical
|
||||
- RSS Read - DAILYFX fundamental
|
||||
- RSS Read - DAILYFX forexnews
|
||||
- RSS Read - DAILYFX forex articles
|
||||
- RSS Read - FOREX LIVE technicals
|
||||
- RSS Read - FOREX LIVE central banks
|
||||
- RSS Read - FOREX LIVE forexorders
|
||||
|
||||
- Type: RSS Feed Read
|
||||
- Configure each with the specific RSS feed URL for each source (URLs must be obtained externally).
|
||||
- Connect input from Schedule Trigger node.
|
||||
|
||||
3. **Create Merge Node**
|
||||
- Type: Merge
|
||||
- Connect all RSS Read nodes outputs to this Merge node’s inputs.
|
||||
- Use default settings to append or combine all incoming data.
|
||||
|
||||
4. **Create Date Filter Node**
|
||||
- Type: Filter
|
||||
- Configure filter to allow items within the desired date/time range (e.g., news from last hour or today).
|
||||
- Connect input from Merge node.
|
||||
|
||||
5. **Create Filter1 Node**
|
||||
- Type: Filter
|
||||
- Configure additional filtering criteria (e.g., keyword matching, language checks).
|
||||
- Connect input from Date Filter node.
|
||||
|
||||
6. **Create Code Node**
|
||||
- Type: Code (JavaScript)
|
||||
- Write custom script to preprocess or transform filtered news items. For example, consolidate content, remove duplicates, or format for AI input.
|
||||
- Connect input from Filter1 node.
|
||||
|
||||
7. **Set up Google Gemini Chat Model Node**
|
||||
- Type: LangChain AI Language Model (Google Gemini)
|
||||
- Configure with Google API credentials supporting Google Gemini AI.
|
||||
- No direct input connections; this node serves as an AI model resource for agents.
|
||||
|
||||
8. **Create EURUSD News and Sentiment Analyst Node**
|
||||
- Type: LangChain Agent
|
||||
- Configure with prompts and agent logic tailored for Forex sentiment analysis, focusing on EURUSD pair.
|
||||
- Connect input from Code node.
|
||||
- Link Google Gemini Chat Model node as the AI language model resource.
|
||||
- Output will be AI-generated sentiment results.
|
||||
|
||||
9. **Create Discord Node**
|
||||
- Type: Discord
|
||||
- Configure with Discord bot credentials or webhook URL for the target Discord channel.
|
||||
- Connect input from EURUSD News and Sentiment Analyst node.
|
||||
- This node sends the final alert messages.
|
||||
|
||||
10. **Test and Validate**
|
||||
- Run the workflow manually or wait for scheduled trigger.
|
||||
- Monitor logs for errors, ensure Discord messages are posted with correct sentiment analysis.
|
||||
|
||||
---
|
||||
|
||||
### 5. General Notes & Resources
|
||||
|
||||
| Note Content | Context or Link |
|
||||
|------------------------------------------------------------------------------------------------|------------------------------------------------|
|
||||
| The workflow leverages Google Gemini AI via LangChain integration for advanced NLP analysis. | Requires Google Cloud API access and credentials. |
|
||||
| Discord node uses webhookId for message delivery; ensure webhook is properly set up in Discord. | Discord Developer Portal and webhook setup. |
|
||||
| RSS feed URLs must be sourced and verified for availability and correctness. | Forex news websites (e.g., FXStreet, DAILYFX). |
|
||||
| AI agent prompt templates should be customized for Forex sentiment context for better accuracy. | LangChain agent customization documentation. |
|
||||
|
||||
---
|
||||
|
||||
**Disclaimer:** The provided text originates exclusively from an automated workflow created with n8n, an integration and automation tool. This processing strictly complies with current content policies and contains no illegal, offensive, or protected elements. All data processed is legal and publicly available.
|
||||
Reference in New Issue
Block a user