AutomationFlowsData & Sheets › Extract Invoice Data Into Google Sheets with Ldx Hub Analyzedoc (gemini)

Extract Invoice Data Into Google Sheets with Ldx Hub Analyzedoc (gemini)

ByHideki Mori @hidekimori on n8n.io

This workflow collects an invoice PDF or image through an n8n form, uses LDX hub AnalyzeDoc (Gemini) to extract key invoice fields as JSON, and appends the results as a new row in Google Sheets. Receives an invoice file upload (PDF/JPG/PNG) through an n8n form submission. Sends…

Event trigger★★☆☆☆ complexity6 nodesForm TriggerN8N Nodes LdxhubGoogle Sheets
Data & Sheets Trigger: Event Nodes: 6 Complexity: ★★☆☆☆ Added:

This workflow corresponds to n8n.io template #16966 — we link there as the canonical source.

This workflow follows the Form Trigger → Google Sheets 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
{
  "name": "Extract Invoice Data (PDF/Image) to Google Sheets with LDX hub AnalyzeDoc",
  "tags": [],
  "nodes": [
    {
      "id": "13cf1006-5b97-48fd-a68c-6f0ae1842588",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "options": {
          "buttonLabel": "Extract"
        },
        "formTitle": "Invoice \u2192 Google Sheets",
        "formFields": {
          "values": [
            {
              "fieldName": "invoice_file",
              "fieldType": "file",
              "fieldLabel": "Invoice File",
              "multipleFiles": false,
              "requiredField": true,
              "acceptFileTypes": ".pdf,.jpg,.jpeg,.png"
            }
          ]
        },
        "formDescription": "Upload an invoice (PDF, JPEG, or PNG). LDX hub AnalyzeDoc extracts the key fields and appends them as one row to a Google Sheet."
      },
      "typeVersion": 2.5
    },
    {
      "id": "33450d01-50f0-4dd9-8cd9-5252b23653f9",
      "name": "AnalyzeDoc: Extract Invoice Fields",
      "type": "n8n-nodes-ldxhub.ldxHub",
      "position": [
        224,
        0
      ],
      "parameters": {
        "model": "google/gemini-3.5-flash@high",
        "resource": "analyzeDoc",
        "output_format": "json",
        "system_prompt": "Extract the following fields from the provided invoice document.\n\nRules:\n- Dates: ISO 8601 format (YYYY-MM-DD).\n- Monetary amounts (subtotal, tax, total): plain numbers without currency symbols or thousands separators.\n- currency: ISO 4217 code (e.g. \"USD\", \"EUR\", \"JPY\").\n- Phone or fax numbers, if any: do not start the value with a \"+\" (use \"81-3-1234-5678\" or \"(+1234567890\") so they stay readable as text in spreadsheets.\n- vendor_tax_id: the vendor's tax registration number (VAT ID, EIN, or a local equivalent such as a Japanese qualified invoice issuer number).\n- If a field is not present in the document, use an empty string \"\" for text fields and 0 for amounts.\n\nFields:\n- invoice_number: the invoice identifier\n- issue_date: date the invoice was issued\n- due_date: payment due date\n- vendor_name: name of the issuing company\n- vendor_address: full address of the issuing company\n- vendor_tax_id: vendor's tax registration number\n- bill_to: name of the billed customer or company\n- subtotal: amount before tax\n- tax: tax amount\n- total: total amount due\n- currency: currency of the amounts\n- payment_terms: payment terms as written (e.g. \"Net 30\")",
        "example_output": "{\"invoice_number\":\"\",\"issue_date\":\"\",\"due_date\":\"\",\"vendor_name\":\"\",\"vendor_address\":\"\",\"vendor_tax_id\":\"\",\"bill_to\":\"\",\"subtotal\":1234.56,\"tax\":123.45,\"total\":1358.01,\"currency\":\"\",\"payment_terms\":\"\"}",
        "pollingSettings": {
          "serverWaitSeconds": 10,
          "pollingMaxAttempts": 180
        },
        "binaryPropertyName": "invoice_file"
      },
      "credentials": {
        "ldxHubApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1425676c-e888-4731-a7d6-d88b7d8f6f68",
      "name": "Parse Extracted JSON",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        448,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "fromJson",
        "binaryPropertyName": "invoice_file"
      },
      "typeVersion": 1
    },
    {
      "id": "820bfc3e-6ec5-4186-b1b4-90c5517cb1b5",
      "name": "Append Row to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        672,
        0
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "84bcb0b4-004f-4880-9d96-170f1cb008a1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 500,
        "height": 760,
        "content": "## Invoice \u2192 Google Sheets\nUpload an invoice via the built-in form \u2014 **LDX hub AnalyzeDoc** (vision AI) reads the PDF/image and appends the extracted fields as one row to your Google Sheet.\n\n**Setup**\n1. Install the verified community node `n8n-nodes-ldxhub` (v0.10.0 or later) and create an **LDXhub API** credential \u2014 get a free API key at https://gw.portal.ldxhub.io (25,000 credits/month, no credit card).\n2. Create a Google Sheet with this header row:\n`invoice_number, issue_date, due_date, vendor_name, vendor_address, vendor_tax_id, bill_to, subtotal, tax, total, currency, payment_terms`\n3. In **Append Row to Google Sheets**, select your Google credential, spreadsheet, and sheet.\n4. Activate the workflow and open the form URL \u2014 that's it."
      },
      "typeVersion": 1
    },
    {
      "id": "08cd39b0-a2ae-4110-ad6d-9cfdd9d2ff62",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -360
      ],
      "parameters": {
        "color": 7,
        "width": 360,
        "height": 320,
        "content": "## Customize the extraction\nEdit **System Prompt** and **Example Output** in the AnalyzeDoc node to change the fields \u2014 the Example Output defines the output schema.\nTip: write amounts with decimals (e.g. 1234.56) so they stay numeric. Works with invoices in any language."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "AnalyzeDoc: Extract Invoice Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Extracted JSON": {
      "main": [
        [
          {
            "node": "Append Row to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AnalyzeDoc: Extract Invoice Fields": {
      "main": [
        [
          {
            "node": "Parse Extracted JSON",
            "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 collects an invoice PDF or image through an n8n form, uses LDX hub AnalyzeDoc (Gemini) to extract key invoice fields as JSON, and appends the results as a new row in Google Sheets. Receives an invoice file upload (PDF/JPG/PNG) through an n8n form submission. Sends…

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

More Data & Sheets workflows → · Browse all categories →

Related workflows

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

Data & Sheets

This workflow collects a business card photo/scan through an n8n form, uses LDX hub AnalyzeDoc (Gemini) to extract contact details as structured JSON, and appends the resulting fields as a new row in

Form Trigger, N8N Nodes Ldxhub, Google Sheets
Data & Sheets

This workflow collects uploaded PDFs or images, classifies each document type using LDXhub AnalyzeDoc, and routes it accordingly; invoices get high-detail field extraction and are appended as a new ro

Form Trigger, N8N Nodes Ldxhub, Google Sheets
Data & Sheets

This workflow collects a meeting-minutes PDF via an n8n form, uses LDX hub (Gemini) to segment it by agenda and extract decisions and action items, then appends each item as a row in Google Sheets. Re

Form Trigger, N8N Nodes Ldxhub, Google Sheets
Data & Sheets

This n8n workflow automates the collection and processing of trip feedback data using Google Sheets as the backend. When new users are added to the system, they automatically receive feedback forms vi

Form Trigger, Google Sheets, Email Send +1
Data & Sheets

An automated workflow that scrapes Shopify store information and product data using the Shopify Scraper API from RapidAPI, triggered by a user submitting a website URL, then logs data into Google Shee

Form Trigger, HTTP Request, Google Sheets