Analyze inflation hedges with OpenAI GPT-4.1-mini and Gmail

Go to Workflow
0 views
Built by WeblineIndia WeblineIndia
Created on June 19, 2026

Description

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.

Nodes Used (3)

Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
OpenAI
@n8n/n8n-nodes-langchain.openAi