Send monthly P&L email reports with Google Sheets, GPT-4o-mini and Gmail
Needs changesWhat this workflow does
This AI workflow has 10 nodes and runs on a schedule (every month). Along the way it connects Google Sheets, OpenAI Chat Model and Gmail.
How it runs
Trigger: On a schedule (every month).
- 2. Code — Get Previous Month (Code): runs custom JavaScript code
- 3. Google Sheets — Get Income Data (Google Sheets): get many
- 4. Google Sheets — Get Expense Data (Google Sheets): get many
- 5. Code — Build P&L Statement (Code): runs custom JavaScript code
- 6. AI Agent — Generate HTML Report (AI Agent): runs an AI agent, with model: OpenAI — GPT-4o-mini Model
- 7. Code — Clean HTML Output (Code): runs custom JavaScript code
- 8. Gmail — Email Report to Finance Team (Gmail): uses Gmail
- 9. Google Sheets — Log Report Run (Google Sheets): append
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in 6. AI Agent — Generate HTML Report (v1.9): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) 6. AI Agent — Generate HTML Report (v1.9) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (6)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Gmail
n8n-nodes-base.gmail
From the author
Quick Overview This workflow runs monthly and pulls income and expense data from Google Sheets, calculates a prior-month profit and loss statement with budget vs actual variances, uses OpenAI GPT-4o-mini to generate an executive HTML report, emails it via…