Skip to main content

Analyze daily stock news sentiment with Gemini AI, Google Sheets and Gmail

Workflow preview

Workflow preview
100%
Analyze daily stock news sentiment with Gemini AI, Google Sheets and Gmail preview
Open on n8n.io

1. Workflow Overview

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, sen...

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.httprequest, n8n-nodes-base.splitinbatches, n8n-nodes-base.wait, n8n-nodes-base.stickynote, n8n-nodes-base.code, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.googlegemini

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Analyze daily stock news sentiment with Gemini AI, Google Sheets and Gmail
Workflow name
Analyze daily stock news sentiment with Gemini AI, Google Sheets and Gmail

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

  • Stock traders and investors
  • Financial analysts
  • Algo trading developers
  • FinTech startups
  • Anyone tracking market sentiment automatically

Requirements

To use this workflow, you need:

  • n8n account (cloud or self-hosted)
  • Public Market News API (already used in workflow)
  • Google Gemini API credentials
  • Google Sheets account
  • Gmail account for sending alerts

How It Works & Setup Guide

1. Trigger Setup

  • The workflow starts using Schedule Trigger
  • Runs daily at 8 AM

2. Fetch Market News

  • HTTP Request node calls:
https://api.tradient.org/v1/api/market/news
  • No authentication required (public API)

3. Select & Limit News

  • Code node extracts:
data.latest_news
  • Limits to top 2 articles

You can change this limit in:

return output.slice(0, 2);

4. Normalize Data

  • Ensures consistent fields:
  • news_object.title
  • news_object.text
  • stock_name

5. Remove Duplicate News

  • Deduplicates using title
  • Prevents repeated analysis

6. Process One-by-One

  • Uses SplitInBatches
  • Ensures controlled processing

7. Rate Limiting

  • Wait node prevents API overuse
  • Avoids hitting Gemini limits

8. Generate AI Prompt

  • Creates structured prompt like:
  • Title
  • Content
  • Expected JSON output

9. AI Sentiment Analysis

  • Uses Gemini model:
models/gemini-3.1-flash-lite-preview
  • Returns:
  • Sentiment
  • Confidence
  • Reason

10. Parse AI Response

  • Removes markdown formatting
  • Converts response into valid JSON
  • Handles errors safely

11. Calculate Impact Score

Formula logic:

  • Bullish → confidence × 1.2
  • Bearish → confidence × -1.2
  • Neutral → confidence × 0.3

12. High Impact Filter

  • Conditions:
  • Impact > 60
  • Impact < -60

13. Email Alert Setup

You MUST configure:

  • Recipient email in Gmail node (sendTo)

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:

  • Column names must match exactly (case-sensitive)
  • Do NOT rename fields
  • Sheet must be connected in the node

How To Customize Nodes

Change Number of News Articles

Modify:

return output.slice(0, 2);

Adjust Impact Threshold

In IF node:

  • Change:
  • &gt; 60
  • &lt; -60

Modify AI Prompt

Edit Generate Sentiment Prompt node to:

  • Add more context
  • Include additional fields

Add More Sheet Columns

Update Google Sheets node mapping:

  • Add new fields like:
  • confidence
  • impact_score

Add-ons (Enhancements)

  • Slack/Telegram alerts instead of Gmail
  • Dashboard (Power BI / Looker Studio)
  • Store historical trends in database
  • Add stock price correlation
  • Multi-language news analysis
  • Increase batch size with queue system

Use Case Examples

  1. Daily Trading Signals
  • Identify high-impact bullish/bearish news instantly
  1. Portfolio Monitoring
  • Track sentiment around owned stocks
  1. Market Intelligence Systems
  • Build automated research dashboards
  1. Algo Trading Input
  • Feed sentiment into trading algorithms
  1. Financial News Aggregators
  • Classify and rank news automatically

And many more custom use cases depending on your strategy.

Troubleshooting Guide

Issue Possible Cause Solution
No data in Google Sheets Incorrect column names Ensure exact match: Title, Stock, Sentiment, Reason
Emails not sending Gmail not configured Add credentials + recipient email
AI response parsing error Invalid JSON from Gemini Check Parse node logs
Duplicate news still appearing Title mismatch Improve deduplication logic
Workflow not triggering Schedule inactive Activate workflow
API returns empty data API downtime Test endpoint manually

Need Help?

If you need help with:

  • Setting up this workflow
  • Customizing AI prompts
  • Adding dashboards or alerts
  • Scaling automation systems
  • Building advanced trading workflows

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.

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 8AM News Trigger

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

Block 2 - Fetch Market News API

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

Block 3 - Process News One-by-One

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 4 - Throttle / Rate Limit

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 5 - Sticky Note

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

Block 6 - Select Top News Articles

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

Block 7 - Normalize News Fields

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

Block 8 - Remove Duplicate News

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

Block 9 - Generate Sentiment Prompt

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

Block 10 - AI Sentiment Analysis

Type / Role
@n8n/n8n-nodes-langchain.googleGemini - googleGemini
Config choices
Version 1.1

Block 11 - Parse AI JSON Response

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

Block 12 - Calculate Impact Score

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

Block 13 - Check High Impact News

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 14 - Send Email Alert

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 15 - Store Results in Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 16 - Sticky Note1

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

Block 17 - Sticky Note2

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

Block 18 - Sticky Note3

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

Block 19 - Sticky Note4

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

Block 20 - Sticky Note5

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

Block 21 - Sticky Note6

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

3. Summary Table

Workflow Analyze daily stock news sentiment with Gemini AI, Google Sheets and Gmail
Complexity advanced
Nodes 21
Categories Crypto Trading, AI Summarization
Author WeblineIndia
Published 27 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15325/15325.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 Analyze daily stock news sentiment with Gemini AI, Google Sheets and Gmail do?

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, sen...

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.