n8n Workflow: Portfolio Correlation & Diversification (Sheets + Slack)
n8n Workflow: Portfolio Correlation & Diversification (Sheets + Slack)
Regular price
£65.99
Regular price
£65.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n Workflow: Portfolio Correlation & Diversification (Sheets + Slack)
Regular price
£65.99
Regular price
£65.99
Sale price
Unit price
/
per
Monthly Portfolio Correlation & Diversification—Calculated from Google Sheets and Shared to Slack
This n8n workflow automatically reads your portfolio holdings from Google Sheets, pulls 90 days of historical prices via an HTTP endpoint, computes pairwise Pearson correlations and diversification metrics, visualizes the results with QuickChart, and posts a formatted diversification report to Slack—on a monthly schedule.
What this workflow does
- Runs monthly using a schedule trigger.
- Loads holdings from Google Sheets and filters to rows where ticker and asset type are non-empty and quantity is positive.
- Calculates portfolio weights per holding and retrieves 90 days of historical closing prices for each ticker using an HTTP request to your market-data endpoint.
- Computes correlations by converting prices into daily returns, then generating a Pearson correlation matrix and a list of pairwise correlations.
- Derives diversification metrics such as average correlation, diversification score, risk level, and identifies the highest/lowest correlated pairs.
- Creates a QuickChart visualization (bar chart URL) from the pairwise correlation results and requests the rendered chart image.
- Writes outputs back to Google Sheets by appending the diversification summary and pairwise correlation records to dedicated tabs, then posts the report to Slack.
Use cases
- Track whether your portfolio is becoming more or less diversified over time.
- Generate a repeatable monthly correlation report for SaaS ops, finance ops, or analysts.
- Use Slack notifications to keep stakeholders aligned with measurable diversification metrics.
Technical details
- Google Sheets (OAuth): reads holdings and appends results to “Diversification Log” and “Pairwise Correlations”.
- HTTP Request: fetches 90 days of historical pricing per ticker.
- Code (calculations): daily returns, Pearson correlation matrix, diversification scoring.
- Slack: posts the formatted diversification report.
- QuickChart: generates the bar chart visualization from correlation data.
Setup note: Ensure your spreadsheet has tabs named “Portfolio Holdings”, “Diversification Log”, and “Pairwise Correlations” with matching column headers.
