Automate Google Stock Earnings Analysis with n8n RAG Workflow

This n8n workflow automates the analysis of Google’s last three quarters earnings reports using a Retrieval-Augmented Generation (RAG) approach. By integrating Google Sheets, Drive, Pinecone, and AI tools, it saves hours of manual report compilation and provides precise financial insights quickly.
agent
vectorStorePinecone
googleDocs
+10
Workflow Identifier: 1765
NODES in Use: manualTrigger, googleSheets, googleDrive, documentDefaultDataLoader, textSplitterRecursiveCharacterTextSplitter, embeddingsGoogleGemini, vectorStorePinecone, splitInBatches, agent, googleDocs, lmChatOpenAi, toolVectorStore, lmChatGoogleGemini
Automate stock analysis with n8n and Google Sheets

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow reads earnings report PDFs from Google Drive using links in Google Sheets.

It turns PDFs into text chunks, makes semantic embeddings with Google Gemini, and saves them in Pinecone.

When a user asks a question, it finds matching text and runs an AI analysis to make a clear report.

The final report goes into Google Docs for easy use and sharing.

This saves many hours of manual work by giving detailed financial reports fast and accurate.


Tools and Services Used


Inputs, Process, and Output

Inputs

  • List of PDF URLs in Google Sheets.
  • Pooled earnings reports files in Google Drive.

Processing Steps

  • Download each PDF from Google Drive.
  • Convert PDF to plain text.
  • Split text into smaller chunks.
  • Create embeddings with Google Gemini.
  • Save embeddings to Pinecone vector store.
  • On query, use vector search to find related text chunks.
  • Run AI agent with fetched data to generate analysis.

Output

  • Formatted financial report for last three quarters saved in Google Docs.

Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor where the workflow will be run.
  3. Use the Import from File option in n8n to bring the downloaded workflow into the editor.

Step 2: Configure Credentials and IDs

  1. Add your Google Sheets, Drive, and Docs OAuth2 credentials inside n8n.
  2. Set up Google Gemini (PaLM) API key in the embedding and AI nodes.
  3. Enter your Pinecone API Key and ensure the index name matches, usually ‘company-earnings’.
  4. Update any placeholders such as Google Sheet IDs, Drive folder IDs, Docs URLs, or email addresses if the workflow uses those.

Step 3: Test the Workflow

  1. Manually trigger the workflow in n8n to test it.
  2. Check if PDFs download, text converts, embeddings create, and AI generates a report.
  3. Review the Google Doc for the generated report.

Step 4: Activate for Production

  1. Enable the workflow by turning it on inside n8n.
  2. Set any required schedules or webhook triggers for automatic run if needed.
  3. Monitor workflow runs and logs regularly.

If interested in more control over environment and data privacy, consider self-host n8n on your own server.


Customization Ideas

  • Add more earnings reports in the Google Sheets watchlist to analyze more data.
  • Change the AI system prompt to focus on other financial metrics like cash flow.
  • Use different Google Gemini embedding models for different speeds or detail.
  • Expand workflow to send the Google Docs report by email or Slack with extra nodes.
  • Add charts manually in Google Docs using data from the report outputs.

Troubleshooting

Vector Store Insert Failed Due to Missing Index

Cause: Pinecone index named ‘company-earnings’ does not exist or is not accessible.

Solution: Create this index in Pinecone dashboard and check API key permissions.

Failed to Download File from Google Drive

Cause: File URL incorrect or OAuth2 user lacks permission.

Solution: Verify file URL correctness and ensure OAuth2 credentials have full access.

AI Agent Generates Incomplete or Irrelevant Reports

Cause: System prompt with missing or unclear details.

Solution: Improve AI system message with exact instructions and what financial areas to focus on.


Pre-Production Checklist


Deployment Guide

Activate the workflow inside n8n and add all required API Keys and OAuth credentials.

Use manual trigger first to check the workflow works fully.

Set schedules or webhook triggers as needed to automate report generation later.

Watch logs to troubleshoot any failures and improve AI prompts or input data as necessary.


Summary of Workflow Benefits and Results

✓ Saves many hours of manual financial data processing.

✓ Generates accurate and detailed earnings report fast.

✓ Uses clear, human-like AI analysis with specific financial focus.

✓ Stores and searches text data efficiently with Pinecone vector DB.

✓ Outputs professional formatted reports inside Google Docs.

→ Streamlined earnings report analysis from PDF to report.

→ Reduces human errors by automating data extraction and summarization.

→ Flexible for multiple companies or broader financial documents.


Automate stock analysis with n8n and Google Sheets

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, by adding URLs of other companies’ PDFs in the Google Sheets watchlist and uploading those PDFs to Google Drive, the workflow can process any company’s earnings reports.
This error happens when the Pinecone index named ‘company-earnings’ does not exist or is not accessible. Creating the index in the Pinecone dashboard with correct permissions fixes this.
Improving the system prompt with detailed instructions and specifying exactly which financial metrics to analyze helps the AI Agent generate more relevant and complete reports.
No, using Google Gemini (PaLM) API and Pinecone vector database incurs costs based on usage. Monitoring API quotas and limits is recommended to avoid unexpected charges.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.