{
  "name": "Extract and process invoices with GPT-4, Google Drive, and Google Sheets",
  "nodes": [
    {
      "id": "fd00aab8-c276-4097-8c11-79ae2dd517d6",
      "name": "Update Booking List",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        240,
        304
      ]
    },
    {
      "id": "8f2b4852-5d79-41d8-bda5-8d08d3135eee",
      "name": "Chart of Accounts",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        -80,
        384
      ]
    },
    {
      "id": "eb0a252a-449a-4e98-8959-5a0decd3f9bf",
      "name": "Save to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        464,
        -16
      ]
    },
    {
      "id": "dac8d0b8-93a0-459e-9d56-370cbb19cf31",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        48,
        304
      ]
    },
    {
      "id": "467f0abc-72a8-40bb-b7a5-9ab3be3b1860",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -368,
        304
      ]
    },
    {
      "id": "7e397cb2-0e27-4f26-a9cb-156e1d102315",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -576,
        80
      ]
    },
    {
      "id": "f1e5c8f3-8553-4f21-bcc8-1fbf86c55e3f",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -224,
        384
      ]
    },
    {
      "id": "61d21596-de54-42d8-8ed3-5f8d7c77410a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        -32
      ],
      "parameters": {
        "width": 674,
        "height": 272,
        "content": "## INPUT\n### Upload Invoice PDF from Google Drive Input Folder and Extract the data from the PDF binary file"
      }
    },
    {
      "id": "f857416b-532a-421c-8f33-652345df1c65",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -1024,
        80
      ]
    },
    {
      "id": "5ef8bac9-10a9-4bda-8b0a-79b737a25da2",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        -16
      ]
    },
    {
      "id": "ef35f983-2aea-472f-ad07-4b565cfdb960",
      "name": "Move file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        464,
        304
      ]
    },
    {
      "id": "e1e44f35-6e19-4d02-a99f-268cb98236f4",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -800,
        80
      ]
    },
    {
      "id": "a765240d-5e8f-4438-9078-1813a13f72cc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -144
      ],
      "parameters": {
        "width": 482,
        "height": 288,
        "content": "## OUTPUT\n### Saving Invoice with new filename (YYMMDD vendor) as PDF-File in the according folder (matching to the booking account) "
      }
    },
    {
      "id": "f4fa17ab-87ee-446d-b1d7-913f748665af",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -112
      ],
      "parameters": {
        "width": 578,
        "height": 640,
        "content": "## AI AGENT\n### reading relevant information (vendor, bookingtext, amount, currency etc.) from the invoice, and matching the correct booking account.\n### The output parser set the defined variables."
      }
    },
    {
      "id": "e4b1c13c-110f-4e63-8320-1470d27389d2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        0
      ],
      "parameters": {
        "width": 448,
        "height": 496,
        "content": "# INVOICE AGENT BASIC\n\n## AI-Powered Invoice Extraction & Google Drive Automation\n\nThis workflow processes PDF incoming invoices from an input folder and extracts all relevant data. It checks the corr"
      }
    },
    {
      "id": "fe5e5972-7936-454b-95d4-5b26fc9842e2",
      "name": "Invoice Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -240,
        80
      ]
    },
    {
      "id": "11412f72-a43e-4136-8b97-163c69f860bd",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        160
      ],
      "parameters": {
        "width": 482,
        "height": 304,
        "content": "## OUTPUT\n### Updating the Booking list with actual Invoice by upending a new row\n### Move the processed invoice to the output folder. "
      }
    }
  ],
  "connections": {
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Save to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invoice Agent": {
      "main": [
        [
          {
            "node": "Update Booking List",
            "type": "main",
            "index": 0
          },
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Invoice Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Chart of Accounts": {
      "ai_tool": [
        [
          {
            "node": "Invoice Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Invoice Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Invoice Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Update Booking List": {
      "main": [
        [
          {
            "node": "Move file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Invoice Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}