Automate Invoice Extraction to Google Sheets with Google Drive API

Streamline the extraction of invoice data to Google Sheets using Google Sheets API and Google Drive API. This workflow automates the process of extracting key information from invoices and storing it in a structured spreadsheet format, significantly reducing manual data entry time. Key features include automatic processing of invoice files, real-time updates to your Google Sheets, and seamless integration with Telegram for instant notifications. Perfect for communication teams managing financial records and invoicing tasks. Requires 3 accounts: Google Sheets OAuth, Google Drive OAuth, and Telegram Bot Token. Save up to 10 hours weekly by automating your invoice management and ensuring accurate data entry.

3 Triggers
4,177 views25 nodesApr 2025James Taylor

Categories

Invoice ProcessingAI Summarization

APIs

Google Sheets APIGoogle Drive API

Credentials

3 required

Quick Actions

Copy or download to import into your n8n instance

Workflow JSON
{
  "id": "qClJP4aIscQySnQK",
  "meta": {
    "instanceId": "b3df22d2875c82e3ba1883c50049ed9cee0bcabf99d2b486961d2245a09e3964",
    "templateCredsSetupCompleted": true
  },
  "name": "(Tung) OCR invoice extract to spreadsheet copy",
  "tags": [],
  "nodes": [
    {
      "id": "ceb8fcc7-c733-4842-8988-2f19695658e4",
      "name": "Prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        2320,
        -1340
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "7bba23a4-9ff4-4c0f-9702-6de444b8701e",
      "name": "Move file to base64 string",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2020,
        -1340
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "df138485-9a6a-4d3e-a1ca-1c9568b5e76f",
      "name": "Gemini API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2620,
        -1340
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "e104546f-cf93-43c4-b5b4-5c66b046a72e",
      "name": "JSON to string",
      "type": "n8n-nodes-base.set",
      "position": [
        2900,
        -1220
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "182783f8-5285-4506-aa7b-d6f1fdbf5492",
      "name": "Parse string",
      "type": "n8n-nodes-base.code",
      "position": [
        3200,
        -1220
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "ca6d6fc1-8fce-48da-9de5-2395ff4ee3e8",
      "name": "Add to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3500,
        -1220
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "5b512370-b6e8-4cb7-b4d3-333ba15ac666",
      "name": "Google Drive Get Receipt",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1720,
        -1340
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "76c34c54-8666-4b3d-bb3f-ae79a6847cde",
      "name": "Telegram Trigger Image",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        1060,
        -60
      ],
      "webhookId": "ef2f6b1f-b608-4e2f-9abe-02fe8ae0f085",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "9e8e821f-b6f7-4014-937e-9fe734c0e9c9",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        1060,
        -720
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "d3a929a9-441f-4896-9a98-d32f374c8a83",
      "name": "Split Out Binary Files",
      "type": "n8n-nodes-base.code",
      "position": [
        1940,
        -480
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "db81d68b-d937-47bd-adfc-215bd4797754",
      "name": "Loop Over Attachments",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2100,
        -740
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "2cbb56fc-eb6a-4f61-8204-bcde99c164c4",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        1640,
        -620
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "97c167d3-db62-48ae-b9ab-4add617e1258",
      "name": "Loop Over Emails",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1400,
        -720
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "c4c4193a-983b-4f46-9d61-03ecff3157be",
      "name": "Wait For Saving",
      "type": "n8n-nodes-base.wait",
      "position": [
        3020,
        -720
      ],
      "webhookId": "a6742af7-28b5-469a-92d6-3f74845692fd",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "df28230d-7d7d-4817-8aba-615a9a266ad5",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1400,
        -1360
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "f3ee46f7-b3a8-4dfd-8b1f-da92613d5fe9",
      "name": "Create File Name",
      "type": "n8n-nodes-base.code",
      "position": [
        2420,
        -720
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "d7bde712-ece9-4613-9771-379f99a2300d",
      "name": "Create File Name For Telegram",
      "type": "n8n-nodes-base.code",
      "position": [
        1400,
        -60
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "f564d3b2-9be8-4119-9cc2-b4a61809af9f",
      "name": "Google Drive Trigger New Files",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        1060,
        -1360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3f4adb77-2ab4-4e7f-b9d4-4b030aaf1f68",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -800
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8a9de5a7-0314-49d0-b87f-513bbb5e9531",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -140
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7b9dc2de-464d-4c76-9ec0-44717bf29753",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -1460
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "56c7a141-3265-4528-9f5c-ad3326bcf84e",
      "name": "Google Save Files 2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1740,
        -60
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "e7b8fa1b-9510-450d-a35e-4a0338efa9f0",
      "name": "Google Drive Save Files",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2720,
        -720
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "95dc537f-75c1-47dc-b929-838b63f97e25",
      "name": "Wait For Saving Data",
      "type": "n8n-nodes-base.wait",
      "position": [
        3820,
        -1220
      ],
      "webhookId": "211ca61f-1915-4fb7-9ebf-8304c75d536e",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "d40ea975-5a33-485c-9811-7444181209ca",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        -1480
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "errorWorkflow": "7XxwbKvr4yHpGpKg",
    "executionOrder": "v1"
  },
  "versionId": "a6b663dd-a23e-4e18-abb8-65c23310056a",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Split Out Binary Files",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prompt": {
      "main": [
        [
          {
            "node": "Gemini API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini API": {
      "main": [
        [
          {
            "node": "JSON to string",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse string": {
      "main": [
        [
          {
            "node": "Add to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Loop Over Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JSON to string": {
      "main": [
        [
          {
            "node": "Parse string",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Google Drive Get Receipt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait For Saving": {
      "main": [
        [
          {
            "node": "Loop Over Attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create File Name": {
      "main": [
        [
          {
            "node": "Google Drive Save Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Emails": {
      "main": [
        [
          {
            "node": "Loop Over Attachments",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Google Sheets": {
      "main": [
        [
          {
            "node": "Wait For Saving Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait For Saving Data": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Attachments": {
      "main": [
        [],
        [
          {
            "node": "Create File Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Binary Files": {
      "main": [
        [
          {
            "node": "Loop Over Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger Image": {
      "main": [
        [
          {
            "node": "Create File Name For Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Save Files": {
      "main": [
        [
          {
            "node": "Wait For Saving",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Get Receipt": {
      "main": [
        [
          {
            "node": "Move file to base64 string",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move file to base64 string": {
      "main": [
        [
          {
            "node": "Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create File Name For Telegram": {
      "main": [
        [
          {
            "node": "Google Save Files 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger New Files": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Related Workflows

Automate Customer Inquiries with OpenAI Chat and HTTP Request

Automate customer inquiries using an AI assistant powered by OpenAI GPT and HTTP Request integration. This workflow enables real-time responses to customer questions, ensuring support is available 24/7. Features include conversation memory for engaging chats, automatic message processing for instant replies, and HTML for rich content rendering. Perfect for e-commerce businesses managing over 100 daily inquiries or SaaS platforms requiring real-time user support. Requires 1 account: OpenAI API. Save 5 hours weekly by handling unlimited customer inquiries with precise, context-aware answers from your product documentation.

330,242 views
Market ResearchAI Summarization

Automate YouTube Transcription Notifications to Telegram with AI

Automate notifications for new YouTube transcriptions directly to your Telegram channel using the Telegram Bot API and n8n. This workflow captures video transcriptions and sends real-time alerts, ensuring your team stays updated on new content instantly. Features seamless integration with OpenAI GPT for enhanced processing, immediate message delivery, and automated updates for effortless management. Perfect for content creators, digital marketers, or social media managers who need to keep track of multiple YouTube channels. Requires 1 account: Telegram Bot Token. Save hours weekly by automating video transcription alerts and ensuring prompt access to critical updates.

92,837 views
Market ResearchAI Summarization

Automate Customer Inquiries with OpenAI Agent and HTTP Requests

Automate customer inquiries through forms using an AI assistant powered by OpenAI's Agent and HTTP Request. This workflow enables instant responses to user queries, ensuring 24/7 support without human intervention. Features real-time chat capabilities, AI-driven context understanding, and seamless integration with various platforms. Perfect for e-commerce sites handling over 50 daily inquiries or SaaS companies looking to enhance customer support efficiency. Requires 1 account: OpenAI API. Achieve a 90% reduction in response time and handle unlimited inquiries with tailored, accurate answers.

91,865 views
Market ResearchAI Summarization

Automate Data Management with OpenAI and Google Sheets API Workflows

Automate data management tasks using OpenAI GPT and Google Sheets API for efficient data extraction and processing. This workflow enables you to automatically extract relevant information from HTML sources and consolidate it into Google Sheets, simplifying your data organization. Key features include real-time data extraction, seamless HTML parsing, and automated entry into spreadsheets. Perfect for data analysts or teams managing large datasets that require constant updates. Requires 2 accounts: OpenAI API Key and Google Sheets OAuth. Save up to 10 hours weekly by automating data entry and retrieval, ensuring your team has accurate information at their fingertips.

79,847 views
Lead GenerationAI Summarization

How to Use This Workflow

1Import to n8n

  1. Copy the JSON using the button above
  2. Open your n8n instance
  3. Click “Import workflow” or press Ctrl+V
  4. Paste the JSON and click “Import”

2Before Running

Configure credentials and update service-specific settings before executing the workflow. Review required credentials in the Technical Details section above.

4.2K