KI-gesteuerter PDF-Rechnungs-Parser - Google Drive, Google Sheets und OpenAI

Fortgeschritten

Dies ist ein Finance, AI-Bereich Automatisierungsworkflow mit 10 Nodes. Hauptsächlich werden GoogleDrive, GoogleSheets, Agent, ExtractFromFile, GoogleDriveTrigger und andere Nodes verwendet, kombiniert mit KI-Technologie für intelligente Automatisierung. Ein KI-gesteuerter PDF-Rechnungs-Parser basierend auf Google Drive, Google Sheets und OpenAI

Voraussetzungen
  • Google Drive API-Anmeldedaten
  • Google Sheets API-Anmeldedaten
  • OpenAI API Key
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "meta": {
    "instanceId": "d1786ab0d745a7498abf13a9c2cdabb1374c006e889b79eef64ce0386b8f8a41",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "5c1a182c-3485-48db-91b2-d46f0f1d3fd5",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        560,
        200
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "MGwGMKEkdcjzlYCw",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "45f94af9-147a-434c-aef5-fc3f7e60a140",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        780,
        200
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"invoice_number\": \"\",\n  \"invoice_date\": \"\",\n  \"due_date\": \"\",\n  \"vendor_name\": \"\",\n  \"total_amount\": \"\",\n  \"currency\": \"\",\n  \"items\": [\n    {\n      \"description\": \"\",\n      \"amount\": \"\"\n    }\n  ],\n  \"tax\": \"\",\n  \"category\": \"\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "01c8daa7-81e1-46cd-b927-f264e90391b4",
      "name": "Rechnungsordner-Überwachung",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "id",
          "value": "1KJ4fvXcKVMGJunsKvPYf8PkX5K9SVwFk"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "SEUhrgz30NMJS3cH",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "af299424-233a-4ac0-a92b-7f456d11e15a",
      "name": "PDF-Rechnung herunterladen",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        200,
        0
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "SEUhrgz30NMJS3cH",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "e896d679-a064-459a-8e4f-603436879cda",
      "name": "PDF-Text-Extraktor",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        400,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "f43fe296-b04b-41fd-ad4d-a845d009e80f",
      "name": "Rechnungsparser-KI-Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        580,
        0
      ],
      "parameters": {
        "text": "=You are an intelligent invoice parser. I will give you raw text extracted from a PDF invoice. \n\n========================\nSTART OF RAW INVOICE TEXT\n\n{{ $json.text }}\n\nEND OF RAW INVOICE TEXT\n========================\n\nYour job is to:\n\n1. Extract key information from the invoice such as:\n   - invoice_number\n   - invoice_date\n   - due_date (if available)\n   - vendor_name\n   - total_amount\n   - currency (e.g., USD, IDR, etc.)\n   - items (as a list of item descriptions and their amounts)\n   - tax (if available)\n\n2. Detect the invoice **category**, such as:\n   - Utilities\n   - Office Supplies\n   - Travel\n   - Software\n   - Food & Beverage\n   - Others (if unknown)\n\n3. Return the result in this exact JSON format:\n\n```json\n{\n  \"invoice_number\": \"\",\n  \"invoice_date\": \"\",\n  \"due_date\": \"\",\n  \"vendor_name\": \"\",\n  \"total_amount\": \"\",\n  \"currency\": \"\",\n  \"items\": [\n    {\n      \"description\": \"\",\n      \"amount\": \"\"\n    }\n  ],\n  \"tax\": \"\",\n  \"category\": \"\"\n}\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.9
    },
    {
      "id": "00eec735-03c4-4a78-829c-54354613812a",
      "name": "Rechnungsdaten einfügen",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        920,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Tax": "={{ $json.output.tax }}",
            "Items": "={{ $json.output.items }}",
            "Category": "={{ $json.output.category }}",
            "Currency": "={{ $json.output.currency }}",
            "Due Date": "={{ $json.output.due_date }}",
            "Vendor Name": "={{ $json.output.vendor_name }}",
            "Invoice Date": "={{ $json.output.invoice_date }}",
            "Total Amount": "={{ $json.output.total_amount }}",
            "Invoice Number": "={{ $json.output.invoice_number }}"
          },
          "schema": [
            {
              "id": "Invoice Number",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Invoice Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invoice Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Invoice Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Due Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Due Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Vendor Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Vendor Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Total Amount",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Total Amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Currency",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Currency",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Items",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Items",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Tax",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Tax",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1u5dHeytao9y3L0Mgv8cSomPVLS3CMrn_eOwXW3oQ3c8/edit#gid=0",
          "cachedResultName": "Invoices"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1u5dHeytao9y3L0Mgv8cSomPVLS3CMrn_eOwXW3oQ3c8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1u5dHeytao9y3L0Mgv8cSomPVLS3CMrn_eOwXW3oQ3c8/edit?usp=drivesdk",
          "cachedResultName": "PDF Invoice Parser - n8n template"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ypmzFxQFfAacuVVC",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "78ead6a4-7ae7-4182-a7f1-eebb7f38d776",
      "name": "Kurznotiz 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -100
      ],
      "parameters": {
        "color": 4,
        "width": 280,
        "height": 400,
        "content": "## SETUP REQUIRED\n\nGoogle Sheets Structure:\nSheet: \"Invoices\"\n• Column A: Invoice Number  \n• Column B: Invoice Date  \n• Column C: Due Date  \n• Column D: Vendor Name  \n• Column E: Total Amount  \n• Column F: Currency  \n• Column G: Items  \n• Column H: Tax  \n• Column I: Category  \n\nRequired Credentials:\n• Google Drive Credential  \n• Google Sheets Credential  \n• OpenAI API Key (GPT-4)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "45fc8d0a-c76a-4c2a-871e-19ad144993f0",
      "name": "Kurznotiz 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        340
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 400,
        "content": "## 🧾 AI-Powered PDF Invoice Parser for Google Drive & Sheets\n\nWhat This Template Does:\n\n- Monitors a designated Google Drive folder for new incoming PDF invoices  \n- Automatically downloads and extracts text content from the PDFs  \n- Uses GPT-4 to intelligently parse and structure invoice data (amount, vendor, items, date, etc.)  \n- Categorizes invoices by type (Office Supplies, Food & Beverage, etc.)  \n- Saves all parsed invoice data into a Google Sheets document  \n- Fully automates invoice processing and bookkeeping for businesses  "
      },
      "typeVersion": 1
    },
    {
      "id": "d85f3e8e-38cc-4a12-9592-ce32373ddcf9",
      "name": "Kurznotiz 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        340
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 340,
        "content": "## 📋 WORKFLOW PROCESS OVERVIEW\n\nStep 1: 📂 Invoice Folder Monitor watches a specific Google Drive folder for new PDF invoices  \nStep 2: ⬇️ Download Invoice PDF downloads the new invoice as binary data  \nStep 3: 🔍 PDF Text Extractor converts the PDF binary into readable text using OCR and extraction tools  \nStep 4: 🤖 Invoice Parser AI Agent (GPT-4) analyzes the text and extracts structured invoice data in JSON format  \nStep 5: 📝 Insert Invoice Data appends the structured invoice data to the Google Sheets \"Invoices\""
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Invoice Folder Monitor": [
      {
        "id": "168eK7xkg9bhZRC9Nn3aoVbeU--Cy_4ie",
        "kind": "drive#file",
        "name": "invoice123123.pdf",
        "size": "43627",
        "owners": [
          {
            "me": true,
            "kind": "drive#user",
            "photoLink": "https://lh3.googleusercontent.com/a/ACg8ocKYEvqVbfrYpVM3Esbt8CDt_Fije42MxkdcBFDBR1qni7Tgw5j7=s64",
            "displayName": "Billy Christi Hartanto",
            "emailAddress": "billychartanto@gmail.com",
            "permissionId": "06783842879122931240"
          }
        ],
        "shared": false,
        "spaces": [
          "drive"
        ],
        "parents": [
          "1KJ4fvXcKVMGJunsKvPYf8PkX5K9SVwFk"
        ],
        "starred": false,
        "trashed": false,
        "version": "3",
        "iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/application/pdf",
        "mimeType": "application/pdf",
        "ownedByMe": true,
        "viewedByMe": true,
        "createdTime": "2025-05-27T08:17:54.309Z",
        "md5Checksum": "c1bda6d4249306eeb6b30da641eb2ad8",
        "permissions": [
          {
            "id": "06783842879122931240",
            "kind": "drive#permission",
            "role": "owner",
            "type": "user",
            "deleted": false,
            "photoLink": "https://lh3.googleusercontent.com/a/ACg8ocKYEvqVbfrYpVM3Esbt8CDt_Fije42MxkdcBFDBR1qni7Tgw5j7=s64",
            "displayName": "Billy Christi Hartanto",
            "emailAddress": "billychartanto@gmail.com",
            "pendingOwner": false
          }
        ],
        "webViewLink": "https://drive.google.com/file/d/168eK7xkg9bhZRC9Nn3aoVbeU--Cy_4ie/view?usp=drivesdk",
        "capabilities": {
          "canCopy": true,
          "canEdit": true,
          "canShare": true,
          "canTrash": true,
          "canDelete": true,
          "canRename": true,
          "canComment": true,
          "canUntrash": true,
          "canDownload": true,
          "canReadLabels": false,
          "canAddChildren": false,
          "canListChildren": false,
          "canModifyLabels": false,
          "canModifyContent": true,
          "canReadRevisions": true,
          "canRemoveChildren": false,
          "canAcceptOwnership": false,
          "canAddMyDriveParent": false,
          "canMoveItemOutOfDrive": true,
          "canMoveItemWithinDrive": true,
          "canRemoveMyDriveParent": true,
          "canMoveItemIntoTeamDrive": true,
          "canMoveChildrenWithinDrive": false,
          "canModifyContentRestriction": true,
          "canRemoveContentRestriction": false,
          "canEnableInheritedPermissions": true,
          "canChangeSecurityUpdateEnabled": false,
          "canChangeViewersCanCopyContent": true,
          "canDisableInheritedPermissions": false,
          "canModifyOwnerContentRestriction": true,
          "canModifyEditorContentRestriction": true,
          "canChangeCopyRequiresWriterPermission": true
        },
        "hasThumbnail": true,
        "modifiedByMe": true,
        "modifiedTime": "2025-05-27T08:17:38.000Z",
        "sha1Checksum": "54243509f843e8ec9f2913715d9ae0f6df14cdde",
        "fileExtension": "pdf",
        "permissionIds": [
          "06783842879122931240"
        ],
        "thumbnailLink": "https://lh3.googleusercontent.com/drive-storage/AJQWtBNR_JHmbwFJT9hZOqNB1DU8CkWed-A0mH2ukYEDpQt7OdutXoLStFjhGHdTvgpzX3ORUOqOVaAeNqt9vuUJt0KUQ_0L0nxkCqXPZ68ybuhugn0=s220",
        "headRevisionId": "0B3oBzhOa0rqUUCtZU3E5TDBGaUkrTEhETWNKQ1h0L2djcFRZPQ",
        "quotaBytesUsed": "43627",
        "sha256Checksum": "c2de358a0974f9b047aed8e457def7d4b1b39170f44819ec3152b42db787d72e",
        "viewedByMeTime": "2025-05-27T08:17:54.309Z",
        "webContentLink": "https://drive.google.com/uc?id=168eK7xkg9bhZRC9Nn3aoVbeU--Cy_4ie&export=download",
        "isAppAuthorized": false,
        "writersCanShare": true,
        "modifiedByMeTime": "2025-05-27T08:17:38.000Z",
        "originalFilename": "invoice123123.pdf",
        "thumbnailVersion": "1",
        "explicitlyTrashed": false,
        "fullFileExtension": "pdf",
        "lastModifyingUser": {
          "me": true,
          "kind": "drive#user",
          "photoLink": "https://lh3.googleusercontent.com/a/ACg8ocKYEvqVbfrYpVM3Esbt8CDt_Fije42MxkdcBFDBR1qni7Tgw5j7=s64",
          "displayName": "Billy Christi Hartanto",
          "emailAddress": "billychartanto@gmail.com",
          "permissionId": "06783842879122931240"
        },
        "linkShareMetadata": {
          "securityUpdateEnabled": true,
          "securityUpdateEligible": false
        },
        "viewersCanCopyContent": true,
        "copyRequiresWriterPermission": false,
        "inheritedPermissionsDisabled": false
      }
    ]
  },
  "connections": {
    "5c1a182c-3485-48db-91b2-d46f0f1d3fd5": {
      "ai_languageModel": [
        [
          {
            "node": "f43fe296-b04b-41fd-ad4d-a845d009e80f",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "e896d679-a064-459a-8e4f-603436879cda": {
      "main": [
        [
          {
            "node": "f43fe296-b04b-41fd-ad4d-a845d009e80f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "af299424-233a-4ac0-a92b-7f456d11e15a": {
      "main": [
        [
          {
            "node": "e896d679-a064-459a-8e4f-603436879cda",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "01c8daa7-81e1-46cd-b927-f264e90391b4": {
      "main": [
        [
          {
            "node": "af299424-233a-4ac0-a92b-7f456d11e15a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f43fe296-b04b-41fd-ad4d-a845d009e80f": {
      "main": [
        [
          {
            "node": "00eec735-03c4-4a78-829c-54354613812a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "45f94af9-147a-434c-aef5-fc3f7e60a140": {
      "ai_outputParser": [
        [
          {
            "node": "f43fe296-b04b-41fd-ad4d-a845d009e80f",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Fortgeschritten - Finanzen, Künstliche Intelligenz

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Fortgeschritten
Anzahl der Nodes10
Kategorie2
Node-Typen8
Schwierigkeitsbeschreibung

Für erfahrene Benutzer, mittelkomplexe Workflows mit 6-15 Nodes

Autor
Billy Christi

Billy Christi

@billy

I'm a professional software engineer and n8n expert with a passion for building scalable, no-code and low-code automation workflows. I specialize in creating seamless integrations between APIs, CRMs, and everyday tools to help businesses save time, reduce manual work, and operate smarter. Whether it's automating marketing pipelines, backend systems, or approval processes, I turn complex logic into simple, powerful workflows with n8n.

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34