πŸ“ˆ Send AI stock risk alerts from Google Sheets with Twelve Data and Groq

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

Description

Google Sheets + Twelve Data + Groq AI Stock Risk Alert Workflow

> Smart Stock Risk Alerts in Minutes

This workflow automatically reads your stock portfolio from Google Sheets, fetches real-time prices via API, calculates risk metrics (price drops and volatility) and sends AI-generated email alerts only when risks are detected. It helps you stay informed without being overwhelmed by unnecessary notifications.

Quick Implementation Steps

  1. Connect your Google Sheets account and prepare your portfolio sheet.
  2. Add your Twelve Data API key in the HTTP Request node.
  3. Connect your Gmail account for sending alerts.
  4. Configure thresholds in the Edit Fields – Config & Thresholds node.
  5. Set up a Cron (Schedule Trigger) instead of manual execution.
  6. Run the workflow and monitor alerts.

What It Does

This workflow automates stock portfolio monitoring by combining spreadsheet data, real-time market prices and AI-powered summaries. It reads your portfolio data from Google Sheets and processes each stock by fetching its current market price through an external API.

Once the data is enriched, the workflow calculates key risk indicators such as percentage price change and volatility. Based on predefined thresholds, it flags stocks that may require attention. Instead of sending raw data, it uses an AI model to generate a clean, human-readable summary.

The workflow ensures efficiency by sending alerts only when necessary, reducing noise and helping you focus on meaningful risks.

Who It’s For

Requirements

To use this workflow, you need:

How It Works & Setup Guide

Step 1: Prepare Google Sheets

ColumnField NameDescription
AsymbolStock ticker (e.g., AAPL)
Bavg_priceAverage purchase price
CquantityNumber of shares
DsectorIndustry sector
EnotesOptional notes

Step 2: Connect Google Sheets

Step 3: Configure API (MANDATORY)

⚠️ This is a required setup step. The workflow will NOT work without it.

Step 4: Configure Email Alerts (MANDATORY)

⚠️ You must configure the recipient email manually.

Step 5: Configure Thresholds

Adjust these based on your risk tolerance.

Step 6: Enable Scheduling

The workflow is designed for scheduled execution.

Step 7: Execute Workflow

How It Works (Flow Summary)

  1. Reads portfolio data from Google Sheets
  2. Adds configuration thresholds
  3. Loops through each stock
  4. Fetches real-time prices (with delay to avoid rate limits)
  5. Merges portfolio + price data
  6. Computes:
    • Price change %
    • Volatility
  7. Flags risky stocks
  8. Filters only flagged items
  9. Formats data into readable text
  10. Uses AI (Groq model) to generate summary
  11. Sends email alert

How To Customize Nodes

Add-ons (Extend This Workflow)

Use Case Examples

  1. Daily Portfolio Monitoring

Automatically receive alerts for risky stocks each day

  1. Intraday Risk Tracking

Run hourly to track sudden market movements

  1. High Volatility Detection

Identify stocks with unstable price behavior

  1. Loss Prevention Alerts
    Get notified when stocks drop beyond safe thresholds

  2. Sector-Based Monitoring
    Track risk exposure across industries

There can be many more use cases depending on how you customize thresholds and logic.

Troubleshooting Guide

IssuePossible CauseSolution
No data fetched from Google SheetsIncorrect sheet ID or rangeVerify Sheet ID and Portfolio!A:E
API not returning pricesMissing API keyAdd apikey in HTTP Request node
Workflow stops unexpectedlyAPI rate limitIncrease wait time
No email receivedsendTo field emptyAdd recipient email
No alerts triggeredThresholds too strictAdjust drop/volatility values
AI summary not generatedGroq API issueCheck API credentials
Incorrect risk calculationData format issueEnsure numeric values in sheet

Need Help?

If you need assistance with:

We’re here to help!

πŸ‘‰ Contact our n8n developes at WeblineIndia for expert support in building scalable, AI-powered automation solutions tailored to your needs.

πŸ”— Nodes Used

Function, Google Sheets, HTTP Request, Gmail, AI Agent, Groq Chat Model

πŸ“₯ Import

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

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