{
  "name": "Automate tax deduction processing with GPT-4 receipt analysis and Gmail reporting",
  "nodes": [
    {
      "id": "91c07b4f-ff0e-4439-963a-fb72cc546d74",
      "name": "Monthly Tax Processing Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1792,
        208
      ]
    },
    {
      "id": "39b0b809-214a-48c9-8377-436b9f5a82fe",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -1600,
        208
      ]
    },
    {
      "id": "92bb8752-587a-4aa4-9468-656de717a593",
      "name": "Fetch Expense Receipts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1408,
        96
      ]
    },
    {
      "id": "b9e0d9ba-c8a2-42e2-90d3-fc1f9e79fd19",
      "name": "Fetch Revenue Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -656,
        400
      ]
    },
    {
      "id": "fd98407a-6741-47e3-be4b-2645fde125f4",
      "name": "Check Receipt File Type",
      "type": "n8n-nodes-base.if",
      "position": [
        -1184,
        64
      ]
    },
    {
      "id": "07f38646-e544-41af-8c4b-d3784bf335c1",
      "name": "Extract Receipt Data",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -960,
        48
      ]
    },
    {
      "id": "0f2cccdb-b621-47c0-bf72-23e36a27bbb2",
      "name": "Extract Deductible Categories",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -736,
        64
      ]
    },
    {
      "id": "6f5435c3-ee29-4597-bcee-616b178afc38",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -752,
        288
      ]
    },
    {
      "id": "1ba2ff7f-08d0-4540-99f8-6d64872f11cd",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -592,
        272
      ]
    },
    {
      "id": "3422a3cd-90de-4019-bdf1-4f75203dffe0",
      "name": "Merge Revenue and Deductions",
      "type": "n8n-nodes-base.merge",
      "position": [
        -384,
        208
      ]
    },
    {
      "id": "96c1294e-e8a0-4e91-a2fb-180252d32575",
      "name": "Match Expenses to Revenue Periods",
      "type": "n8n-nodes-base.code",
      "position": [
        -160,
        208
      ]
    },
    {
      "id": "5028d4bf-de7e-4ebe-ba29-b4621a990ac6",
      "name": "Calculate Tax Deductions",
      "type": "n8n-nodes-base.code",
      "position": [
        64,
        208
      ]
    },
    {
      "id": "2f515909-c403-467b-9c2f-4f825eeb0803",
      "name": "Format Tax Report",
      "type": "n8n-nodes-base.set",
      "position": [
        288,
        208
      ]
    },
    {
      "id": "adcb4a3d-23f2-4236-a80c-4b5ef1535f47",
      "name": "Send to Tax Agent",
      "type": "n8n-nodes-base.gmail",
      "position": [
        512,
        208
      ]
    },
    {
      "id": "11b6c8ec-f244-4136-8673-d5c0790fd194",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -448
      ],
      "parameters": {
        "width": 704,
        "height": 336,
        "content": "\n## Prerequisites\nExpense receipt repository; OpenAI API key; Gmail account; revenue data source.\n\n## Use Cases\nAccountants automating receipt processing for multiple clients; \n\n## Customization\nAdjus"
      }
    },
    {
      "id": "c53e32ac-97c4-46f7-b26f-1e8d9d810eea",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -448
      ],
      "parameters": {
        "width": 432,
        "height": 208,
        "content": "## Setup Steps\n1. Configure receipt storage source and OpenAI Chat Model API key.\n2. Connect Gmail for report delivery and set up tax agent email.\n3. Define expense categories, revenue periods, and de"
      }
    },
    {
      "id": "935604c6-af8f-47dd-a853-35494cc7be73",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1888,
        -448
      ],
      "parameters": {
        "width": 624,
        "height": 240,
        "content": "## How It Works\nThis workflow automates monthly tax processing by ingesting expense receipts alongside revenue data, extracting structured deduction details using GPT-4, and accurately matching expens"
      }
    },
    {
      "id": "a45e6441-9366-4f81-b630-3bffe068b84b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        -96
      ],
      "parameters": {
        "width": 672,
        "height": 704,
        "content": "## Calculate & Format\nWhat: Matches expenses to revenue periods, calculates deductions, generates tax reports.\nWhy: Produces audit-ready documentation and maximizes legitimate tax advantages."
      }
    },
    {
      "id": "c36be84c-3ec4-4b63-967b-dfbf74791e45",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        -96
      ],
      "parameters": {
        "width": 784,
        "height": 720,
        "content": "## Merge Revenue & Expenses\nWhat: Consolidates expense and revenue datasets into aligned records by period.\nWhy: Enables accurate deduction-to-revenue matching for tax calculations."
      }
    },
    {
      "id": "866b13cc-f00b-4fb2-9a5c-02106faf2afb",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1856,
        -96
      ],
      "parameters": {
        "width": 1040,
        "height": 560,
        "content": " \n## Fetch & Validate Expenses \nWhat: Retrieves expense receipts and validates file types before processing.\nWhy: Ensures data quality and prevents processing errors from invalid formats."
      }
    }
  ],
  "connections": {
    "Format Tax Report": {
      "main": [
        [
          {
            "node": "Send to Tax Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Extract Deductible Categories",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Revenue Data": {
      "main": [
        [
          {
            "node": "Merge Revenue and Deductions",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract Receipt Data": {
      "main": [
        [
          {
            "node": "Extract Deductible Categories",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Expense Receipts": {
      "main": [
        [
          {
            "node": "Check Receipt File Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Fetch Expense Receipts",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Revenue Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Receipt File Type": {
      "main": [
        [
          {
            "node": "Extract Receipt Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Tax Deductions": {
      "main": [
        [
          {
            "node": "Format Tax Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Extract Deductible Categories",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Merge Revenue and Deductions": {
      "main": [
        [
          {
            "node": "Match Expenses to Revenue Periods",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Deductible Categories": {
      "main": [
        [
          {
            "node": "Merge Revenue and Deductions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monthly Tax Processing Schedule": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Match Expenses to Revenue Periods": {
      "main": [
        [
          {
            "node": "Calculate Tax Deductions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}