Skip to main content

Stock fundamental analysis & AI-powered reports with Mistral and AlphaVantage

Workflow preview

Workflow preview
100%
Stock fundamental analysis & AI-powered reports with Mistral and AlphaVantage preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Fundamental Analysis, Stock Analysis, and AI Integration in the Fundamental Analysis Tool Overview of the Tool The Fundamental Analysis Tool is an automated workflow designed to evaluate a stock’s ...

Best for

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

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.outputparserautofixing, @n8n/n8n-nodes-langchain.lmchatmistralcloud, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.code

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Stock fundamental analysis & AI-powered reports with Mistral and AlphaVantage
Workflow name
Stock fundamental analysis & AI-powered reports with Mistral and AlphaVantage

Fundamental Analysis, Stock Analysis, and AI Integration in the Fundamental Analysis Tool


Overview of the Tool

The Fundamental Analysis Tool is an automated workflow designed to evaluate a stock’s fundamentals using financial data and AI-driven insights. Built in the n8n automation platform, it:

  1. Collects financial data for a user-specified stock from AlphaVantage.
  2. Processes and structures this data for analysis.
  3. Analyzes the data using the Mistral AI model to provide expert-level insights.
  4. Generates a visually appealing HTML report with charts and delivers it via email.

The tool is triggered by a form where users input a stock symbol (e.g., "NVDA" for NVIDIA) and their email address. From there, it follows a three-stage process: data retrieval, data processing, and AI analysis with report generation.


1. Fundamental Analysis: The Foundation

Fundamental analysis involves evaluating a company’s intrinsic value by examining its financial health, competitive position, and market environment. This tool performs fundamental analysis by:

Data Retrieval

  • Data Types: Six types of data are retrieved via HTTP requests:
    • Overview: General company details (e.g., sector, industry, market cap).
    • Income Statement: Revenue, net income, and profitability metrics.
    • Balance Sheet: Assets, liabilities, and equity.
    • Cash Flow: Operating, investing, and financing cash flows.
    • Earnings Calendar: Upcoming earnings events.
    • Earnings: Historical earnings data (annual and quarterly).

Key Metrics Analyzed

The tool structures this data into 8 categories critical to fundamental analysis, as defined in the "Code1" node:

  1. Economic Moats & Competitive Advantage: Assesses sustainable advantages (e.g., R&D spending, gross profit).
  2. Financial Health & Profitability: Examines ROE, debt levels, and dividend yield.
  3. Valuation & Market Sentiment: Evaluates P/E ratio, PEG ratio, and book value.
  4. Management & Capital Allocation: Reviews market cap justification and cash allocation (e.g., R&D, buybacks).
  5. Industry & Risk Exposure: Analyzes revenue cyclicality and geopolitical risks.
  6. Key Metrics to Probe: Investigates net income trends and gross margins.
  7. Red Flags: Identifies risks like inventory issues or stock dilution.
  8. Final Checklist: Summarizes pricing power and risk/reward potential.

These categories cover the core pillars of fundamental analysis, ensuring a holistic evaluation of the stock’s intrinsic value and risks.


2. Stock Analysis: Tailored Insights

The tool performs stock-specific analysis by focusing on the user-provided stock symbol. Here’s how it tailors the process:

Input and Customization

  • Form Submission: Users enter a stock symbol (e.g., "NVDA") and email via the "On Form Submission" node.
  • Dynamic Data Fetching: The "Set Variables" node passes the stock symbol to the API calls, ensuring the analysis is specific to the chosen stock.

Processing for Relevance

  • Data Filtering: The workflow limits historical data to the last 5 years (via the "Limit" node), focusing on recent trends.
  • Merging and Cleaning: The "Merge" and "Code2" nodes combine and refine the data, removing irrelevant fields (e.g., quarterly reports) and aggregating annual reports for consistency.

Output

  • The final report is titled with the stock’s name (e.g., "Fundamental Analysis - NVIDIA"), ensuring the analysis is clearly tied to the user’s chosen stock.

