8
n8n 한국어amn8n.com

이메일 인보이스 데이터 추출하여 Google Sheets에 저장

중급

이것은Finance, AI분야의자동화 워크플로우로, 10개의 노드를 포함합니다.주로 Code, Filter, GoogleDrive, GmailTrigger, GoogleSheets 등의 노드를 사용하며인공지능 기술을 결합하여 스마트 자동화를 구현합니다. GPT-4o AI를 사용하여 이메일에서 발표 데이터를 Google Sheets로 자동 추출

사전 요구사항
  • Google Drive API 인증 정보
  • Google 계정 및 Gmail API 인증 정보
  • Google Sheets API 인증 정보
  • OpenAI API Key

카테고리

워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "5aaf4236c70e34e423fbdb2c7b754d19253a933bb1476d548f75848a01e473cf",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "70ca3a90-55c8-4e46-9278-6a8fd3d107cd",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -1820,
        220
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "labelIds": [
            "Label_1393502052621954450"
          ]
        },
        "options": {
          "downloadAttachments": true
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f7dcff0f-7e98-4042-a33e-2fc32d876908",
      "name": "빈 스프레드시트 생성",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -780,
        220
      ],
      "parameters": {
        "title": "=invoice_{{ $now }}",
        "options": {},
        "resource": "spreadsheet",
        "sheetsUi": {
          "sheetValues": [
            {
              "title": "=invoice_details"
            }
          ]
        }
      },
      "executeOnce": false,
      "typeVersion": 4.5
    },
    {
      "id": "9769ad04-a41c-4d55-806a-042b7d00e131",
      "name": "인보이스 폴더로 스프레드시트 이동",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -560,
        220
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.spreadsheetId }}"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1JIdajTJvK6gj4bRjniBJvHEJbQ1pn3AM",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1JIdajTJvK6gj4bRjniBJvHEJbQ1pn3AM",
          "cachedResultName": "invoices"
        },
        "operation": "move"
      },
      "typeVersion": 3
    },
    {
      "id": "f9dbfe55-70b0-4abc-9745-9f4a65d5d1c2",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1180,
        480
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {
          "responseFormat": "json_object"
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "7dME1fmMlkFyzFjq",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "00c59142-6079-4e9c-9374-ad487e48f072",
      "name": "첨부 파일 확인",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1600,
        220
      ],
      "parameters": {
        "options": {
          "ignoreCase": false
        },
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "efd974d9-aa20-461a-86ae-6e0a16d1527d",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('Gmail Trigger').item.binary }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8a29ac14-be2b-468a-97fa-540d28e80006",
      "name": "인보이스 데이터 추출",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1380,
        220
      ],
      "parameters": {
        "options": {},
        "operation": "pdf",
        "binaryPropertyName": "={{ $('Attachment Verification').item.binary.keys() }}"
      },
      "typeVersion": 1
    },
    {
      "id": "ae08cdc8-fcf9-4891-be86-b2dcf6f35278",
      "name": "최종 데이터 준비",
      "type": "n8n-nodes-base.code",
      "position": [
        -340,
        220
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of $input$json.output.first().json.outputeach one\n\nlet invoice_details = $('Invoice AI Agent').item.json.output\n\nreturn JSON.parse(invoice_details)"
      },
      "typeVersion": 2
    },
    {
      "id": "7615a5b0-8761-43e2-82b0-32ac5c772f44",
      "name": "인보이스 데이터가 포함된 최종 스프레드시트",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -140,
        220
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "billed_to",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "billed_to",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "invoice_number",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "invoice_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date_of_issue",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "date_of_issue",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "due_date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "due_date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "item_0_description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "item_0_description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "item_0_quantity",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "item_0_quantity",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "item_0_rate",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "item_0_rate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "item_0_amount",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "item_0_amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tax_0_cgst_rate",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "tax_0_cgst_rate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tax_0_cgst_amount",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "tax_0_cgst_amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tax_0_sgst_rate",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "tax_0_sgst_rate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tax_0_sgst_amount",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "tax_0_sgst_amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "item_0_total_amount",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "item_0_total_amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "subtotal",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "subtotal",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "total",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "total",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "terms",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "terms",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "conditions_instructions",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "conditions_instructions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "company_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_mobile",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "company_mobile",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "company_email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_website",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "company_website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "payment_transaction_ids",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "payment_transaction_ids",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "mode_of_payment",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "mode_of_payment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "billing_address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "billing_address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "shipping_address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "shipping_address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "place_of_supply",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "place_of_supply",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "place_of_delivery",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "place_of_delivery",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "gst_registration_no",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "gst_registration_no",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "pan_no",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "pan_no",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "invoice_details"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create blank spreadsheet').item.json.spreadsheetId }}"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "e68aa386-7150-4070-a5d7-1dcb963b620d",
      "name": "Invoice AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1160,
        220
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "you are an financial advisor , who reads the array of data to identify certain elements of an Invoice, from the input data and provide a json response. use only following specified keys \nfor example:\n{\n\"billed_to\": \"John\",\n\"invoice_number\": \"569871234\",\n\"date_of_issue\": \"2025-05-21\",\n\"due_date\": \"2025-05-25\",\n\"item_0_description\": \"Computer CPU\",\n\"item_0_quantity\": 6,\n\"item_0_rate\": 15,\n\"item_0_amount\": 90,\n\"item_1_description\": \"Chair Wooden\",\n\"item_1_quantity\": 8,\n\"item_1_rate\": 10,\n\"item_1_amount\": 80,\n\"subtotal\": 170.00,\n\"discount\": 20.00,\n\"total\": 150.00,\n\"terms\": \"Sold items not be acceptable\",\n\"conditions_instructions\": \"xyaABC\",\n\"company_name\": \"Digital Electronics\",\n\"company_mobile\": \"987654321\",\n\"company_email\": \"ayz@gmail.com\",\n\"company_website\": \"www.abc.com\"\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.9,
      "alwaysOutputData": false
    },
    {
      "id": "335a80c5-ad86-4379-b1a6-9a2ef7285f3c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2860,
        100
      ],
      "parameters": {
        "width": 880,
        "height": 1520,
        "content": "AI Invoice Processor Agent: Email to Structured Data\nAutomatically extract, analyze, and organize invoice data from Gmail attachments into structured Google Sheets. Perfect for:\n✅ Accountants & bookkeepers — eliminate manual data entry from invoices\n✅ Small businesses — streamline invoice processing and tracking\n✅ Finance teams — automate accounts payable workflows\n\n⚙️ What's Used\nn8n Nodes:\nGmail Trigger → File Extraction → AI Agent → OpenAI Chat Model → Google Sheets → Google Drive\nExternal Tools:\n\nGmail API – Monitor specific labeled emails with attachments\nPDF Extraction – Convert invoice PDFs to readable text\nOpenAI GPT-4 – Intelligent invoice data extraction and structuring\nGoogle Sheets – Create organized spreadsheets with invoice details\nGoogle Drive – Automatically organize files in invoice folders\n\n\n🔑 Setup – Credentials Needed\n\nGmail OAuth2 → Access emails and download attachments\nOpenAI API Key → For AI-powered invoice data extraction\nGoogle Sheets OAuth2 → Create and populate spreadsheets\nGoogle Drive OAuth2 → Organize files in designated folders\n\n\n📧 Gmail Setup Required\nCreate a Gmail label (e.g., \"Invoice Processing\") and apply it to emails containing invoice attachments. The workflow will monitor this label for new emails every minute.\n\n🚀 Workflow Steps\n\nEmail Monitoring\nContinuously watches Gmail for new emails with specific labels and attachments\nAttachment Verification\nFilters emails to ensure they contain PDF attachments before processing\nData Extraction\nConverts PDF invoices to text and extracts readable content\nAI-Powered Analysis\nGPT processes invoice text and extracts structured data including:\n\nCompany details and contact information\nInvoice numbers, dates, and due dates\nLine items with quantities, rates, and amounts\nTax calculations (CGST, SGST, VAT)\nPayment terms and billing addresses\n\n\nSpreadsheet Creation\nCreates timestamped Google Sheets with organized invoice data\nFile Organization\nMoves processed spreadsheets to designated Drive folders for easy access\n\n\n📊 Extracted Data Fields\nThe AI identifies and organizes 25+ invoice elements:\n\nHeader Info: Billed to, invoice number, dates\nLine Items: Description, quantity, rate, amount\nTax Details: CGST/SGST rates and amounts\nCompany Info: Name, contact details, GST numbers\nPayment Info: Transaction IDs, payment methods\nAddresses: Billing, shipping, delivery locations\n\n\n💡 Pro Tips\n\nUse clear Gmail labels for different invoice types (vendors, clients, etc.)\nEnsure invoice PDFs are text-based (not scanned images) for best results\nCreate separate Drive folders for different accounting periods\nReview AI extraction accuracy and refine prompts as needed\nSet up email filters to automatically apply labels to vendor emails\n\n\n🛠️ Customize It\n\nAdd invoice approval workflows with email notifications\nConnect to accounting software (QuickBooks, Xero, SAP)\nInclude OCR processing for scanned invoice images\nAdd duplicate invoice detection and alerts\nCreate automated payment reminders based on due dates"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "70ca3a90-55c8-4e46-9278-6a8fd3d107cd": {
      "main": [
        [
          {
            "node": "00c59142-6079-4e9c-9374-ad487e48f072",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e68aa386-7150-4070-a5d7-1dcb963b620d": {
      "main": [
        [
          {
            "node": "f7dcff0f-7e98-4042-a33e-2fc32d876908",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f9dbfe55-70b0-4abc-9745-9f4a65d5d1c2": {
      "ai_languageModel": [
        [
          {
            "node": "e68aa386-7150-4070-a5d7-1dcb963b620d",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "8a29ac14-be2b-468a-97fa-540d28e80006": {
      "main": [
        [
          {
            "node": "e68aa386-7150-4070-a5d7-1dcb963b620d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ae08cdc8-fcf9-4891-be86-b2dcf6f35278": {
      "main": [
        [
          {
            "node": "7615a5b0-8761-43e2-82b0-32ac5c772f44",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "00c59142-6079-4e9c-9374-ad487e48f072": {
      "main": [
        [
          {
            "node": "8a29ac14-be2b-468a-97fa-540d28e80006",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f7dcff0f-7e98-4042-a33e-2fc32d876908": {
      "main": [
        [
          {
            "node": "9769ad04-a41c-4d55-806a-042b7d00e131",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9769ad04-a41c-4d55-806a-042b7d00e131": {
      "main": [
        [
          {
            "node": "ae08cdc8-fcf9-4891-be86-b2dcf6f35278",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급 - 금융, 인공지능

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수10
카테고리2
노드 유형9
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자
Yaron Been

Yaron Been

@yaron-nofluff

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34