Skip to main content

Real-time stock insights using xAI

Workflow preview

Workflow preview
100%
Real-time stock insights using xAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who is this for? This n8n workflow is designed for investors, financial analysts, automated trading system developers, and finance enthusiasts who require daily, comprehensive, data driven insights...

Best for

  • Crypto Trading automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.code, n8n-nodes-base.set, n8n-nodes-base.telegram, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.lmchatanthropic, @n8n/n8n-nodes-langchain.chainllm

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by DevCode Journey.

Original n8n.io source

1.1 Workflow description

Title
Real-time stock insights using xAI
Workflow name
Real-time stock insights using xAI

Who is this for?

This n8n workflow is designed for investors, financial analysts, automated trading system developers, and finance enthusiasts who require daily, comprehensive, data-driven insights into specific stock symbols. It's perfect for users who need to automate the complex process of combining technical indicators, news sentiment, professional analyst ratings, and social media buzz into a single, actionable recommendation. This system provides a 24/7 automated "analyst" for portfolio monitoring.

What this Workflow Does

This n8n workflow executes a daily, multi-faceted analysis of a target stock. It starts by gathering all relevant data (price history, news, ratings, social posts) and processes it through specialized Code nodes to calculate technical indicators (SMA, RSI), determine price predictions (Linear Regression), and perform sentiment analysis on news and social media. Finally, it uses a weighted model to synthesize all data into a single, comprehensive Buy/Sell/Hold recommendation and delivers a detailed report via Telegram.

Key Features

  • Daily Scheduling: Automatically triggers analysis every day at a specified time (e.g., 9:00 AM).
  • Multi-Factor Analysis: Combines four key domains for a holistic view: Technical, Prediction, News Sentiment, Analyst Ratings, and Social Sentiment.
  • Technical Indicator Calculation: Calculates SMA (20, 50, 200), RSI (14-day), and identifies Support/Resistance levels.
  • Price Prediction: Uses Simple Linear Regression to forecast a 7-day price trend and generate an initial recommendation.
  • Sentiment Analysis: Custom Code nodes perform keyword-based sentiment analysis on news articles and social media posts.
  • Composite Recommendation: A weighted model combines all analysis scores (35% Technical, 25% News, 25% Analyst, 15% Social) to generate a final recommendation, confidence score, and summary.
  • Automated Alerting: Delivers a fully formatted, easily readable Markdown report via Telegram.

Requirements

  • API Configuration Node: A preliminary node (implied by the expression references) containing:
    • Target stockSymbols (e.g., TSLA, AAPL).
    • telegramChatId for receiving the report.
    • API Keys for data sources (e.g., a Financial Data API for price/news/ratings, a Social Media API).
  • Telegram Credentials: For the Telegram node to send the final message.
  • Financial Data Source Workflow: Requires preceding nodes (not fully visible) to fetch:
    • Historical price data (required for SMA/RSI/Regression).
    • Recent news headlines and summaries.
    • Recent analyst ratings.
    • Social media data (e.g., from Twitter/StockTwits).
  • n8n Instance: Self-hosted or cloud-based n8n installation.

How to Use

Step-by-Step Setup

1. Configure Scheduling
  • Open the "Daily Stock Check" node.
  • Set the interval rule to the precise hour you want the report to run (e.g., 9:00 AM).
2. Configure Stock Symbol and Telegram
  • In the (implied) "API Configuration" node, set the stockSymbols you wish to track.
  • Set the target telegramChatId where the report will be delivered.
  • Ensure your Telegram credentials are set up in n8n.
3. Verify Data Fetching Nodes
  • Ensure the nodes feeding data into "Analyze Stock Trends," "Analyze News Sentiment," "Process Analyst Ratings," and "Analyze Social Sentiment" are correctly configured to fetch the required historical price, news, ratings, and social data.
4. Adjust Analysis Weights (Advanced)
  • If you wish to change the importance of different factors, edit the WEIGHTS object inside the "Generate Comprehensive Recommendation" Code node.
    • Default Weights: Technical (0.35), News (0.25), Analyst (0.25), Social (0.15).
5. Test the Workflow
  • Manually execute the workflow to ensure all Code nodes process the incoming data correctly and the "Send Telegram Alert" successfully delivers the final, formatted message.

Workflow Components

The workflow is structured into three main phases: Data Processing, Recommendation Synthesis, and Reporting.

1. Data Processing and Indicator Calculation

Node Name Type Key Functionality
Daily Stock Check Schedule Trigger Initiates the entire workflow daily at the set time.
Analyze Stock Trends Code Calculates Technical Indicators: SMA (20, 50, 200), RSI (14-day), Volume Trend, and Support/Resistance levels.
Predict Future Trends Code Performs Simple Linear Regression on historical prices to determine slope and predict the price 7 days ahead.
Analyze News Sentiment Code Performs keyword-based sentiment analysis on news headlines and summaries to categorize overall sentiment (positive/negative/neutral) and assign a score.
Process Analyst Ratings Code Aggregates analyst recommendations (Buy/Hold/Sell) to calculate consensus rating and average price target.
Analyze Social Sentiment Code Performs keyword-based sentiment analysis on social media data to determine community mood and trending hashtags.

2. Recommendation Synthesis

Node Name Type Description
Combine All Analysis Merge Consolidates the outputs from the four analysis branches (Technical, News, Analyst, Social) into a single data item.
Generate Comprehensive Recommendation Code The core logic. Calculates a weighted composite score (from -100 to 100) based on all four inputs, generating the final STRONG BUY/BUY/HOLD/SELL/STRONG SELL recommendation and a numerical confidence score.

3. Reporting and Alerting

Node Name Type Description
Format Telegram Message Set Constructs the final detailed report message using Markdown formatting, pulling data from all preceding analysis nodes into a clear, structured report.
Send Telegram Alert Telegram Sends the fully formatted analysis report to the pre-configured Telegram chat ID.

πŸ™‹ For Help & Community

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Daily Stock Check

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Analyze Stock Trends

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Predict Future Trends

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Format Telegram Message

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Send Telegram Alert

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 6 - Analyze News Sentiment

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Process Analyst Ratings

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Analyze Social Sentiment

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Combine All Analysis

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 10 - Generate Comprehensive Recommendation

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - OpenAI GPT Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 12 - Anthropic Claude Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatAnthropic - lmChatAnthropic
Config choices
Version 1.3

Block 13 - Prepare AI Validation Input

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Combine AI Validations

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 15 - Evaluate AI Consensus

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - AI Validator 1 - OpenAI

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Block 17 - AI Validator 2 - Anthropic

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Block 18 - AI Validator 3 - Gemini

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Block 19 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - API Configuration

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 23 - Stock Data Fatch

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 24 - News Sentiment Fatch

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Showing the first 24 of 27 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Real-time stock insights using xAI
Complexity advanced
Nodes 27
Categories Crypto Trading, AI Summarization
Author DevCode Journey
Published 08 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10615/10615.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Real-time stock insights using xAI do?

Who is this for? This n8n workflow is designed for investors, financial analysts, automated trading system developers, and finance enthusiasts who require daily, comprehensive, data driven insights...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Crypto Trading, AI Summarization use case.