Rapport financier mensuel avec analyses AI
Ceci est unDocument Extraction, AI Summarizationworkflow d'automatisation du domainecontenant 7 nœuds.Utilise principalement des nœuds comme Gmail, OpenAi, Function, GoogleSheets, ScheduleTrigger. Utiliser Google Sheets, GPT-4 analysis et Gmail pour automatiser les rapports financiers mensuels
- •Compte Google et informations d'identification Gmail API
- •Clé API OpenAI
- •Informations d'identification Google Sheets API
Nœuds utilisés (7)
Catégorie
{
"id": "bUnFjkLevdnP1zo7",
"meta": {
"instanceId": "a287613f1596da776459594685fbf4e2b4a12124f80ab8c8772f5e37bff103ae",
"templateCredsSetupCompleted": true
},
"name": "Finance Monthly Report with AI Insight",
"tags": [],
"nodes": [
{
"id": "c9b7416f-8164-4869-8c8a-3ae49f868334",
"name": "1. Obtenir les Transactions Financières (Google Sheets)",
"type": "n8n-nodes-base.googleSheets",
"position": [
380,
140
],
"parameters": {
"range": "FinanceSummary!A:E",
"options": {},
"sheetId": "<YOUR_GOOGLE_SHEET_ID_HERE>"
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "MSnszF5oRAiSGHDo",
"name": "temp"
}
},
"description": "Reads monthly finance transaction data from the specified Google Sheet.",
"typeVersion": 2
},
{
"id": "6b2dbe34-e3f0-4ca3-b5ca-3a6c3e027ad2",
"name": "2. Filtrer les Transactions du Mois Précédent",
"type": "n8n-nodes-base.function",
"position": [
600,
140
],
"parameters": {
"functionCode": "// Filter transactions for the previous month\nconst rows = items.map(item => item.json);\n\nconst now = new Date();\nconst lastMonthStart = new Date(now.getFullYear(), now.getMonth() - 1, 1); // First day of previous month\nconst lastMonthEnd = new Date(now.getFullYear(), now.getMonth(), 0); // Last day of previous month\n\nconst filtered = rows.filter(row => {\n // Ensure 'Date' column exists and is a valid date format\n if (!row.Date) return false;\n const date = new Date(row.Date); \n return date >= lastMonthStart && date <= lastMonthEnd;\n});\n\nreturn filtered.map(row => ({ json: row }));"
},
"description": "Filters the raw data to only include transactions from the previous full month.",
"typeVersion": 1
},
{
"id": "869519eb-0879-4f0d-8a21-4035b69df097",
"name": "3. Générer des Insights Financiers par IA",
"type": "n8n-nodes-base.openAi",
"position": [
820,
140
],
"parameters": {
"model": "gpt-4",
"prompt": "You are a finance assistant. Analyze the following transaction data. Calculate the total income and total expense for the period. Then, provide 3 concise bullet-point financial insights based on the data. Structure your output clearly:\n\nTotal Income: [Amount]\nTotal Expense: [Amount]\nKey Insights:\n- [Insight 1]\n- [Insight 2]\n- [Insight 3]\n\nTransactions:\n{{JSON.stringify($json, null, 2)}}",
"options": {},
"requestOptions": {}
},
"credentials": {
"openAiApi": {
"id": "WbMi3ZLLBnECFAAV",
"name": "Temp"
}
},
"description": "Uses OpenAI (GPT-4) to generate a summary of income, expenses, and key financial insights.",
"typeVersion": 1
},
{
"id": "d8d4588b-9761-4bef-a427-ff3282c1b12e",
"name": "4. Envoyer l'Email du Rapport Financier Mensuel",
"type": "n8n-nodes-base.gmail",
"position": [
1040,
140
],
"parameters": {
"subject": "Monthly Finance Summary and AI Insights",
"additionalFields": {}
},
"credentials": {
"gmailOAuth2": {
"id": "QFfaHpKmgq4YPiRN",
"name": "Temp"
}
},
"description": "Composes and sends the monthly finance report email, including transaction details and AI insights.",
"typeVersion": 1
},
{
"id": "f7d8accf-7532-4289-b564-4d2e566ff83b",
"name": "Déclencheur Planifié",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
160,
140
],
"parameters": {
"rule": {
"interval": [
{
"field": "months"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "9931672d-4382-490b-8ed8-68f84aba39c2",
"name": "Note Adhésive",
"type": "n8n-nodes-base.stickyNote",
"position": [
60,
80
],
"parameters": {
"color": 3,
"width": 1220,
"height": 240,
"content": "## Flow\n"
},
"typeVersion": 1
},
{
"id": "31db7ae7-de61-4b2e-b38b-89d33bf0ee5c",
"name": "Note Adhésive1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1300,
80
],
"parameters": {
"color": 4,
"width": 680,
"height": 1680,
"content": "# Workflow Documentation: Finance Monthly Report with AI Insight\n\n## Problem\n\nMany businesses struggle with manual, time-consuming financial reporting processes. This often leads to:\n* Delayed access to critical financial insights.\n* Lack of proactive decision-making due to retrospective data analysis.\n* Inaccurate or inconsistent reports due to human error in data compilation.\n* Underutilization of financial data for strategic planning.\n\n## Solution\n\nThis n8n workflow automates the monthly financial reporting process by:\n1. **Extracting Data:** Automatically pulls transaction data from Google Sheets.\n2. **Filtering & Processing:** Filters the data to focus on the previous month's transactions.\n3. **AI-Powered Insights:** Utilizes OpenAI (GPT-4) to analyze filtered data and generate a summary of income, expenses, along with key financial insights.\n4. **Automated Delivery:** Compiles the raw data (previous month's transactions) and the AI-generated insights into a well-formatted email and sends it to the designated recipients.\n\nThis ensures timely, accurate, and insightful financial reporting with minimal manual effort.\n\n## For Who\n\nThis workflow is ideal for:\n* **Small to Medium-sized Businesses (SMBs):** Who need regular financial oversight but lack dedicated finance teams or extensive ERP systems.\n* **Startup Founders:** Needing quick and reliable financial summaries to monitor burn rate and performance.\n* **Finance Managers/Accountants:** Looking to automate routine reporting tasks to focus on more strategic analysis.\n* **E-commerce Businesses:** To quickly understand monthly revenue and expenditure trends.\n\n## Scope\n\n* **Input Data Source:** Google Sheets (specifically configured for finance transaction data with 'Date', 'Category', 'Description', 'Amount', 'Type' columns).\n* **AI Model:** OpenAI's GPT-4 (requires an OpenAI API Key).\n* **Output Medium:** Email (via Gmail integration).\n* **Frequency:** Designed to run monthly (configurable via Cron trigger).\n* **Output Content:** Previous month's transaction table, total income, total expense, and 3 AI-generated financial insights.\n\n## How to Set Up\n\n1. **Import Workflow:** Import this JSON into your n8n instance.\n2. **Configure Google Sheets Node:**\n * Connect your Google Sheets account credential.\n * Update `sheetId` to your specific Google Sheet ID.\n * Ensure your sheet contains relevant columns (e.g., Date, Category, Description, Amount, Type) in the 'FinanceSummary' tab or adjust the `range` if your sheet name/range differs.\n3. **Configure OpenAI Node:**\n * Connect your OpenAI API Key credential.\n * (Optional) Adjust the prompt for different insights or output formats.\n4. **Configure Gmail Node:**\n * Connect your Gmail account credential.\n * Update `fromEmail` and `toEmail` with your desired sender and recipient addresses.\n5. **Add Cron Trigger Node:**\n * Add a `Cron` node as the first step.\n * Configure it to run on the desired schedule (e.g., 'every month', 'on the 1st day of the month').\n6. **Activate Workflow:** Save and activate the workflow.\n\n**Important Notes:**\n* Ensure your Google Sheet data format is consistent for accurate filtering and AI analysis.\n* Monitor your OpenAI token usage to manage costs.\n* Consider adding error handling (e.g., sending an alert email if the workflow fails)."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "fbd3aed3-1704-40c9-a85c-55cfec0e33bc",
"connections": {
"f7d8accf-7532-4289-b564-4d2e566ff83b": {
"main": [
[
{
"node": "c9b7416f-8164-4869-8c8a-3ae49f868334",
"type": "main",
"index": 0
}
]
]
},
"869519eb-0879-4f0d-8a21-4035b69df097": {
"main": [
[
{
"node": "d8d4588b-9761-4bef-a427-ff3282c1b12e",
"type": "main",
"index": 0
}
]
]
},
"6b2dbe34-e3f0-4ca3-b5ca-3a6c3e027ad2": {
"main": [
[
{
"node": "869519eb-0879-4f0d-8a21-4035b69df097",
"type": "main",
"index": 0
}
]
]
},
"c9b7416f-8164-4869-8c8a-3ae49f868334": {
"main": [
[
{
"node": "6b2dbe34-e3f0-4ca3-b5ca-3a6c3e027ad2",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Intermédiaire - Extraction de documents, Résumé IA
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Marth
@marthSimplifying Business with Smart Automation. I create and share user-friendly, highly efficient n8n workflow templates for SMEs, focusing on digital marketing, sales, and operational excellence. Get ready to automate, innovate, and elevate your business. Connect me on Linkedin for custom solutions.
Partager ce workflow