Quick Overview
This workflow runs manually to calculate inflation-adjusted (real) returns for a set of commodities versus a savings rate, then uses OpenAI to generate a structured analysis and emails the final report via Gmail.
How it works
- Starts when you run the workflow manually.
- Loads the provided inflation rate, savings return, and a list of commodity nominal returns, then validates that inflation is greater than 0 and savings return is at least 0.
- Calculates the real return for savings and each commodity (nominal return minus inflation) and flags whether each commodity beats the savings real return.
- Evaluates each commodity and labels it as a good or bad inflation hedge based on whether it outperforms savings after inflation.
- Aggregates all labeled commodity results and sends them to OpenAI to identify the best hedge, explain the reasoning, compare against savings, and produce beginner-friendly advice in JSON format.
- Parses the AI response and sends an HTML email report with the findings through Gmail.
Setup
- Add OpenAI API credentials (or use the configured n8n OpenAI credits) and confirm the selected model in the OpenAI step.
- Add a Gmail OAuth2 credential and set the recipient email address in the Gmail send step.
- Update the input values (inflation, savings_return, and the commodities list with name and return) to match your own data before executing the workflow.