Compare gold and equity performance with Google Sheets, Groq, QuickChart and Gmail
Gold vs Equity Performance Comparison Tracker with Visual Insights This automated n8n workflow evaluates the historical performance of gold against equity markets. It extracts daily price data from Google Sheets, calc...
Template notes
Gold vs Equity Performance Comparison Tracker with Visual Insights
This automated n8n workflow evaluates the historical performance of gold against equity markets. It extracts daily price data from Google Sheets, calculates comparative returns and uses an AI agent to generate actionable investment insights. Finally, it creates a visual performance chart and emails a smartly formatted HTML report—triggering a high-priority alert if the performance gap exceeds a defined threshold.
Quick Implementation Steps
1. Import the Workflow: Upload the downloaded JSON file into your n8n workspace. 2. Connect Credentials: Authenticate your Google Sheets, Gmail and Groq API accounts in their respective nodes. 3. Map Your Data: Select your specific Google Sheet documents for both the Gold and Equity data fetching nodes. 4. Set Your Parameters: Open the Set Analysis Parameters node to define your target date range and performance gap threshold. 5. Execute: Click "Test Workflow" to generate and receive your first automated financial comparison report.
What It Does
This workflow acts as an automated financial analyst. It begins by pulling day-by-day pricing for two distinct assets—Gold and Equity—from standard Google Sheets. A custom script then merges this data, ensuring dates match up perfectly while filtering out any information outside of your target date window. Once the data is aligned, the workflow calculates the percentage returns for both assets and determines the exact performance difference.
Instead of just presenting raw numbers, the workflow passes these calculated metrics to an advanced AI Agent powered by Llama-3. The AI is prompted to step into the role of an investment advisor, evaluating the numbers to declare a "winner," providing realistic market context and suggesting a strategic portfolio allocation (e.g., 60% Equity / 40% Gold) based strictly on the provided data.
To wrap it all up, the system generates a dynamic line chart URL using QuickChart.io. It packages the chart, the raw numbers and the AI's written insights into a clean HTML email. If one asset drastically outperforms the other (based on a threshold you set), the system routes the email as a special "ALERT". Finally, it logs a summary of the report back into a fresh Google Sheet for long-term record keeping.