๐Ÿ“ˆ Send financial market email alerts with Tradient, GPT-4o mini, and Gmail

โšก 37 views ยท ๐Ÿ“ˆ Crypto Trading & Stock Market

Description

Quick overview

This workflow runs daily during Indian market hours, pulls the latest stock-market news from the Tradient API, uses OpenAI to classify event severity and relevance, and emails concise investor alerts via Gmail for high-impact events.

How it works

  1. Runs every day on a schedule and starts only if the current time is within NSE/BSE market hours (9:15 AMโ€“3:30 PM IST).
  2. Fetches the latest market news from the Tradient API and normalizes each article into a consistent structure.
  3. Filters out routine announcements and keeps only news in important sub-categories or containing high-signal keywords.
  4. Sends each remaining item to OpenAI to classify the event type, severity, market impact, investor relevance, and whether an alert should be sent.
  5. Keeps only items where OpenAI recommends sending an alert and the severity is not Low, then removes duplicate articles by article ID.
  6. Uses OpenAI to generate a short, actionable investor alert in JSON, formats it for email, and sends it through Gmail.

Setup

  1. Add an OpenAI credential (or compatible OpenAI connection in the LangChain OpenAI node) and confirm the selected model (gpt-4o-mini) is available in your account.
  2. Configure the Tradient market news endpoint and any required authentication or headers in the HTTP request node.
  3. Add a Gmail OAuth2 credential and set the recipient(s) and other email options in the Gmail node.
  4. Adjust the schedule time, timezone assumptions (Asia/Kolkata), and the keyword/category allowlist and ignore patterns to match your alerting needs.

Additional info

How To Customize Nodes

Customize Market Hours

Inside:

Modify:

(hour > 9 || (hour === 9 && minutes >= 15))

and

(hour < 15 || (hour === 15 && minutes <= 30))

to support different market timings.

Customize Important Keywords

Inside:

Modify:

const importantKeywords = [...]

You can add:

or any market-specific keywords.

Customize Ignored News Types

Modify:

const ignorePatterns = [...]

to filter additional unwanted announcements.

Change AI Model

Inside:

You may switch:

depending on performance and cost requirements.

Customize Alert Severity Rules

Inside:

You can:

Customize Email Content

Inside:

Modify:

Add-ons (Additional Features You Can Extend)

You can extend this workflow with additional automation features such as:

Use Case Examples

1. Real-Time Investor Alerting

Automatically notify investors when companies announce:

2. Trading Desk Monitoring

Help traders monitor high-impact corporate developments without manually reading market feeds.

3. Portfolio Risk Monitoring

Track negative developments such as:

4. Financial Research Automation

Research teams can automate the identification of market-moving events across sectors.

5. AI-Powered Financial News Digest

Build automated investor newsletters using AI-generated summaries and categorized market events.

Additional use cases can be created by integrating this workflow with CRMs, portfolio systems, trading dashboards, or internal business intelligence platforms.

Troubleshooting Guide

IssuePossible CauseSolution
No alerts are being sentMarket is closedVerify market-hour validation logic
Workflow stops after API fetchInvalid API responseVerify market news API availability
AI classification failsInvalid OpenAI credentialsReconnect OpenAI credentials
Duplicate alerts receivedMissing article IDsVerify article_id availability
Gmail node failsGmail authentication expiredReconnect Gmail credentials
Low-quality alertsAI prompt too genericImprove AI prompt instructions
Too many alertsKeyword filtering too broadRefine important keywords
Important events are ignoredSeverity filtering too strictAdjust IF node conditions
JSON parsing errorsAI returned invalid JSONStrengthen prompt formatting rules
Workflow executes outside market hoursTimezone mismatchVerify Asia/Kolkata timezone logic

Need Help?

Whether you want to:

our n8n workflow development team at WeblineIndia can help you build production-ready financial automation workflows tailored to your business needs.

WeblineIndia can also assist with:

If you need a customized version of this workflow or a completely new AI-powered automation solution, feel free to reach out to WeblineIndia for professional assistance.

๐Ÿ”— Nodes Used

HTTP Request, Gmail, Schedule Trigger, OpenAI

๐Ÿ“ฅ Import

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

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup