Skip to main content

Generate daily stock BUY/HOLD/SELL signals with GPT-4o, Gemini, FMP, Sheets and Telegram

Workflow preview

Workflow preview
100%
Generate daily stock BUY/HOLD/SELL signals with GPT-4o, Gemini, FMP, Sheets and Telegram preview
Open on n8n.io

1. Workflow Overview

Overview This is a production grade, fully automated stock analysis system built entirely in n8n. It combines institutional level financial analysis, dual AI model consensus, and a self improving b...

Best for

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

Tools used

n8n-nodes-base.splitinbatches, n8n-nodes-base.googlesheets, n8n-nodes-base.scheduletrigger, n8n-nodes-base.stickynote, n8n-nodes-base.merge, n8n-nodes-base.xml, n8n-nodes-base.if, n8n-nodes-base.set

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Generate daily stock BUY/HOLD/SELL signals with GPT-4o, Gemini, FMP, Sheets and Telegram
Workflow name
Generate daily stock BUY/HOLD/SELL signals with GPT-4o, Gemini, FMP, Sheets and Telegram

Overview This is a production-grade, fully automated stock analysis system built entirely in n8n. It combines institutional-level financial analysis, dual AI model consensus, and a self-improving backtesting loop — all running on autopilot, every single day.

Every morning, the engine screens the US stock market, collects deep financial data, reads the latest news, and sends two independent AI analysts (GPT-4o and Gemini 2.5 Pro) to debate each stock. When they disagree, a structured bull-vs-bear tiebreaker is triggered. The result: a daily ranked list of BUY, HOLD, and SELL signals — with price targets, confidence scores, and risk assessments — delivered straight to your Telegram.

A companion backtesting workflow runs silently in the background, grading every past signal 7 days after it was issued and sending you a weekly performance report every Monday morning.

This is not a toy workflow. This is the kind of system that would cost thousands of dollars to build as a SaaS — running entirely on your own infrastructure.

✨ What Makes This Template Unique 🤖 Dual AI Consensus Engine — GPT-4o and Gemini 2.5 Pro analyze every stock independently. Their outputs are compared, and consensus is only declared when both models agree within a tight price target band ⚖️ Structured Tiebreaker Architecture — When models disagree, a bull analyst (GPT-4o) and a bear analyst (Gemini) re-run with opposing mandates. The final verdict is derived from their averaged price target plus a Piotroski F-Score gate 📊 Institutional-Grade Financial Modeling — Piotroski F-Score (9-point), Graham Number intrinsic value, DCF anchor, TTM revenue & margins, net debt, FCF, revenue growth YoY, and sector-relative P/E valuation — all computed automatically 📰 Live News Sentiment — Latest headlines per stock are fed into the AI prompt, adjusting confidence scores in real time based on positive or negative sentiment signals 🎯 Scenario Price Targets — Every stock gets three targets: pt_bear (downside), pt_base (fair value), pt_bull (upside case), giving you a full risk/reward picture 🔁 Self-Improving Backtester — Every signal is automatically graded 7 days later. Win rate, average return, and best/worst calls are reported every Monday via Telegram 📡 Smart Screener with Sector Diversity — Scores 100 candidates daily using volume health, market cap sweet spot ($5B–$100B), and beta gradient — with a sector diversity cap so you never end up with 15 tech stocks 💾 Full Google Sheets Audit Trail — Every signal, confidence score, rationale, and outcome is logged permanently for your own review and analysis 📋 Workflow Breakdown Workflow 1 — AI Institutional Stock Valuation Engine Phase What Happens Phase 1 — Screening FMP screener fetches 100 US stocks. Score_and_Prefilter scores and selects the top 20 with sector diversity Phase 2A — Financial Data 13 FMP endpoints per stock: income, balance sheet, cash flow, ratios, profile, sector P/E Phase 2B — News Latest headlines fetched and passed into AI context Phase 3 — AI Round 1 GPT-4o and Gemini 2.5 Pro analyze in parallel. Verdicts and price targets compared Phase 3 — Tiebreaker Bull vs Bear re-analysis when models disagree or price target gap > 25% Phase 4 — Strong Buy Alert Stocks with BUY verdict + upside ≥ 20% + confidence ≥ 65 trigger an immediate alert Phase 5 — Storage & Summary All results written to Google Sheets. Daily Telegram summary sent with top picks Workflow 2 — Signal Outcome Checker & Weekly Backtester Trigger What Happens Daily 8AM Finds signals that are 7 days old, fetches current price, grades WIN / LOSS / NEUTRAL, writes outcome back to sheet Monday 9AM Computes weekly win rate, average return on BUY signals, best and worst call — sends full report to Telegram 🛠️ What You Need Requirement Details FMP API Key Financial Modeling Prep — Starter plan or above (~$25/mo). Covers all financial data, screener, news, and historical prices OpenAI API Key GPT-4o access via API or ChatGPT Plus Google Gemini API Key Gemini 2.5 Pro via Google AI Studio (free tier available) Google Sheets One sheet named Stock_Signals with the column headers listed in the setup guide Telegram Bot Create via @BotFather in 2 minutes. Free n8n Self-hosted or n8n Cloud Estimated running cost: $0.43/day in AI tokens for 20 stocks ($10–$13/month). FMP and Telegram are the only other costs.

