{
  "name": "Automate invoice processing & weekly spending reports with GPT-4 and Airtable",
  "nodes": [
    {
      "id": "4f3cbf6b-6399-44c9-a09c-1cf906bfa22f",
      "name": "Invoice Upload Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -448,
        112
      ]
    },
    {
      "id": "9c465618-7758-44ac-a546-0011af01198c",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -224,
        112
      ]
    },
    {
      "id": "3b20014d-1f05-41f9-9360-36684182132a",
      "name": "Extract Invoice Data",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "dc923a0a-f108-4220-a3cb-7b0fb65e8e87",
      "name": "OpenAI Chat Model - Invoice Parser",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        16,
        224
      ]
    },
    {
      "id": "415ab90b-19e8-44bc-87c1-e3d38ddcfaba",
      "name": "Invoice Data Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        144,
        224
      ]
    },
    {
      "id": "103d5136-194e-45f5-98bf-d9a613521427",
      "name": "Validate Invoice Data",
      "type": "n8n-nodes-base.if",
      "position": [
        352,
        112
      ]
    },
    {
      "id": "0418ba62-d4f2-4764-9f28-ca138d1ed81c",
      "name": "Store Invoice in Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        576,
        112
      ]
    },
    {
      "id": "8c5c5d9f-00aa-461f-8446-66c8dad0d335",
      "name": "Weekly Report Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -592,
        544
      ]
    },
    {
      "id": "88035c13-ffdd-4ff6-a2b2-e9ab5cba0f9c",
      "name": "Fetch Weekly Invoices",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -336,
        544
      ]
    },
    {
      "id": "158e3e08-f784-4ecc-8bb5-8af9aa7f7d8d",
      "name": "Generate Spending Report",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        0,
        544
      ]
    },
    {
      "id": "679779e5-a7b2-4bce-adbb-c3c5225617e0",
      "name": "OpenAI Chat Model - Report Generator",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -64,
        672
      ]
    },
    {
      "id": "1338103f-3774-4460-975e-dd92e7224e39",
      "name": "Send Weekly Report Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        448,
        544
      ]
    },
    {
      "id": "1fc7950b-8968-49fa-a7e3-f9922ca4ead0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -192
      ],
      "parameters": {
        "width": 1072,
        "height": 1392,
        "content": "## Invoice Automation Kit: AI-Powered Invoice Processing and Weekly Reports\n\nThis n8n workflow is designed to automate invoice processing and streamline financial management. It leverages AI to extrac"
      }
    },
    {
      "id": "0a533b31-bf95-45d5-b6ad-32ee369df522",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        -48
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "## **Invoice Data Extraction and Storage**\n   *   **Invoice Upload Form**: Upload your invoices (PDF, PNG, JPG) via an n8n form."
      }
    },
    {
      "id": "1052cdb3-dd21-4b82-ab03-aa0e7fe31e1b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -112
      ],
      "parameters": {
        "width": 384,
        "height": 464,
        "content": "## **AI-Powered Data Extraction**\n** AI extracts key information such as vendor name, invoice date, total amount, currency, and line items (description, quantity, unit price, total) from the uploaded "
      }
    },
    {
      "id": "fc719679-9734-4e04-af38-356f7d71f79c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -32
      ],
      "parameters": {
        "width": 224,
        "height": 288,
        "content": "##  **Store in Airtable**\n**Validated invoice data is saved in a structured format to your specified Airtable base and table."
      }
    },
    {
      "id": "4ab481fd-2428-4343-83f6-076144131a0d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        -32
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "## **Data Validation**\n**The extracted data is validated to ensure it is complete and accurate."
      }
    },
    {
      "id": "b98c5fa0-8050-4885-a444-624b5933a450",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        416
      ],
      "parameters": {
        "width": 256,
        "height": 288,
        "content": "## **Fetch Weekly Invoices**\n**Retrieves all invoices stored in Airtable within the last 7 days."
      }
    },
    {
      "id": "3762e193-5bf8-4d31-bffb-00eaf1671082",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        368
      ],
      "parameters": {
        "width": 464,
        "height": 432,
        "content": "## **AI-Powered Spending Report Generation**\nBased on the retrieved invoice data, AI generates a comprehensive spending report, including total spending for the week, breakdown by vendor, top 5 expens"
      }
    },
    {
      "id": "49aa8e47-049a-4528-b554-d5b88913955e",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        368
      ],
      "parameters": {
        "width": 224,
        "height": 336,
        "content": "## **Send Weekly Report Email**\n**The generated report is sent in a professional format to the configured recipient email address."
      }
    },
    {
      "id": "46d8ac5e-356a-4833-a554-9f5e3e437362",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -672,
        416
      ],
      "parameters": {
        "width": null,
        "height": 272,
        "content": "## **Weekly Report Schedule**\n Automatically triggers every Sunday at 6 PM.\n    "
      }
    }
  ],
  "connections": {
    "Invoice Data Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Extract Invoice Data",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Invoice Upload Form": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Invoice Data": {
      "main": [
        [
          {
            "node": "Validate Invoice Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Weekly Invoices": {
      "main": [
        [
          {
            "node": "Generate Spending Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Invoice Data": {
      "main": [
        [
          {
            "node": "Store Invoice in Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Report Schedule": {
      "main": [
        [
          {
            "node": "Fetch Weekly Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Extract Invoice Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Spending Report": {
      "main": [
        [
          {
            "node": "Send Weekly Report Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model - Invoice Parser": {
      "ai_languageModel": [
        [
          {
            "node": "Extract Invoice Data",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model - Report Generator": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Spending Report",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}