What This Workflow Does
Manually tracking investment portfolios in spreadsheets is time-consuming, error-prone, and quickly becomes outdated. This automation solves that by connecting your Google Sheets portfolio directly to live market data from Alpha Vantage. It automatically fetches current prices, calculates performance metrics, and updates your spreadsheet with clear insights—transforming a static document into a dynamic investment dashboard.
The workflow reads your holdings (stock symbols, purchase prices, quantities, and dates), pulls daily price data, and computes key metrics like invested value, current value, profit/loss, CAGR, and maximum drawdown. It then classifies each holding as Healthy, Watch, or Risk based on performance and downside metrics, giving you actionable intelligence at a glance without manual calculations.
How It Works
1. Read Portfolio Data from Google Sheets
The workflow starts by connecting to your Google Sheet where you maintain your investment portfolio. It reads each holding's details including stock symbol, purchase price, quantity purchased, and purchase date. This structured input ensures accurate calculations for all subsequent steps.
2. Fetch Live Market Prices via Alpha Vantage
For each stock symbol, the workflow calls the Alpha Vantage API to retrieve the latest daily closing price. This replaces manual price lookups with automated, real-time data fetching, ensuring your portfolio valuation is always current.
3. Calculate Performance & Risk Metrics
The core calculation engine computes multiple metrics: invested value (purchase price × quantity), current value (market price × quantity), absolute P&L, P&L percentage, Compound Annual Growth Rate (CAGR), and maximum drawdown. These calculations follow standard financial formulas to ensure accuracy.
4. Classify Holdings by Performance
Based on the calculated metrics, each holding receives a classification: "Healthy" for strong returns with limited drawdown, "Watch" for moderate performance, or "Risk" for significant losses or high volatility. This simple traffic-light system helps prioritize review efforts.
5. Update Google Sheets with Results
Finally, the workflow writes all calculated metrics and classifications back to your Google Sheet, either in new columns or a separate tab. This creates a complete, updated portfolio snapshot that's ready for analysis or visualization.
Who This Is For
This automation is ideal for retail investors managing personal portfolios, financial advisors tracking client investments, fintech startups building portfolio tools, and business owners monitoring company investments. It's particularly valuable for anyone currently using spreadsheets manually and wanting to add automation without switching to expensive portfolio software.
What You'll Need
- A Google Sheets spreadsheet with your portfolio data (columns for symbol, buy price, quantity, buy date)
- Google Cloud Platform credentials with Sheets API enabled
- An Alpha Vantage API key (free tier available)
- An n8n instance (cloud or self-hosted)
- Basic understanding of your portfolio structure and investment goals
Quick Setup Guide
- Download the template using the button above and import it into your n8n instance.
- Configure the Google Sheets node with your OAuth credentials and spreadsheet ID.
- Add your Alpha Vantage API key to the HTTP Request nodes.
- Map your spreadsheet columns to match the expected input format (symbol, price, quantity, date).
- Test with a few holdings to verify calculations, then schedule the workflow to run daily or weekly.
- Optionally, connect the output to data visualization tools or alert systems for enhanced monitoring.
Pro tip: Start with a copy of your main portfolio sheet for testing. Once confident, connect the automation to your live sheet. Set the schedule to run after market close for most accurate daily valuations.
Key Benefits
Eliminates 2-3 hours of manual work weekly by automating price lookups and calculations. What used to be a tedious monthly chore becomes a seamless, scheduled process that runs in the background.
Reduces calculation errors by 95% compared to manual spreadsheet formulas. Automated financial formulas ensure consistent, accurate metrics every time, eliminating fat-finger mistakes and formula errors.
Provides real-time risk visibility through automated drawdown calculations and classification. Instead of discovering losses weeks later, you get immediate alerts when holdings enter "Watch" or "Risk" categories.
Creates a single source of truth by keeping all data in Google Sheets. No more switching between brokerage statements, spreadsheets, and financial websites—everything updates automatically in one place.
Enables better investment decisions with timely, accurate data. With up-to-date performance metrics and clear classifications, you can make rebalancing decisions based on current information rather than outdated snapshots.