AutomationFlowsAI & RAG › Reconcile Bank Transactions and Generate Reports with Gpt-4 and Gmail

Reconcile Bank Transactions and Generate Reports with Gpt-4 and Gmail

ByCheng Siong Chin @cschin on n8n.io

This workflow automates end-to-end financial transaction processing for finance teams managing high-volume bank data. It eliminates manual reconciliation by intelligently classifying transactions, detecting anomalies, and generating executive summaries. The system pulls…

Cron / scheduled trigger★★★★★ complexityAI-powered38 nodesHTTP RequestAgentOpenAI ChatOutput Parser StructuredTool CalculatorGmail ToolGmail
AI & RAG Trigger: Cron / scheduled Nodes: 38 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #12377 — 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 →

Download .json
{
  "id": "vsRRuGHOzwLsQav9",
  "name": "AI-Powered Financial Transaction Reconciliation & Reporting System",
  "tags": [],
  "nodes": [
    {
      "id": "ae0e5b32-ed1c-42ec-9a6e-de0894775abd",
      "name": "Daily Accounting Run",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -3840,
        76
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 2
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "6799a8cd-238b-44b0-9bcb-f3708e29ae21",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -3616,
        76
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "bankApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Bank API endpoint URL__>"
            },
            {
              "id": "id-2",
              "name": "accountingSystemApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Accounting system API endpoint URL__>"
            },
            {
              "id": "id-3",
              "name": "journalEntryApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Journal entry posting API endpoint__>"
            },
            {
              "id": "id-4",
              "name": "taxAgentEmail",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Tax agent email address__>"
            },
            {
              "id": "id-5",
              "name": "summaryRecipientEmail",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Summary report recipient email__>"
            },
            {
              "id": "id-6",
              "name": "companyName",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Company name__>"
            },
            {
              "id": "id-7",
              "name": "fiscalYearEnd",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Fiscal year end date__>"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "c520e733-cbec-42e1-89a6-51b4b7213cf9",
      "name": "Fetch Bank Transactions",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3392,
        -20
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.bankApiUrl }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "6eef8122-bf5f-4c87-a9ea-c7b20f01b77a",
      "name": "Fetch Accounting System Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3392,
        172
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.accountingSystemApiUrl }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "90c51b7b-7bd9-462e-94ef-0fc97ab2dfdc",
      "name": "Combine Financial Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        -3168,
        76
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "923d3dd4-6ca8-4484-a47c-c06efa33abff",
      "name": "Transaction Classifier Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2944,
        76
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are an expert accounting transaction classifier.\n\nYour task is to:\n1. Analyze each transaction from the provided financial data\n2. Classify transactions into appropriate accounting categories (e.g., Revenue, Expense, Asset, Liability, Equity)\n3. Assign proper account codes based on the chart of accounts\n4. Identify transaction types (e.g., sales, purchases, payroll, utilities)\n5. Flag any unusual or suspicious transactions for review\n\nReturn structured data with transaction ID, classification, account code, category, and any flags."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "bb5d43b8-7065-408e-b433-f3ccee475975",
      "name": "Account Reconciliation Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2592,
        76
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are an expert account reconciliation specialist.\n\nYour task is to:\n1. Compare bank transactions with accounting system records\n2. Match corresponding entries between both systems\n3. Identify discrepancies, missing entries, or duplicates\n4. Calculate reconciliation differences\n5. Determine the cause of any variances\n6. Suggest corrective actions for unmatched items\n\nReturn structured reconciliation results with matched items, unmatched items, discrepancies, and recommended actions."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "2f75b025-2203-4d52-b087-8a01bf70d81c",
      "name": "Journal Entry Generator Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2240,
        76
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are an expert accounting journal entry specialist.\n\nYour task is to:\n1. Create proper double-entry journal entries for all transactions\n2. Ensure debits equal credits for each entry\n3. Use correct account codes from the chart of accounts\n4. Include proper descriptions and references\n5. Apply appropriate posting dates\n6. Follow GAAP or IFRS accounting standards\n\nReturn structured journal entries with entry number, date, account codes, descriptions, debit amounts, credit amounts, and references."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "6620cd01-96d6-4bab-8db2-1877e28a07fa",
      "name": "Error Detection Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1888,
        16
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are an expert accounting error detection specialist.\n\nYour task is to:\n1. Review all journal entries for mathematical accuracy\n2. Verify debits equal credits\n3. Check for duplicate entries\n4. Identify posting to incorrect accounts\n5. Detect unusual amounts or patterns\n6. Flag entries that violate accounting principles\n7. Assess severity of each error (Critical, High, Medium, Low)\n\nReturn structured error reports with error type, description, affected entries, severity level, and recommended corrections."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "ce5d490f-a6a5-44ec-a721-bd274420f0e0",
      "name": "Financial Statement Generator Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1312,
        16
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are an expert financial statement preparation specialist.\n\nYour task is to:\n1. Generate a complete Balance Sheet with Assets, Liabilities, and Equity\n2. Create an Income Statement with Revenue and Expenses\n3. Prepare a Cash Flow Statement with Operating, Investing, and Financing activities\n4. Calculate key financial ratios and metrics\n5. Ensure all statements balance and reconcile\n6. Format statements according to accounting standards\n\nReturn structured financial statements with all line items, subtotals, totals, and financial ratios."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "234ffdb4-8e2a-4ac4-b7ce-936741982959",
      "name": "Tax Report Generator Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -960,
        16
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are an expert tax reporting specialist.\n\nYour task is to:\n1. Calculate taxable income from financial statements\n2. Identify deductible expenses and allowable deductions\n3. Compute tax liabilities (income tax, sales tax, payroll tax)\n4. Prepare tax schedules and supporting documentation\n5. Ensure compliance with current tax regulations\n6. Identify tax planning opportunities\n7. Flag items requiring tax agent review\n\nReturn structured tax reports with taxable income, deductions, tax calculations, schedules, and items for tax agent review."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "462fabc3-a3ec-4070-a39d-a473146bd520",
      "name": "Tax Agent Communication Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -592,
        -32
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are an expert tax communication specialist.\n\nYour task is to:\n1. Review the tax report and identify items requiring tax agent consultation\n2. Compose a professional email to the tax agent\n3. Summarize key tax findings and questions\n4. Attach relevant tax schedules and documentation references\n5. Request specific guidance on complex tax matters\n6. Set appropriate follow-up expectations\n\nUse the Gmail Tool to send the email to the tax agent with a clear subject line and comprehensive summary."
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "263fbed0-d244-494a-a483-1ff591a8011d",
      "name": "OpenAI GPT-4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -592,
        128
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "aa64d95c-8d57-4b74-8095-d1e0342e8b29",
      "name": "Transaction Classification Schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -2808,
        300
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"transactionId\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"category\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"accountCode\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"accountName\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"transactionType\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"amount\": {\n\t\t\t\"type\": \"number\"\n\t\t},\n\t\t\"flags\": {\n\t\t\t\"type\": \"array\",\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": "fbd3dbb1-0270-4d09-8c5d-d2893e9b01b0",
      "name": "Reconciliation Schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -2456,
        300
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"matchedItems\": [\n\t\t{\n\t\t\t\"bankTransactionId\": \"BNK-001\",\n\t\t\t\"systemTransactionId\": \"SYS-001\",\n\t\t\t\"amount\": 1500.00,\n\t\t\t\"date\": \"2024-01-15\",\n\t\t\t\"description\": \"Invoice Payment\"\n\t\t}\n\t],\n\t\"unmatchedBankItems\": [\n\t\t{\n\t\t\t\"transactionId\": \"BNK-002\",\n\t\t\t\"amount\": 250.00,\n\t\t\t\"date\": \"2024-01-16\",\n\t\t\t\"description\": \"Unknown Deposit\"\n\t\t}\n\t],\n\t\"unmatchedSystemItems\": [\n\t\t{\n\t\t\t\"transactionId\": \"SYS-002\",\n\t\t\t\"amount\": 300.00,\n\t\t\t\"date\": \"2024-01-17\",\n\t\t\t\"description\": \"Pending Payment\"\n\t\t}\n\t],\n\t\"discrepancies\": [\n\t\t{\n\t\t\t\"amount\": 50.00,\n\t\t\t\"reason\": \"Bank fee not recorded in system\"\n\t\t}\n\t],\n\t\"totalDifference\": 50.00,\n\t\"recommendedActions\": [\n\t\t\"Investigate unknown deposit BNK-002\",\n\t\t\"Follow up on pending payment SYS-002\",\n\t\t\"Record bank fee in accounting system\"\n\t]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a4cae654-b049-4fe2-b631-1ea8040119ce",
      "name": "Journal Entry Schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -2104,
        300
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"entryNumber\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"date\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"entries\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"accountCode\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"accountName\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"debit\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"credit\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"totalDebit\": {\n\t\t\t\"type\": \"number\"\n\t\t},\n\t\t\"totalCredit\": {\n\t\t\t\"type\": \"number\"\n\t\t},\n\t\t\"reference\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "fe84eaf9-24b5-4d4f-a133-1b7c6a94bb1e",
      "name": "Error Detection Schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1744,
        240
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"errors\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"errorType\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"affectedEntries\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"severity\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"recommendedCorrection\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"errorCount\": {\n\t\t\t\"type\": \"number\"\n\t\t},\n\t\t\"criticalErrorCount\": {\n\t\t\t\"type\": \"number\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "5d959c55-317f-46da-b22e-dc7d14be2527",
      "name": "Financial Statement Schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1168,
        240
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"balanceSheet\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"properties\": {\n\t\t\t\t\"assets\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"liabilities\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"equity\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"incomeStatement\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"properties\": {\n\t\t\t\t\"revenue\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"expenses\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"netIncome\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"cashFlowStatement\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"properties\": {\n\t\t\t\t\"operating\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"investing\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"financing\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"financialRatios\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"properties\": {\n\t\t\t\t\"currentRatio\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"debtToEquity\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"profitMargin\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "5f881f22-518a-487c-a5b8-1750d3e86409",
      "name": "Tax Report Schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -816,
        240
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"taxableIncome\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"description\": \"Total taxable income\"\n\t\t},\n\t\t\"deductions\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"type\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"amount\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"taxLiability\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"properties\": {\n\t\t\t\t\"incomeTax\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"salesTax\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t},\n\t\t\t\t\"payrollTax\": {\n\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"schedules\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\"\n\t\t\t}\n\t\t},\n\t\t\"itemsForReview\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t},\n\t\t\"taxPlanningOpportunities\": {\n\t\t\t\"type\": \"array\",\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": "a42bbbf7-c8ac-484b-8962-6cf43cb815e6",
      "name": "Calculator Tool",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        -1872,
        240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dfa22c7d-5ae4-409e-8e79-1cf382e49b08",
      "name": "Gmail Tool",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        -432,
        128
      ],
      "parameters": {
        "sendTo": "={{ $fromAI('taxAgentEmail') }}",
        "message": "={{ $fromAI('emailBody') }}",
        "options": {},
        "subject": "={{ $fromAI('emailSubject') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4409a30a-4394-485b-a094-a44682e9024e",
      "name": "Post Journal Entries to System",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -544,
        304
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.journalEntryApiUrl }}",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ $json }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "82b233c0-981e-4063-9b08-515558030634",
      "name": "Format Final Report",
      "type": "n8n-nodes-base.set",
      "position": [
        -32,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "reportTitle",
              "type": "string",
              "value": "Autonomous Accounting System - Daily Report"
            },
            {
              "id": "id-2",
              "name": "companyName",
              "type": "string",
              "value": "={{ $('Workflow Configuration').first().json.companyName }}"
            },
            {
              "id": "id-3",
              "name": "reportDate",
              "type": "string",
              "value": "={{ $now.toFormat('yyyy-MM-dd') }}"
            },
            {
              "id": "id-4",
              "name": "summary",
              "type": "string",
              "value": "All accounting tasks completed successfully"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "5fcfdb5a-0b8c-4a94-b521-ba50e07f5d06",
      "name": "Send Summary Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        192,
        160
      ],
      "parameters": {
        "sendTo": "={{ $('Workflow Configuration').first().json.summaryRecipientEmail }}",
        "message": "=<h2>{{ $json.reportTitle }}</h2><p><strong>Company:</strong> {{ $json.companyName }}</p><p><strong>Date:</strong> {{ $json.reportDate }}</p><p><strong>Status:</strong> {{ $json.summary }}</p><p>All accounting tasks have been completed autonomously. Please review the attached details.</p>",
        "options": {},
        "subject": "=Autonomous Accounting System - Daily Report - {{ $now.toFormat('yyyy-MM-dd') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ab71a6b7-a400-468f-a7a3-cb8c2af7205f",
      "name": "Check for Errors",
      "type": "n8n-nodes-base.if",
      "position": [
        -1536,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "id-1",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              },
              "leftValue": "={{ $('Error Detection Agent').item.json.errors }}"
            },
            {
              "id": "id-2",
              "operator": {
                "type": "array",
                "operation": "lengthGt"
              },
              "leftValue": "={{ $('Error Detection Agent').item.json.errors }}",
              "rightValue": "0"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "4c1a6762-3cb9-4276-abfb-c48cabc44dc8",
      "name": "Aggregate All Results",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -256,
        160
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "f1f01564-c832-4b0b-bb70-c410a3355429",
      "name": "OpenAI GPT-",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -944,
        240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "e8b65ee0-0075-4872-bc6c-1b4b765fc6a9",
      "name": "OpenAI GPT-5",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1296,
        240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "242c2317-8f54-45d1-b34a-61c33545e636",
      "name": "OpenAI GPT-6",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2232,
        300
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "633a43f1-f8bf-4f97-9784-a8651461bc75",
      "name": "OpenAI GPT",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2936,
        300
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "0afe4203-b3f4-4c3c-bd8d-5aeed7cfaa66",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2584,
        300
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "073a26f3-890f-49b1-a084-d60c2f9025ef",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        -496
      ],
      "parameters": {
        "color": 6,
        "width": 528,
        "height": 304,
        "content": "## Prerequisites\nOpenAI API account with GPT-4 access\n## Use Cases\nMonthly financial close automation, daily transaction monitoring for fraud detection\n### Customization\nReplace Fable Bank with your banking API\n### Benefits\nReduces reconciliation time by 90%, eliminates manual data entry errors"
      },
      "typeVersion": 1
    },
    {
      "id": "0f8efd11-6ff3-47c4-aad5-d42a69cf5b07",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2960,
        -400
      ],
      "parameters": {
        "width": 480,
        "height": 208,
        "content": "## Setup Steps\n1. Configure Fable Bank API credentials for transaction data access \n2. Add OpenAI API key for GPT-4 classification and reconciliation models \n3. Set up NVIDIA NIM credentials for anomaly detection services \n4. Connect Google Sheets for reconciliation schema storage \n5. Configure Gmail account for automated report distribution  "
      },
      "typeVersion": 1
    },
    {
      "id": "6ffd486b-c12e-4d29-8a87-5ba56970088d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3856,
        -400
      ],
      "parameters": {
        "width": 832,
        "height": 224,
        "content": "## How It Works\nThis workflow automates end-to-end financial transaction processing for finance teams managing high-volume bank data. It eliminates manual reconciliation by intelligently classifying transactions, detecting anomalies, and generating executive summaries. The system pulls transaction data from Fable Bank, routes it through multiple AI models (OpenAI GPT-4, NVIDIA NIM) for classification and analysis, reconciles accounts, and distributes formatted reports via email. Finance managers and accounting teams benefit from reduced processing time, improved accuracy, and real-time anomaly detection. The workflow handles transaction categorization, reconciliation schema generation, account matching, journal entry creation, and comprehensive reporting\u2014transforming hours of manual work into minutes of automated processing with AI-enhanced accuracy."
      },
      "typeVersion": 1
    },
    {
      "id": "9e910e8f-80d6-4407-91b9-473638c2986b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 896,
        "height": 736,
        "content": "## Journalization & Anomaly Detection\n\n**What:** Generates journal entries and detects anomalies with NVIDIA NIM analysis.\n**Why:** Preserves accounting integrity and flags suspicious activity.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5e552725-d5d5-427d-a528-5c13d71107e8",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2608,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 656,
        "height": 736,
        "content": "## Reconciliation & Matching\n\n**What:** Builds reconciliation schemas and matches transactions to account records.\n**Why:** Automatically ensures accurate matching and surfaces discrepancies."
      },
      "typeVersion": 1
    },
    {
      "id": "4559c376-ff2b-4e30-8dc4-2d76771a0a0f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3872,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 1216,
        "height": 640,
        "content": "## Transaction Ingestion & Classification\n\n**What:** Pulls transaction data from the Fable Bank API and classifies it using AI agents.\n**Why:** Eliminates manual data collection and sorting through intelligent automation."
      },
      "typeVersion": 1
    },
    {
      "id": "5115d5e8-d037-409e-8f9c-40f9ee4b2b7d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 1312,
        "height": 752,
        "content": "## Reporting & Distribution\n\n**What:** Compiles final reports and sends formatted summaries via Gmail.\n**Why:** Delivers actionable insights without manual report preparation."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "44e9480c-2b8a-4c7f-b639-7aabd59bc479",
  "connections": {
    "OpenAI": {
      "ai_languageModel": [
        [
          {
            "node": "Account Reconciliation Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Tool": {
      "ai_tool": [
        [
          {
            "node": "Tax Agent Communication Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT": {
      "ai_languageModel": [
        [
          {
            "node": "Transaction Classifier Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-": {
      "ai_languageModel": [
        [
          {
            "node": "Tax Report Generator Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4": {
      "ai_languageModel": [
        [
          {
            "node": "Tax Agent Communication Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-5": {
      "ai_languageModel": [
        [
          {
            "node": "Financial Statement Generator Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-6": {
      "ai_languageModel": [
        [
          {
            "node": "Journal Entry Generator Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Calculator Tool": {
      "ai_tool": [
        [
          {
            "node": "Transaction Classifier Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Account Reconciliation Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Journal Entry Generator Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Error Detection Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Financial Statement Generator Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Tax Report Generator Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Check for Errors": {
      "main": [
        [
          {
            "node": "Financial Statement Generator Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tax Report Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Tax Report Generator Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Format Final Report": {
      "main": [
        [
          {
            "node": "Send Summary Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Accounting Run": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Journal Entry Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Journal Entry Generator Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate All Results": {
      "main": [
        [
          {
            "node": "Format Final Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Detection Agent": {
      "main": [
        [
          {
            "node": "Check for Errors",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reconciliation Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Account Reconciliation Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Combine Financial Data": {
      "main": [
        [
          {
            "node": "Transaction Classifier Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Detection Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Error Detection Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Fetch Bank Transactions",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Accounting System Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Bank Transactions": {
      "main": [
        [
          {
            "node": "Combine Financial Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Financial Statement Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Financial Statement Generator Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Tax Report Generator Agent": {
      "main": [
        [
          {
            "node": "Tax Agent Communication Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Account Reconciliation Agent": {
      "main": [
        [
          {
            "node": "Journal Entry Generator Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Accounting System Data": {
      "main": [
        [
          {
            "node": "Combine Financial Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Transaction Classifier Agent": {
      "main": [
        [
          {
            "node": "Account Reconciliation Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Journal Entry Generator Agent": {
      "main": [
        [
          {
            "node": "Error Detection Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post Journal Entries to System",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tax Agent Communication Agent": {
      "main": [
        [
          {
            "node": "Aggregate All Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Journal Entries to System": {
      "main": [
        [
          {
            "node": "Aggregate All Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transaction Classification Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Transaction Classifier Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Financial Statement Generator Agent": {
      "main": [
        [
          {
            "node": "Tax Report Generator Agent",
            "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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow automates end-to-end financial transaction processing for finance teams managing high-volume bank data. It eliminates manual reconciliation by intelligently classifying transactions, detecting anomalies, and generating executive summaries. The system pulls…

Source: https://n8n.io/workflows/12377/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow automates comprehensive real estate investment analysis by orchestrating specialized AI agents to evaluate property data, market trends, and financial metrics. Designed for real estate i

HTTP Request, Agent, OpenAI Chat +5
AI & RAG

kisisel asistan. Uses toolWorkflow, toolHttpRequest, toolCalculator, toolThink. Scheduled trigger; 43 nodes.

Tool Workflow, Tool Http Request, Tool Calculator +15
AI & RAG

This workflow automates end-to-end sustainability lifecycle management for corporate sustainability teams, ESG governance officers, and circular economy programme leads. It addresses the challenge of

Form Trigger, Agent, OpenAI Chat +11
AI & RAG

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

Agent, OpenAI Chat, Output Parser Structured +12
AI & RAG

This workflow automates financial reconciliation by orchestrating multiple AI agents to detect mismatches, analyze root causes, and apply corrections across bank statements, invoices, and e-commerce p

Stripe, HTTP Request, Agent +6