{"product_id":"n8n-workflow-portfolio-correlation-diversification-sheets-slack","title":"n8n Workflow: Portfolio Correlation \u0026 Diversification (Sheets + Slack)","description":"\u003ch3\u003eMonthly Portfolio Correlation \u0026amp; Diversification—Calculated from Google Sheets and Shared to Slack\u003c\/h3\u003e\n\u003cp\u003eThis 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 \u003cstrong\u003eSlack\u003c\/strong\u003e—on a monthly schedule.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns monthly\u003c\/strong\u003e using a schedule trigger.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLoads holdings from Google Sheets\u003c\/strong\u003e and filters to rows where \u003cem\u003eticker\u003c\/em\u003e and \u003cem\u003easset type\u003c\/em\u003e are non-empty and \u003cem\u003equantity\u003c\/em\u003e is positive.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCalculates portfolio weights\u003c\/strong\u003e per holding and retrieves \u003cstrong\u003e90 days of historical closing prices\u003c\/strong\u003e for each ticker using an \u003cstrong\u003eHTTP request\u003c\/strong\u003e to your market-data endpoint.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eComputes correlations\u003c\/strong\u003e by converting prices into daily returns, then generating a \u003cstrong\u003ePearson correlation matrix\u003c\/strong\u003e and a list of \u003cstrong\u003epairwise correlations\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDerives diversification metrics\u003c\/strong\u003e such as average correlation, diversification score, risk level, and identifies the highest\/lowest correlated pairs.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCreates a QuickChart visualization\u003c\/strong\u003e (bar chart URL) from the pairwise correlation results and requests the rendered chart image.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWrites outputs back to Google Sheets\u003c\/strong\u003e by appending the diversification summary and pairwise correlation records to dedicated tabs, then \u003cstrong\u003eposts the report to Slack\u003c\/strong\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eTrack whether your portfolio is becoming more or less diversified over time.\u003c\/li\u003e\n  \u003cli\u003eGenerate a repeatable monthly correlation report for SaaS ops, finance ops, or analysts.\u003c\/li\u003e\n  \u003cli\u003eUse Slack notifications to keep stakeholders aligned with measurable diversification metrics.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e (OAuth): reads holdings and appends results to \u003cem\u003e“Diversification Log”\u003c\/em\u003e and \u003cem\u003e“Pairwise Correlations”\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHTTP Request\u003c\/strong\u003e: fetches 90 days of historical pricing per ticker.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCode\u003c\/strong\u003e (calculations): daily returns, Pearson correlation matrix, diversification scoring.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSlack\u003c\/strong\u003e: posts the formatted diversification report.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eQuickChart\u003c\/strong\u003e: generates the bar chart visualization from correlation data.\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003e\u003cstrong\u003eSetup note:\u003c\/strong\u003e Ensure your spreadsheet has tabs named \u003cem\u003e“Portfolio Holdings”\u003c\/em\u003e, \u003cem\u003e“Diversification Log”\u003c\/em\u003e, and \u003cem\u003e“Pairwise Correlations”\u003c\/em\u003e with matching column headers.\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46164160479411,"sku":"N8N-20515","price":65.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/YlqTsK3wUboDZgjhqoV9V_QXUo3Juj.png?v=1791277491","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-portfolio-correlation-diversification-sheets-slack","provider":"N8N Commerce","version":"1.0","type":"link"}