Who is this workflow for? This n8n workflow automates the analysis of a company’s quarterly earnings reports. Leveraging OpenAI’s GPT-4o-mini, Google’s Gemini AI, and Pinecone’s vector search, it processes PDF earnings documents to generate comprehensive financial reports, answering complex questions and compiling findings into structured Google Docs..

What does this workflow do?

1. Data Loading and Indexing

  • Fetch PDF Links: Retrieves URLs of earnings report PDFs from a specified Google Sheet.
  • Download PDFs: Downloads the identified PDF documents from Google Drive.
  • Parse and Chunk Text: Extracts text from the PDFs, splits it into manageable chunks, and generates embeddings using Google’s text-embedding-004 model.
  • Store in Pinecone: Saves the generated embeddings and corresponding text chunks in a Pinecone vector database to enable semantic search.

2. Report Generation with AI Agent

  • AI Agent Coordination: An AI Agent node, guided by a specialized system prompt, manages the workflow process.
  • Information Retrieval: The agent utilizes the Vector Store Tool to access and retrieve relevant information from the Pinecone database.
  • Report Compilation: Aggregates the retrieved data to formulate a comprehensive financial report.

3. Report Delivery

  • Save to Google Docs: The finalized report is automatically saved as a Google Doc in a designated Google Drive folder, ensuring easy access and sharing.
  • Google Cloud Project & Vertex AI API:
  • Create a Google Cloud project.
  • Enable the Vertex AI API for the project.
  • Google AI API Key:
  • Obtain a Google AI API key from Google AI Studio.
  • Pinecone Account and API Key:
  • Register for a free Pinecone account.
  • Acquire your API key from the Pinecone dashboard.
  • Create an index named company-earnings in your Pinecone project.
  • Google Drive – Download and Save Financial Documents:
  • Download quarterly earnings PDFs from the desired company’s Investor Relations page.
  • Save the PDFs to Google Drive.
  • Create a Google Sheet listing the file URLs of the saved PDFs.
  • Configure Credentials in n8n:
  • Set up OAuth2 credentials for Google Sheets, Google Drive, and Google Docs.
  • Configure the Google Gemini (PaLM) API using your Google AI API key.
  • Input your Pinecone API key.
  • Import and Configure the Workflow:
  • Import the workflow into your n8n instance.
  • Update the “List Of Files To Load” node to reference your Google Sheet.
  • Adjust the “Download File From Google Drive” node to target the correct column with file URLs.
  • Modify the “Save Report to Google Docs” node to specify the destination Google Doc for the reports.

🤖 Why Use This Automation Workflow?

  • Efficiency: Automates the extraction and analysis of financial data from multiple PDF reports.
  • Accuracy: Utilizes advanced AI models to ensure precise interpretation and analysis of financial information.
  • Scalability: Easily handles large volumes of documents, making it suitable for analyzing numerous companies’ reports concurrently.

👨‍💻 Who is This Workflow For?

  • Financial Analysts: Streamlines the process of generating detailed financial reports.
  • Investment Firms: Facilitates quick and accurate assessments of company performance.
  • Business Intelligence Teams: Enhances data-driven decision-making with automated report generation.

🎯 Use Cases

  1. Quarterly Performance Review: Automatically generate detailed analyses of a company’s quarterly earnings.
  2. Investment Research: Compile comprehensive reports to support investment decisions based on the latest financial data.
  3. Competitive Analysis: Compare multiple companies’ financial performances by analyzing their earnings reports systematically.

TL;DR

This n8n workflow seamlessly automates the analysis of stock earnings reports, from data extraction and indexing to AI-driven report generation and delivery. By integrating powerful AI tools and scalable databases, it provides a reliable solution for generating detailed financial analyses efficiently.

Help us find the best n8n templates

About

A curated directory of the best n8n templates for workflow automations.