Skip to main content

Send AI stock risk alerts from Google Sheets with Twelve Data and Groq

Workflow preview

Workflow preview
100%
Send AI stock risk alerts from Google Sheets with Twelve Data and Groq preview
Open on n8n.io

1. Workflow Overview

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

Best for

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

Tools used

n8n-nodes-base.googlesheets, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.manualtrigger, n8n-nodes-base.gmail, n8n-nodes-base.wait, n8n-nodes-base.function, @n8n/n8n-nodes-langchain.agent

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
Send AI stock risk alerts from Google Sheets with Twelve Data and Groq
Workflow name
Send AI stock risk alerts from Google Sheets with Twelve Data and Groq

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

  • Retail investors tracking personal portfolios
  • Financial analysts monitoring stock risks
  • Traders who want automated alerts
  • Anyone using Google Sheets for stock tracking
  • Users looking to integrate AI into financial workflows

Requirements

To use this workflow, you need:

  • n8n account (self-hosted or cloud)
  • Google Sheets account (OAuth2 connection required)
  • Gmail account (OAuth2 connection required)
  • Twelve Data API key (mandatory)
  • Groq API access (for AI summary generation)

How It Works & Setup Guide

Step 1: Prepare Google Sheets

  • Use a sheet named: Portfolio
  • Range: A:E
  • Required columns (in order):
Column Field Name Description
A symbol Stock ticker (e.g., AAPL)
B avg_price Average purchase price
C quantity Number of shares
D sector Industry sector
E notes Optional notes

Step 2: Connect Google Sheets

  • Open Read Portfolio from Google Sheets node
  • Authenticate using Google OAuth2
  • Ensure:
  • Sheet ID is correct
  • Range is set to Portfolio!A:E

Step 3: Configure API (MANDATORY)

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

  • Open Fetch Stock Prices node
  • Update URL:

https://api.twelvedata.com/price?symbol={{$json.symbol}}&apikey=YOUR_API_KEY

  • Replace YOUR_API_KEY with your Twelve Data API key

Step 4: Configure Email Alerts (MANDATORY)

⚠️ You must configure the recipient email manually.

  • Open Send Risk Alert Notification node
  • Set:
  • sendTo → your email address
  • Subject is already set: Daily Stock Risk Alert

Step 5: Configure Thresholds

  • Open Edit Fields – Config & Thresholds node
  • Default values:
  • drop_threshold = -5 → triggers alert if price drops ≥ 5%
  • volatility_threshold = 3 → triggers alert if volatility ≥ 3%

Adjust these based on your risk tolerance.

Step 6: Enable Scheduling

The workflow is designed for scheduled execution.

  • Replace Manual Trigger with Cron Node
  • Example schedule:
  • Daily at 9 AM
  • Every hour during market hours

Step 7: Execute Workflow

  • Run once manually for testing
  • Activate workflow for automation

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
  1. Flags risky stocks
  2. Filters only flagged items
  3. Formats data into readable text
  4. Uses AI (Groq model) to generate summary
  5. Sends email alert

How To Customize Nodes

  • Edit Fields – Config & Thresholds Adjust sensitivity of alerts

  • Wait 8 Seconds Before request Modify delay based on API rate limits

  • Compute Risk Logic Add new conditions (e.g., stop-loss, sector-based alerts)

  • Generate Risk Summary Customize prompt for different tone or format

  • Send Risk Alert Notification Change subject or email structure

Add-ons (Extend This Workflow)

  • Add Slack/Telegram alerts instead of email
  • Store alerts in a database (PostgreSQL / Airtable)
  • Add historical tracking & charts
  • Integrate multiple APIs for redundancy
  • Add portfolio performance analytics dashboard
  • Enable multi-user alerts

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

Issue Possible Cause Solution
No data fetched from Google Sheets Incorrect sheet ID or range Verify Sheet ID and Portfolio!A:E
API not returning prices Missing API key Add apikey in HTTP Request node
Workflow stops unexpectedly API rate limit Increase wait time
No email received sendTo field empty Add recipient email
No alerts triggered Thresholds too strict Adjust drop/volatility values
AI summary not generated Groq API issue Check API credentials
Incorrect risk calculation Data format issue Ensure numeric values in sheet

Need Help?

If you need assistance with:

  • Setting up this workflow
  • Customizing risk logic
  • Adding advanced features
  • Integrating additional APIs
  • Building similar automation workflows

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.

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 - Read Portfolio from Google Sheets

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

Block 2 - Edit Fields – Config & Thresholds

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

Block 3 - Filter – Only Flagged Risks

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

Block 4 - When clicking ‘Execute workflow’

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

Block 5 - Send Risk Alert Notification

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

Block 6 - Wait 8 Seconds Before request

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

Block 7 - Compute Risk Logic

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

Block 8 - Generate Risk Summary

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 9 - Groq Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGroq - lmChatGroq
Config choices
Version 1

Block 10 - Collect Flagged Stocks

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

Block 11 - Loop: Fetch Current Prices

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

Block 12 - Fetch Stock Prices

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

Block 13 - Merge Portfolio & Prices

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

Block 14 - Sticky Note

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

Block 15 - Sticky Note1

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

Block 16 - Sticky Note2

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

Block 17 - Sticky Note3

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

3. Summary Table

Workflow Send AI stock risk alerts from Google Sheets with Twelve Data and Groq
Complexity advanced
Nodes 17
Categories Crypto Trading, AI Summarization
Author WeblineIndia
Published 06 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15515/15515.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 Send AI stock risk alerts from Google Sheets with Twelve Data and Groq do?

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

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.