Generate multi-quarter earnings reports with Google Workspace, Gemini and Pinecone

Go to Workflow
1 views
Built by Redowan Ahmed Farhan Redowan Ahmed Farhan
Created on July 28, 2026

Description

Quick overview
This workflow ingests quarterly earnings PDFs listed in Google Sheets from Google Drive into a Pinecone vector index using Google Gemini embeddings, then uses an OpenAI-powered agent with Pinecone retrieval to generate a markdown earnings-trend report and save it into Google Docs.

How it works
Starts when you manually run the workflow.
Reads a Google Sheets watchlist of earnings-report PDF URLs and iterates through each file.
Downloads each PDF from Google Drive, splits it into text chunks, and generates embeddings with Google Gemini.
Stores the embedded chunks in a Pinecone index for semantic search across the uploaded filings.
Prompts an OpenAI chat model to write a markdown report covering the last three quarters, focusing on differences, trends, and outliers.
Retrieves supporting passages from Pinecone (using Google Gemini query embeddings) to ground the analysis.
Inserts the generated markdown report into a target Google Doc.

Setup
Create a Pinecone index named company-earnings and add Pinecone credentials for both the insert and retrieval steps.
Add a Google AI (Gemini) API key for the Google Gemini embeddings and chat model used for retrieval.
Add an OpenAI API key for the chat model that powers the report-writing agent.
Connect Google Sheets, Google Drive, and Google Docs OAuth credentials, then set your spreadsheet ID/sheet and replace the Google Docs documentURL with your target document.
Ensure your Google Sheet includes a File URL column (and any optional fields like a filename), and update the agent prompt if you want to analyze a company other than Google.

Nodes Used (11)

AI Agent
@n8n/n8n-nodes-langchain.agent
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings Google Gemini
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini
Google Docs
n8n-nodes-base.googleDocs
Google Drive
n8n-nodes-base.googleDrive
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
Google Sheets
n8n-nodes-base.googleSheets
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter
Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore