AIによる財務レポート

中級

これはDocument Extraction, AI Summarization分野の自動化ワークフローで、7個のノードを含みます。主にGmail, OpenAi, Function, GoogleSheets, ScheduleTriggerなどのノードを使用。 Google Sheets、GPT-4の分析とGmailを使って月次財務レポートを自動化

前提条件
  • Googleアカウント + Gmail API認証情報
  • OpenAI API Key
  • Google Sheets API認証情報

カテゴリー

ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "bUnFjkLevdnP1zo7",
  "meta": {
    "instanceId": "a287613f1596da776459594685fbf4e2b4a12124f80ab8c8772f5e37bff103ae",
    "templateCredsSetupCompleted": true
  },
  "name": "Finance Monthly Report with AI Insight",
  "tags": [],
  "nodes": [
    {
      "id": "c9b7416f-8164-4869-8c8a-3ae49f868334",
      "name": "財務取引データの取得 (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": "前月の取引データをフィルタリング",
      "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": "AIによる財務分析の生成",
      "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": "月次財務報告メールの送信",
      "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": "スケジュールトリガー",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        160,
        140
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "months"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9931672d-4382-490b-8ed8-68f84aba39c2",
      "name": "付箋",
      "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": "付箋1",
      "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
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - 文書抽出, AI要約

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
中級
ノード数7
カテゴリー2
ノードタイプ6
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

作成者
Marth

Marth

@marth

Simplifying 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.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34