This stock-specific approach makes the tool practical for investors analyzing individual companies rather than broad market trends.


3. AI Integration: Expert-Level Insights

The integration of AI (via the Mistral model or others) is what sets this tool apart, automating complex analysis and report generation. Here’s how AI is woven into the workflow:

Data Preparation for AI

  • Structuring: The "Code1" node organizes the raw data into a JSON schema aligned with the eight fundamental analysis categories.
  • This structured data is fed into the AI for analysis.

AI Analysis

  • Node: "Basic LLM Chain" uses the Mistral AI model.
  • Prompt: The AI is instructed to act as an "expert financial advisor with 50 years of experience" and answer specific questions for each category, such as:
    • Economic Moats: "What sustainable competitive advantages protect the company’s margins?"
    • Financial Health: "Is ROE driven by leverage or true profitability?"
    • Red Flags: "Are supply chain issues a concern?"
  • Output: The AI generates a JSON response with detailed insights, e.g.:
    {
      "Economic Moats & Competitive Advantage": "NVIDIA’s leadership in GPU technology and strong R&D investment...",
      "Financial Health & Profitability": "ROE of 25% is exceptional, driven by profitability rather than leverage...",
      ...
    }
    
  • Validation: An "Auto-fixing Output Parser" ensures the output adheres to the expected JSON schema, retrying if necessary.

Report Enhancement

  • HTML Generation: The "HTML" node creates an initial report with placeholders for the AI’s insights and Google Charts for visualizations (e.g., ROE trends, revenue growth).
  • AI-Driven Refinement: The "Basic LLM Chain1" node uses Mistral again to enhance the HTML, adding:
    • Styled tables (e.g., financial ratios).
    • Charts (e.g., bar charts for valuation, line charts for revenue).
    • Visual indicators (e.g., ✅ for positive trends, ⚠️ for risks).
    • Mobile-responsive design with modern fonts (Inter or Roboto).

This dual AI approach—one for analysis, one for presentation—ensures the output is both insightful and user-friendly.


Strengths and Limitations

Strengths

  • Comprehensive: Covers all key aspects of fundamental analysis.
  • AI-Powered: Automates expert-level insights and report design.
  • User-Friendly: Delivers an interactive, visual report via email.

Limitations

  • Data Dependency: Relies on public data, so data quality and timeliness matter.
  • AI Constraints: Insights depend on AI’s capabilities; it may miss nuanced human judgment.
  • Disclaimer: The tool notes it’s not investment advice, so users should consult advisors.

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 - Sticky Note2

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

Block 2 - Set Variables

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

Block 3 - Get News Data

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

Block 4 - Sticky Note16

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

Block 5 - Get News Data1

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

Block 6 - Get News Data2

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

Block 7 - Get News Data3

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

Block 8 - Get News Data4

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

Block 9 - Merge

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

Block 10 - Get News Data5

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

Block 11 - Auto-fixing Output Parser

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

Block 12 - Mistral Cloud Chat Model

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

Block 13 - Structured Output Parser1

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 14 - Mistral Cloud Chat Model1

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

Block 15 - Code1

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

Block 16 - Split Out

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

Block 17 - Split Out2

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

Block 18 - Merge1

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

Block 19 - Limit

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

Block 20 - Code2

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

Block 21 - Merge2

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

Block 22 - Aggregate

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

Block 23 - Gmail

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

Block 24 - Basic LLM Chain

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

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

3. Summary Table

Workflow Stock fundamental analysis & AI-powered reports with Mistral and AlphaVantage
Complexity advanced
Nodes 33
Categories Crypto Trading, AI Summarization
Author Sebastian/OptiLever
Published 06 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5710/5710.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 Stock fundamental analysis & AI-powered reports with Mistral and AlphaVantage do?

Fundamental Analysis, Stock Analysis, and AI Integration in the Fundamental Analysis Tool Overview of the Tool The Fundamental Analysis Tool is an automated workflow designed to evaluate a stock’s ...

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.