Analyze Stock Earnings with n8n and Google Gemini RAG Workflow

This n8n workflow automates the analysis of Google’s quarterly earnings reports using advanced AI with Google Gemini embeddings and Pinecone vector store, saving time and enhancing financial insight generation.
manualTrigger
googleSheets
googleDrive
+10
Workflow Identifier: 1666
NODES in Use: manualTrigger, googleSheets, googleDrive, documentDefaultDataLoader, textSplitterRecursiveCharacterTextSplitter, embeddingsGoogleGemini, vectorStorePinecone, splitInBatches, lmChatOpenAi, agent, googleDocs, lmChatGoogleGemini, toolVectorStore
Analyze stock earnings with n8n and Google Gemini

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

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow reads and analyzes several quarterly earnings PDF reports stored in Google Drive.

It finds key financial facts like revenue and profits fast by turning report text into searchable data.

Then it writes a clear, detailed report in Google Docs summarizing recent quarters.

This helps financial analysts save time and get accurate insights without reading each PDF manually.


Who Should Use This Workflow

This automation fits users who need to quickly review multiple financial reports.

It is good for finance teams, analysts, or managers who want useful summaries in minutes.

No heavy technical skill needed. It helps avoid manual reading or errors when handling many PDFs.


Tools and Services Used


Beginner Step-by-Step: How to Build This in n8n

Download and Import Workflow

  1. Download the workflow JSON file using the Download button on this page.
  2. Inside the n8n editor, click on “Import from File” and upload the downloaded workflow file.

Configure Credentials and IDs

  1. Add Google OAuth2 credentials for Sheets, Drive, and Docs in n8n’s credentials manager.
  2. Enter the Google Gemini (PaLM) API key into its proper credential node.
  3. Enter your Pinecone API key and verify the index name is company-earnings.
  4. Update the List Of Files To Load (Google Sheets) node with your Google Sheets Document ID and Sheet Name containing PDF URLs.
  5. In the Download File From Google Drive node, confirm File ID is set to use the “File URL” value from the Sheets node.
  6. In the Save Report to Google Docs node, specify the Google Doc ID where the report will be saved.

Test and Activate Workflow

  1. Run the workflow manually using the “Test workflow” trigger to check it runs without errors.
  2. Review the generated report in Google Docs to confirm data is accurate and well formatted.
  3. Activate the workflow to run on-demand or schedule it as needed for production use.

If self hosting n8n, consider self-host n8n for better control over automation runs.


Workflow Inputs, Processing, and Output

Inputs

  • PDF earnings reports stored on Google Drive.
  • Google Sheets document listing URLs of PDF files to analyze.

Processing Steps

  • The workflow reads the URLs from Google Sheets and downloads each PDF file from Google Drive.
  • The PDFs are loaded as binary data and split into smaller text parts for embedding generation.
  • Google Gemini embeddings convert these chunks into vector data that describes the content meaning.
  • All embeddings are stored and indexed in the Pinecone vector database under the company-earnings index.
  • The AI agent queries Pinecone to find relevant info about financial metrics like revenue trends and profits.
  • The agent generates a report in markdown using Google Gemini and OpenAI chat models.

Output

  • The final, detailed quarterly earnings report is saved in a Google Doc specified by the user.

Customization Ideas

  • Change the company by updating the AI agent prompt text inside the workflow.
  • Add more quarters or other companies by adding PDF URLs to the Google Sheets list.
  • Focus the report on specific sections, such as cash flow or management commentary, by adjusting the AI system message prompt.
  • Add charts or tables by enhancing the Google Docs node or post-processing the markdown output.

Troubleshooting Common Problems

Authentication failed for Google APIs

This happens when OAuth2 credentials are missing or wrong.

Fix this by updating Google API credentials in n8n and making sure the right API scopes are authorized.

Pinecone Index Not Found

Occurs if the company-earnings index is not created or misspelled in Pinecone.

Create the index in Pinecone dashboard with the exact name and update API keys as needed.

No data returned from Google Sheets

Error caused by wrong Sheet Name or Document ID in the Sheets node.

Check sheet names and test the node separately to confirm.


Pre-Production Checklist

  • Confirm Pinecone company-earnings index is active with data loaded.
  • Test Google Sheets node to ensure PDF URLs are fetched correctly.
  • Make sure Google Drive permissions allow downloading target PDF files.
  • Run a manual test trigger and receive a proper markdown report from the AI Agent.
  • Verify the report updates correctly in the specified Google Doc.

Deployment Guide

Enable the workflow in n8n and set it to run on-demand or on a schedule.

Use the manual trigger for initial testing before full automation.

Watch execution logs to catch and fix errors fast.

Track API usage carefully to avoid exceeding limits, especially for Google Gemini and Pinecone calls.


Summary of Benefits and Outcome

→ Automates reading and analysis of multiple quarterly earnings PDFs.

→ Cuts analysis time from many hours to just minutes.

→ Returns detailed, accurate financial reports using semantic search and AI.

→ Saves reports directly into Google Docs for convenient access and editing.

Analyze stock earnings with n8n and Google Gemini

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, update the Google Sheets with PDF URLs for the new company and change the AI agent prompt to mention that company.
Yes, embedding and AI chat calls consume API credits. Monitor usage to avoid high costs.
Data flows through OAuth2-secured APIs and is stored only in Pinecone and Google Drive securely.
Yes, but Pinecone index size and API rate limits need to be managed for high volumes.

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.