⚙️ Setup Time ~30–45 minutes for a first-time setup. All credentials, Sheet IDs, and API keys are clearly labeled in each node. No coding required — every parameter is documented.

📈 Example Daily Telegram Output 📊 Daily Valuation Report — 2026-04-02 Stocks Analyzed: 20

🟢 BUY: 7 🟡 HOLD: 10 🔴 SELL: 3

🚨 STRONG BUY ALERTS: • NVDA — Upside 34% | Confidence 81 | F-Score 7/9 • MSFT — Upside 22% | Confidence 74 | F-Score 8/9

Top Picks:

  1. NVDA pt_base $172 | pt_bull $198 | pt_bear $124
  2. MSFT pt_base $485 | pt_bull $530 | pt_bear $410
  3. AMGN pt_base $318 | pt_bull $355 | pt_bear $275

📊 Example Weekly Backtest Report 📈 Weekly Signal Performance — Week of Mar 31 Signals Graded: 18

✅ Win Rate: 72% | BUY Accuracy: 78% 📈 Avg Return on BUY signals: +4.3%

🏆 Best Call: NVDA +11.2% (BUY ✅) 💔 Worst Call: BA -6.8% (BUY ❌)

💡 Who Is This For? Retail investors who want institutional-quality analysis without paying for a Bloomberg terminal Quantitative traders looking for a customizable, data-driven signal generation pipeline n8n builders who want to see a real-world, production-grade multi-node workflow in action AI enthusiasts interested in multi-model consensus systems and structured debate architectures 📬 Questions, Customizations & Feedback Have a question about setup, want to adapt this workflow to your own strategy, or found something to improve?

📧 [email protected]

All feedback is welcome. If you build something interesting on top of this, I'd love to hear about it.

Built with ❤️ using n8n, Financial Modeling Prep, OpenAI GPT-4o, and Google Gemini 2.5 Pro.

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

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

Block 2 - write_sentiment_to_sheets

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

Block 3 - Schedule Trigger

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

Block 4 - Sticky Note1

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

Block 5 - Sticky Note2

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

Block 6 - Sticky Note3

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

Block 7 - Sticky Note5

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

Block 8 - Merge

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

Block 9 - XML

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

Block 10 - Merge1

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

Block 11 - If

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

Block 12 - If1

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

Block 13 - Edit Fields2

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

Block 14 - Merge2

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

Block 15 - Merge3

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

Block 16 - Merge4

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

Block 17 - Seekingalpha Articles

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

Block 18 - Clean Profile

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

Block 19 - Clean Income statement

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

Block 20 - Clean Ccashflow

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

Block 21 - Clean Read Financial

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

Block 22 - Clean Current Price

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

Block 23 - Merge5

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

Block 24 - Clean the news

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

Showing the first 24 of 86 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Generate daily stock BUY/HOLD/SELL signals with GPT-4o, Gemini, FMP, Sheets and Telegram
Complexity advanced
Nodes 86
Categories Crypto Trading, AI Summarization
Author Mo AlBarrak
Published 02 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14580/14580.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 Generate daily stock BUY/HOLD/SELL signals with GPT-4o, Gemini, FMP, Sheets and Telegram do?

Overview This is a production grade, fully automated stock analysis system built entirely in n8n. It combines institutional level financial analysis, dual AI model consensus, and a self improving b...

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.