This workflow corresponds to n8n.io template #11903 — we link there as the canonical source.
This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "iFr0hONfL3Hlzf0V",
"name": "Automated Cash Flow and Tax Forecasting Engine",
"tags": [],
"nodes": [
{
"id": "f9dc68c5-25b6-4a9f-82b8-258e06518106",
"name": "Monthly Schedule",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-176,
688
],
"parameters": {
"rule": {
"interval": [
{
"field": "months",
"triggerAtHour": 9
}
]
}
},
"typeVersion": 1.3
},
{
"id": "604f8d15-5d91-4182-9ddf-859db8a656dd",
"name": "Workflow Configuration",
"type": "n8n-nodes-base.set",
"position": [
48,
688
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "revenueSource1Url",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Revenue Source 1 API URL__>"
},
{
"id": "id-2",
"name": "revenueSource2Url",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Revenue Source 2 API URL__>"
},
{
"id": "id-3",
"name": "revenueSource3Url",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Revenue Source 3 API URL__>"
},
{
"id": "id-4",
"name": "taxAgentEmail",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Tax Agent Email Address__>"
},
{
"id": "id-5",
"name": "googleSheetId",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Google Sheet ID for storing forecasts__>"
},
{
"id": "id-6",
"name": "incomeTaxRate",
"type": "number",
"value": 0.25
},
{
"id": "id-7",
"name": "vatRate",
"type": "number",
"value": 0.2
},
{
"id": "id-8",
"name": "gstRate",
"type": "number",
"value": 0.1
},
{
"id": "id-9",
"name": "withholdingTaxRate",
"type": "number",
"value": 0.15
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "d4e8c469-f63e-484e-840e-d2476d636625",
"name": "Fetch Revenue Data - Source 1",
"type": "n8n-nodes-base.httpRequest",
"position": [
272,
640
],
"parameters": {
"url": "={{ $('Workflow Configuration').first().json.revenueSource1Url }}",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "3eeba1cd-6644-426a-939d-8dc4df4e223f",
"name": "Fetch Revenue Data - Source 2",
"type": "n8n-nodes-base.httpRequest",
"position": [
272,
816
],
"parameters": {
"url": "={{ $('Workflow Configuration').first().json.revenueSource2Url }}",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "2a341163-83ae-4ad2-8c93-3db7b13bca0b",
"name": "Fetch Revenue Data - Source 3",
"type": "n8n-nodes-base.httpRequest",
"position": [
272,
976
],
"parameters": {
"url": "={{ $('Workflow Configuration').first().json.revenueSource3Url }}",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "ed1f5bf4-6735-4dae-a0df-5919d94014dd",
"name": "Aggregate Revenue Data",
"type": "n8n-nodes-base.aggregate",
"position": [
496,
688
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1
},
{
"id": "49c2a883-5146-44de-82a7-6d740971640e",
"name": "Tax Forecasting AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
720,
688
],
"parameters": {
"text": "={{ $json.data }}",
"options": {
"systemMessage": "You are a tax forecasting AI assistant specialized in analyzing multi-channel revenue data and predicting tax liabilities.\n\nYour task is to:\n1. Analyze the aggregated revenue data from multiple sources\n2. Calculate upcoming tax liabilities for:\n - Income Tax (using rate from workflow config)\n - VAT/Sales Tax (using rate from workflow config)\n - GST (using rate from workflow config)\n - Withholding Tax (using rate from workflow config)\n3. Generate rolling forecasts for the next 3, 6, and 12 months\n4. Identify trends, seasonal patterns, and potential tax optimization opportunities\n5. Provide actionable insights and recommendations\n\nReturn your analysis in the structured JSON format defined by the output parser."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3.1
},
{
"id": "b571dc28-3775-4b1f-8eef-9ee71fff09c4",
"name": "OpenAI GPT-4",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
728,
912
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "gpt-4o"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "048cfd4c-1fff-403e-9284-ebe8ad9ac376",
"name": "Structured Forecast Output",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
856,
912
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"forecastPeriod\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"description\": \"The forecast period (e.g., Q1 2024, Next 3 months)\"\n\t\t},\n\t\t\"totalRevenue\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"description\": \"Total aggregated revenue across all sources\"\n\t\t},\n\t\t\"incomeTaxLiability\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"description\": \"Predicted income tax liability\"\n\t\t},\n\t\t\"vatLiability\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"description\": \"Predicted VAT liability\"\n\t\t},\n\t\t\"gstLiability\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"description\": \"Predicted GST liability\"\n\t\t},\n\t\t\"withholdingTaxLiability\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"description\": \"Predicted withholding tax liability\"\n\t\t},\n\t\t\"totalTaxLiability\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"description\": \"Total predicted tax liability\"\n\t\t},\n\t\t\"forecast3Months\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"description\": \"Revenue and tax forecast for next 3 months\"\n\t\t},\n\t\t\"forecast6Months\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"description\": \"Revenue and tax forecast for next 6 months\"\n\t\t},\n\t\t\"forecast12Months\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"description\": \"Revenue and tax forecast for next 12 months\"\n\t\t},\n\t\t\"insights\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"description\": \"Key insights and recommendations\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t},\n\t\t\"trends\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"description\": \"Identified trends and patterns\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t}\n\t}\n}"
},
"typeVersion": 1.3
},
{
"id": "7270848f-2c5b-468c-993f-7344208a4d9b",
"name": "Format Report Data",
"type": "n8n-nodes-base.set",
"position": [
1072,
688
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "reportDate",
"type": "string",
"value": "={{ $now.format('yyyy-MM-dd') }}"
},
{
"id": "id-2",
"name": "reportTitle",
"type": "string",
"value": "Monthly Tax Forecast Report"
},
{
"id": "id-3",
"name": "emailSubject",
"type": "string",
"value": "={{ 'Tax Forecast Report - ' + $now.format('MMMM yyyy') }}"
},
{
"id": "id-4",
"name": "emailBody",
"type": "string",
"value": "={{ 'Dear Tax Agent,\\n\\nPlease find attached the monthly tax forecast report for ' + $now.format('MMMM yyyy') + '.\\n\\nKey Highlights:\\n- Total Revenue: $' + $json.totalRevenue + '\\n- Total Tax Liability: $' + $json.totalTaxLiability + '\\n- Income Tax: $' + $json.incomeTaxLiability + '\\n- VAT: $' + $json.vatLiability + '\\n- GST: $' + $json.gstLiability + '\\n- Withholding Tax: $' + $json.withholdingTaxLiability + '\\n\\nBest regards,\\nAutomated Tax Forecasting System' }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "1af0209b-6e89-42d6-a17d-d46e3dbd464e",
"name": "Send Report to Tax Agent",
"type": "n8n-nodes-base.gmail",
"position": [
1296,
736
],
"parameters": {
"sendTo": "={{ $('Workflow Configuration').first().json.taxAgentEmail }}",
"message": "={{ $json.emailBody }}",
"options": {},
"subject": "={{ $json.emailSubject }}",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "49a18646-938b-4852-a451-ec03a5385cae",
"name": "Store in Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
1312,
960
],
"parameters": {
"columns": {
"value": {
"reportDate": "={{ $json.reportDate }}",
"gstLiability": "={{ $json.gstLiability }}",
"totalRevenue": "={{ $json.totalRevenue }}",
"vatLiability": "={{ $json.vatLiability }}",
"forecastPeriod": "={{ $json.forecastPeriod }}",
"totalTaxLiability": "={{ $json.totalTaxLiability }}",
"incomeTaxLiability": "={{ $json.incomeTaxLiability }}",
"withholdingTaxLiability": "={{ $json.withholdingTaxLiability }}"
},
"schema": [
{
"id": "reportDate",
"required": false,
"displayName": "reportDate",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "forecastPeriod",
"required": false,
"displayName": "forecastPeriod",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "totalRevenue",
"required": false,
"displayName": "totalRevenue",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "incomeTaxLiability",
"required": false,
"displayName": "incomeTaxLiability",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "vatLiability",
"required": false,
"displayName": "vatLiability",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "gstLiability",
"required": false,
"displayName": "gstLiability",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "withholdingTaxLiability",
"required": false,
"displayName": "withholdingTaxLiability",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "totalTaxLiability",
"required": false,
"displayName": "totalTaxLiability",
"defaultMatch": true,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [
"reportDate"
]
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "name",
"value": "Tax Forecasts"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Workflow Configuration').first().json.googleSheetId }}"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "acfed971-0b3e-4bd8-aae9-bec3c3b604a1",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
208
],
"parameters": {
"width": 560,
"height": 256,
"content": "## How It Works \nAutomates monthly revenue aggregation from multiple sources with intelligent tax forecasting using GPT-4 structured analysis. Fetches revenue data from up to three distinct sources, consolidates datasets into unified records, applies OpenAI GPT-4 model for predictive tax obligation forecasting with context awareness. System generates formatted reports with structured forecast outputs and automatically sends comprehensive tax projections to agents via Gmail, storing results in Google Sheets for audit trails. Designed for tax professionals, accounting firms, and finance teams requiring accurate predictive tax planning, cash flow forecasting, and proactive compliance strategy without manual calculations."
},
"typeVersion": 1
},
{
"id": "97290656-5943-4eca-8ac9-e77b12ee147a",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
336,
208
],
"parameters": {
"color": 3,
"width": 288,
"height": 256,
"content": "\n## Setup Steps \n1. Configure OpenAI API key for GPT-4 model access\n2. Connect three revenue data sources \n3. Map data aggregation logic for multi-source consolidation\n4. Define structured output schema for forecast results\n5. Set up Gmail \n6. Configure Google Sheets destination "
},
"typeVersion": 1
},
{
"id": "c2d42048-9d7a-4821-a412-a09568ec4975",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
208
],
"parameters": {
"color": 4,
"width": 288,
"height": 240,
"content": "## Prerequisites \nOpenAI API key with GPT-4 access, Gmail account, Google Sheets, three revenue data source credentials \n\n## Use Cases \nMonthly tax liability projections, quarterly estimated tax planning"
},
"typeVersion": 1
},
{
"id": "7afef741-3c81-46d1-b861-a42c37d23b8a",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
944,
208
],
"parameters": {
"color": 5,
"width": 336,
"height": 240,
"content": "## Customization \nAdjust forecast model parameters, add additional revenue sources, modify email templates \n\n## Benefits \nEliminates manual tax calculations, enables proactive tax planning, improves cash flow forecasting accuracy "
},
"typeVersion": 1
},
{
"id": "86731467-d834-4ced-b984-19c1128af68d",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
208,
496
],
"parameters": {
"color": 7,
"width": 464,
"height": 640,
"content": "## Multi-Source Data Aggregation:\nFetches revenue data from three distinct sources and consolidates into unified dataset, capturing complete revenue picture across all operational channels."
},
"typeVersion": 1
},
{
"id": "8446acf0-d617-47a3-b99a-1ebc3677d248",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
688,
496
],
"parameters": {
"color": 7,
"width": 326,
"height": 640,
"content": "## Tax Forecasting AI Agent:\n\nGPT-4 model predicts tax obligations with intelligent, context-aware tax projections based on patterns and historical data.\n"
},
"typeVersion": 1
},
{
"id": "11f4e118-37c6-4344-b726-84aa34d3f41d",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
496
],
"parameters": {
"color": 7,
"width": 432,
"height": 464,
"content": "## Monthly Schedule Trigger:\nInitiates workflow on consistent monthly cycle to ensure regular forecasting aligned with financial planning periods."
},
"typeVersion": 1
},
{
"id": "45ba5dae-954f-430f-8254-37664e03de52",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
1040,
496
],
"parameters": {
"color": 7,
"width": 464,
"height": 656,
"content": "## Report Generation & Distribution:\nFormats presentation-ready forecast documentation and sends via Gmail to tax agents, maintaining communication workflow with tax professionals."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"availableInMCP": false,
"executionOrder": "v1"
},
"versionId": "fe2bae0e-0987-46cc-ada9-e60398b5860e",
"connections": {
"OpenAI GPT-4": {
"ai_languageModel": [
[
{
"node": "Tax Forecasting AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Monthly Schedule": {
"main": [
[
{
"node": "Workflow Configuration",
"type": "main",
"index": 0
}
]
]
},
"Format Report Data": {
"main": [
[
{
"node": "Send Report to Tax Agent",
"type": "main",
"index": 0
},
{
"node": "Store in Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Aggregate Revenue Data": {
"main": [
[
{
"node": "Tax Forecasting AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Workflow Configuration": {
"main": [
[
{
"node": "Fetch Revenue Data - Source 1",
"type": "main",
"index": 0
},
{
"node": "Fetch Revenue Data - Source 2",
"type": "main",
"index": 0
},
{
"node": "Fetch Revenue Data - Source 3",
"type": "main",
"index": 0
}
]
]
},
"Tax Forecasting AI Agent": {
"main": [
[
{
"node": "Format Report Data",
"type": "main",
"index": 0
}
]
]
},
"Structured Forecast Output": {
"ai_outputParser": [
[
{
"node": "Tax Forecasting AI Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Fetch Revenue Data - Source 1": {
"main": [
[
{
"node": "Aggregate Revenue Data",
"type": "main",
"index": 0
}
]
]
},
"Fetch Revenue Data - Source 2": {
"main": [
[
{
"node": "Aggregate Revenue Data",
"type": "main",
"index": 0
}
]
]
},
"Fetch Revenue Data - Source 3": {
"main": [
[
{
"node": "Aggregate Revenue Data",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googleSheetsOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Automates monthly revenue aggregation from multiple sources with intelligent tax forecasting using GPT-4 structured analysis. Fetches revenue data from up to three distinct sources, consolidates datasets into unified records, applies OpenAI GPT-4 model for predictive tax…
Source: https://n8n.io/workflows/11903/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n automation workflow automates the creation, scripting, production, and posting of YouTube videos. It leverages AI (OpenAI), image generation (PIAPI), video rendering (Shotstack), and platform
Created by: Peyton Leveillee Last updated: October 2025
SEO Blog Article Generation Workflow. Uses outputParserStructured, httpRequest, agent, lmChatOpenAi. Scheduled trigger; 56 nodes.
This workflow was born out of a very real problem.
This workflow automates end-to-end ESG (Environmental, Social, and Governance) sustainability reporting for enterprise sustainability teams, compliance officers, and green governance leads. It solves