n8n + Google Sheets + Gemini + Slack + Gmail
This workflow automatically analyzes portfolio data from Google Sheets on a scheduled basis, calculates exposure metrics such as sector allocation and concentration and generates a professional risk summary using Google Gemini. The report is then sent via email, shared on Slack and logged for historical tracking.
This workflow performs a complete portfolio risk analysis pipeline. It starts by fetching portfolio data from a Google Sheet and validating whether the required data exists. If valid data is present, it calculates key exposure metrics such as total portfolio value, sector allocation and concentration levels using a Code node.
These calculated metrics are then passed to an AI model (Google Gemini), which generates a concise and professional risk summary. The workflow ensures the output is structured properly before preparing a final report.
The final output is distributed through multiple channels: an email report, a Slack notification and a log entry in Google Sheets. If no portfolio data is available, the workflow gracefully handles the scenario by generating a fallback report and logging it.
Use "Read Portfolio From Sheet" node
Ensure sheet contains columns like:
Code node calculates:
"Prepare Risk Report Data" formats final fields:
If no portfolio data exists:
| Issue | Possible Cause | Solution |
|---|---|---|
| No data processed | Empty Google Sheet | Ensure portfolio data exists |
| AI output not parsed | Invalid JSON response | Check prompt format or parsing node |
| Email not sent | Gmail credentials missing | Reconnect Gmail account |
| Slack message not delivered | Incorrect channel setup | Verify Slack channel ID |
| Incorrect calculations | Missing numeric values | Validate sheet data types |
If you need assistance setting up this workflow, customizing it for your business or building advanced automation solutions, feel free to reach out to our n8n automation developers at WeblineIndia / Global. Our team specializes in building scalable and production-ready automation workflows tailored to your needs.