πŸ“ˆ Analyze daily stock news sentiment with Gemini AI, Google Sheets and Gmail

⚑ 240 views Β· πŸ“ˆ Crypto Trading & Stock Market

Description

Stock News Sentiment Automation using Gemini AI, Google Sheets & Gmail

This workflow automatically fetches daily stock market news, analyzes sentiment using Gemini AI, calculates impact scores, sends alerts for high-impact news and stores structured results in Google Sheets.

Quick Implementation Steps

  1. Import the workflow into your n8n account
  2. Configure the Market News API (HTTP Request node)
  3. Add your Google Gemini API credentials
  4. Connect Google Sheets and create required columns
  5. Configure Gmail node (add recipient email)
  6. Activate the workflow

What It Does

This workflow runs every day at 8 AM and automatically collects the latest stock market news from a public API. It filters, cleans and processes the data to ensure only relevant and unique articles are analyzed.

Each news article is sent to Google Gemini AI, which classifies the sentiment as bullish, bearish or neutral, along with a confidence score and reasoning. The workflow then calculates an impact score based on sentiment and confidence.

High-impact news is immediately flagged and sent via email alerts, while all processed results are stored in a structured format in Google Sheets for tracking and analysis.

Who It’s For

Requirements

To use this workflow, you need:

How It Works & Setup Guide

1. Trigger Setup

2. Fetch Market News

https://api.tradient.org/v1/api/market/news

3. Select & Limit News

data.latest_news

You can change this limit in:

return output.slice(0, 2);

4. Normalize Data

5. Remove Duplicate News

6. Process One-by-One

7. Rate Limiting

8. Generate AI Prompt

9. AI Sentiment Analysis

10. Parse AI Response

11. Calculate Impact Score

Formula logic:

12. High Impact Filter

13. Email Alert Setup

You MUST configure:

Example message:

Stock: XYZ
Title: News title
Sentiment: bullish
Impact: 75
Reason: Strong earnings report

14. Google Sheets Setup

Create a sheet with EXACT column names:

Title
Stock
Sentiment
Reason

Important:

How To Customize Nodes

Change Number of News Articles

Modify:

return output.slice(0, 2);

Adjust Impact Threshold

In IF node:

Modify AI Prompt

Edit Generate Sentiment Prompt node to:

Add More Sheet Columns

Update Google Sheets node mapping:

Add-ons (Enhancements)

Use Case Examples

  1. Daily Trading Signals

    • Identify high-impact bullish/bearish news instantly
  2. Portfolio Monitoring

    • Track sentiment around owned stocks
  3. Market Intelligence Systems

    • Build automated research dashboards
  4. Algo Trading Input

    • Feed sentiment into trading algorithms
  5. Financial News Aggregators

    • Classify and rank news automatically

And many more custom use cases depending on your strategy.

Troubleshooting Guide

IssuePossible CauseSolution
No data in Google SheetsIncorrect column namesEnsure exact match: Title, Stock, Sentiment, Reason
Emails not sendingGmail not configuredAdd credentials + recipient email
AI response parsing errorInvalid JSON from GeminiCheck Parse node logs
Duplicate news still appearingTitle mismatchImprove deduplication logic
Workflow not triggeringSchedule inactiveActivate workflow
API returns empty dataAPI downtimeTest endpoint manually

Need Help?

If you need help with:

Reach out to our n8n workflow development experts at WeblineIndia for advanced assistance.

We can help you build production-grade automation tailored to your business needs.

πŸ”— Nodes Used

Google Sheets, HTTP Request, Gmail, Schedule Trigger, Google Gemini

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup