Vision API와 LLM을 사용하여 자동화된发票 수집 및 데이터 추출
고급
이것은Invoice Processing, Multimodal AI분야의자동화 워크플로우로, 17개의 노드를 포함합니다.주로 Set, Code, Telegram, FormTrigger, GoogleDrive 등의 노드를 사용하며. Google Vision OCR, Gemini LLM, Google Sheets를 사용하여 청구서 데이터를 추출하고 구조화합니다.
사전 요구사항
- •Telegram Bot Token
- •Google Drive API 인증 정보
- •대상 API의 인증 정보가 필요할 수 있음
- •Google Sheets API 인증 정보
사용된 노드 (17)
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
"id": "weV4UB3UBRHEfe1k",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Automated Invoice Collection & Data Extraction Using Vision API and LLM",
"tags": [],
"nodes": [
{
"id": "2b378a23-08b9-4b7e-b1c5-114087802a71",
"name": "스티커 메모1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
-480
],
"parameters": {
"width": 580,
"height": 1200,
"content": "# Automated Invoice Collection & Data Extraction Using Vision API and LLM\n\nThis workflow automates the process of collecting uploaded invoices, extracting text using **Google Vision API**, and processing the extracted text with an LLM to produce structured data containing key transaction details such as **date, voucher number, transaction detail, vendor, and transaction value**. \nThe final data is saved to **Google Sheets** and a notification is sent to **Telegram** in real time.\n\n## ✨ Key Features\n- **Invoice Upload Form** \n Users can upload invoice images through a provided form.\n- **Google Drive Integration** \n Files are stored in a specified Google Drive folder with a shareable preview link.\n- **OCR via Google Vision API** \n Converts invoice images to text using `TEXT_DETECTION`.\n- **Data Structuring via LLM** \n Uses LLM model to parse and structure data.\n- **Structured Output Parser** \n Ensures consistent output with required columns.\n- **Data Cleaning** \n Cleans and formats numeric values without currency symbols.\n- **Google Sheets Sync** \n Appends or updates transaction data in Google Sheets (matched by file ID). \n **Template:** [Google Sheets](https://docs.google.com/spreadsheets/d/1HMzQtFK9T-GDxGFSD7ErW_QLlq-PvCvoFASiHGG2fGM/edit?gid=0#gid=0)\n- **Telegram Notification** \n Sends a transaction summary directly to a Telegram chat/group.\n\n---\n\n## 🔐 Required Credentials\n- **Google Vision API Key** → for OCR processing. \n- **OpenRouter API Key** → to access the Gemini Flash LLM. \n- **Google Drive OAuth2** → to upload and download invoice files. \n- **Google Sheets OAuth2** → to write or update spreadsheet data. \n- **Telegram Bot Token** → to send notifications to Telegram. \n- **Telegram Chat ID** → target chat/group for notifications.\n\n---\n\n## 🎁 Benefits\n- **Fully automated** from invoice upload to structured reporting.\n- **Time-saving** by eliminating manual transaction data entry.\n- **Real-time integration** with Google Sheets for reporting and auditing.\n- **Instant notifications** via Telegram for quick transaction monitoring.\n- **Duplicate prevention** using file ID as a matching key.\n- **Flexible** for accounting, finance, or administrative teams.\n"
},
"typeVersion": 1
},
{
"id": "e4ac27f9-6db0-489f-bd7f-033fd792fc7c",
"name": "Vision API 설정",
"type": "n8n-nodes-base.set",
"position": [
1120,
20
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "586cf442-13be-4996-9824-366e20ab864e",
"name": "visionAPI",
"type": "string",
"value": "YOUR_VISION_API_KEY_HERE"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "2e81ab2f-5f8f-4676-bfbf-9753bad4369e",
"name": "기본 LLM 체인",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
1540,
20
],
"parameters": {
"text": "={{ $json.responses[0].fullTextAnnotation.text }}",
"batching": {},
"messages": {
"messageValues": [
{
"message": "=You are a professional accountant experienced in preparing financial reports and classifying expenses into appropriate categories.\nYou will receive input data extracted via OCR that needs to be parsed and structured.\n\nInstructions:\n\nOutput must be in the same language as the input.\nParse and return the data in this column order:\nDATE : Extract in YYYY-MM-DD format, if not found use current date\nNO VOUCHER : Extract invoice or voucher number, if not found return not found\nTRANSACTION DETAIL : Short summary of products or services, if not found return not found\nVENDOR : Store or vendor name, if not found return not found\nVALUE : Transaction total amount as a number without currency symbol, if not found return 0\n\nMissing text fields : not found\nMissing numeric values : 0\nOutput only the structured data, no extra explanations"
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "d0ca7089-c557-48d8-a854-310efbc5b5be",
"name": "OpenRouter 채팅 모델",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
1540,
220
],
"parameters": {
"model": "google/gemini-2.0-flash-exp:free",
"options": {}
},
"typeVersion": 1
},
{
"id": "22bbee6d-a897-4f2a-b0c9-06b7574ebf8e",
"name": "구조화된 출력 파서",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1700,
220
],
"parameters": {
"jsonSchemaExample": "{\n \"DATE\": \"2025-07-07\",\n \"NO VOUCHER\": \"INV-001234\",\n \"TRANSACTION DETAIL\": \"Product summary\",\n \"VENDOR\": \"Vendor Name or Shop Name\",\n \"VALUE\": 0\n}"
},
"typeVersion": 1.3
},
{
"id": "8a108ae0-3061-49a9-aef1-c426f078cca1",
"name": "파일 다운로드",
"type": "n8n-nodes-base.googleDrive",
"position": [
740,
20
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {},
"operation": "download"
},
"typeVersion": 3
},
{
"id": "0a96b787-f8e4-408c-80d8-dc2a868c93e4",
"name": "HTTP 요청",
"type": "n8n-nodes-base.httpRequest",
"position": [
1320,
20
],
"parameters": {
"url": "=https://vision.googleapis.com/v1/images:annotate?key={{ $json.visionAPI }}",
"method": "POST",
"options": {},
"jsonBody": "={\n \"requests\": [\n {\n \"image\": {\n \"content\": \"{{ $('Code').item.json.base64 }}\"\n },\n \"features\": [\n {\n \"type\": \"TEXT_DETECTION\"\n }\n ]\n }\n ]\n}\n",
"sendBody": true,
"specifyBody": "json"
},
"typeVersion": 4.2
},
{
"id": "c2b91608-a4bc-4c65-9697-af3d05e6b097",
"name": "문자 메시지 보내기",
"type": "n8n-nodes-base.telegram",
"position": [
2300,
20
],
"parameters": {
"text": "=💳 New transaction : \n- Date : {{ $json.DATE }}\n- Transaction detail : {{ $json['TRANSACTION DETAIL'] }}\n- Vendor : {{ $json.VENDOR }}\n- Total transaction : {{ $json.VALUE }}\n\n---",
"chatId": "YOUR_TELEGRAM_CHAT_ID",
"additionalFields": {
"appendAttribution": false
}
},
"typeVersion": 1.2
},
{
"id": "89ae0865-ac70-4cdb-8f14-e64dd023ede2",
"name": "파일 업로드",
"type": "n8n-nodes-base.googleDrive",
"position": [
520,
20
],
"parameters": {
"name": "={{ $json.Image[0].filename }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_DRIVE_FOLDER_ID"
},
"inputDataFieldName": "=Image"
},
"typeVersion": 3
},
{
"id": "2dc29bd4-058e-426f-a78c-e99b15f67c82",
"name": "코드",
"type": "n8n-nodes-base.code",
"position": [
940,
20
],
"parameters": {
"mode": "runOnceForEachItem",
"jsCode": "// Convert file to base64 for Vision API\nconst base64 = item.binary.data.data; // 'data' is the binary name\nreturn {\n json: {\n base64\n }\n};\n"
},
"typeVersion": 2
},
{
"id": "a755e54a-5361-46aa-8db0-089a22195b96",
"name": "코드1",
"type": "n8n-nodes-base.code",
"position": [
1880,
20
],
"parameters": {
"jsCode": "function cleanNumber(n) {\n return parseInt(n.toString().replace(/[.,]/g, '')) || 0;\n}\n\n// Get output from $json\nconst output = $json.output || {};\n\n// If there are Items, process them. If not, skip.\nconst items = Array.isArray(output.Items)\n ? output.Items.map(item => ({\n ...item,\n Quantity: cleanNumber(item.Quantity),\n \"Unit Price\": cleanNumber(item[\"Unit Price\"]),\n Total: cleanNumber(item.Total),\n }))\n : undefined;\n\n// Optional: clean Total Amount as well\nconst totalAmount = output[\"Total Amount\"]\n ? cleanNumber(output[\"Total Amount\"])\n : 0;\n\nreturn {\n json: {\n output: {\n ...output,\n ...(items && { Items: items }),\n \"Total Amount\": totalAmount,\n }\n }\n};\n"
},
"typeVersion": 2
},
{
"id": "606d3086-073c-40b5-b65e-c9de3101d86d",
"name": "시트에 행 추가 또는 업데이트",
"type": "n8n-nodes-base.googleSheets",
"position": [
2100,
20
],
"parameters": {
"columns": {
"value": {
"ID": "={{ $('Download file').item.json.id }}",
"IMG": "={{ $('Download file').item.json.webViewLink }}",
"DATE": "={{ $json.output.DATE }}",
"VALUE": "={{ $json.output.VALUE }}",
"VENDOR": "={{ $json.output.VENDOR }}",
"FILE NAME": "={{ $('Download file').item.json.name }}",
"NO VOUCHER": "={{ $json.output['NO VOUCHER'] }}",
"TRANSACTION DETAIL": "={{ $json.output['TRANSACTION DETAIL'] }}"
},
"schema": [
{
"id": "ID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "FILE NAME",
"type": "string",
"display": true,
"required": false,
"displayName": "FILE NAME",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "IMG",
"type": "string",
"display": true,
"required": false,
"displayName": "IMG",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "DATE",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "DATE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "NO VOUCHER",
"type": "string",
"display": true,
"required": false,
"displayName": "NO VOUCHER",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "TRANSACTION DETAIL",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "TRANSACTION DETAIL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "VENDOR",
"type": "string",
"display": true,
"required": false,
"displayName": "VENDOR",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "VALUE",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "VALUE",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"ID"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEETS_DOCUMENT_ID"
}
},
"typeVersion": 4.6
},
{
"id": "71add4c5-64ef-49e2-9fbf-7b6034b17705",
"name": "양식 제출 시",
"type": "n8n-nodes-base.formTrigger",
"position": [
300,
20
],
"parameters": {
"options": {
"appendAttribution": false
},
"formTitle": "Upload Purchase Invoice",
"formFields": {
"values": [
{
"fieldType": "file",
"fieldLabel": "Image",
"requiredField": true,
"acceptFileTypes": ".jpg, .png, .jpeg"
}
]
},
"responseMode": "lastNode"
},
"typeVersion": 2.2
},
{
"id": "98b5b08e-2b7c-4360-a224-43fd6059bb34",
"name": "스티커 메모2",
"type": "n8n-nodes-base.stickyNote",
"position": [
260,
-200
],
"parameters": {
"color": 2,
"width": 600,
"height": 400,
"content": "- This node triggers the workflow when a user submits a form titled \"Upload Purchase Invoice\".\n- Uploads the file received from the form into a specific Google Drive folder.\n- Downloads the file from Google Drive using the file ID obtained from the previous Upload file node."
},
"typeVersion": 1
},
{
"id": "4e897daa-cde8-4d25-8217-9f722c68fe4d",
"name": "스티커 메모",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
-200
],
"parameters": {
"color": 4,
"width": 560,
"height": 400,
"content": "- Converts the downloaded invoice file (binary) into Base64 format so that it can be sent to the Google Vision API.\n- Adds the Google Vision API key into the workflow data so it can be used in the HTTP request.\n- Sends the Base64-encoded image to the Google Vision API for OCR processing."
},
"typeVersion": 1
},
{
"id": "510e3239-fbbd-4b47-9c31-813994c3e251",
"name": "스티커 메모3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1480,
-200
],
"parameters": {
"color": 5,
"width": 560,
"height": 580,
"content": "- Processes OCR text through an LLM to extract and structure key invoice details.\n- Forces the LLM to produce output in a fixed JSON schema.\n- Cleans and normalizes numeric fields from the LLM output."
},
"typeVersion": 1
},
{
"id": "71dcd4e0-84cc-4b20-ac60-6701cc4e5f60",
"name": "스티커 메모4",
"type": "n8n-nodes-base.stickyNote",
"position": [
2060,
-200
],
"parameters": {
"color": 6,
"width": 380,
"height": 580,
"content": "- Writes the extracted and cleaned invoice data into a Google Sheets document, either adding a new row or updating an existing one.\n- Sends a Telegram message summarizing the new or updated transaction entry."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "a58b0780-6c63-40bb-84bd-a621579d6eef",
"connections": {
"2dc29bd4-058e-426f-a78c-e99b15f67c82": {
"main": [
[
{
"node": "e4ac27f9-6db0-489f-bd7f-033fd792fc7c",
"type": "main",
"index": 0
}
]
]
},
"a755e54a-5361-46aa-8db0-089a22195b96": {
"main": [
[
{
"node": "606d3086-073c-40b5-b65e-c9de3101d86d",
"type": "main",
"index": 0
}
]
]
},
"89ae0865-ac70-4cdb-8f14-e64dd023ede2": {
"main": [
[
{
"node": "8a108ae0-3061-49a9-aef1-c426f078cca1",
"type": "main",
"index": 0
}
]
]
},
"0a96b787-f8e4-408c-80d8-dc2a868c93e4": {
"main": [
[
{
"node": "2e81ab2f-5f8f-4676-bfbf-9753bad4369e",
"type": "main",
"index": 0
}
]
]
},
"8a108ae0-3061-49a9-aef1-c426f078cca1": {
"main": [
[
{
"node": "2dc29bd4-058e-426f-a78c-e99b15f67c82",
"type": "main",
"index": 0
}
]
]
},
"e4ac27f9-6db0-489f-bd7f-033fd792fc7c": {
"main": [
[
{
"node": "0a96b787-f8e4-408c-80d8-dc2a868c93e4",
"type": "main",
"index": 0
}
]
]
},
"2e81ab2f-5f8f-4676-bfbf-9753bad4369e": {
"main": [
[
{
"node": "a755e54a-5361-46aa-8db0-089a22195b96",
"type": "main",
"index": 0
}
]
]
},
"71add4c5-64ef-49e2-9fbf-7b6034b17705": {
"main": [
[
{
"node": "89ae0865-ac70-4cdb-8f14-e64dd023ede2",
"type": "main",
"index": 0
}
]
]
},
"d0ca7089-c557-48d8-a854-310efbc5b5be": {
"ai_languageModel": [
[
{
"node": "2e81ab2f-5f8f-4676-bfbf-9753bad4369e",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"22bbee6d-a897-4f2a-b0c9-06b7574ebf8e": {
"ai_outputParser": [
[
{
"node": "2e81ab2f-5f8f-4676-bfbf-9753bad4369e",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"606d3086-073c-40b5-b65e-c9de3101d86d": {
"main": [
[
{
"node": "c2b91608-a4bc-4c65-9697-af3d05e6b097",
"type": "main",
"index": 0
}
]
]
}
}
}자주 묻는 질문
이 워크플로우를 어떻게 사용하나요?
위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.
이 워크플로우는 어떤 시나리오에 적합한가요?
고급 - 청구서 처리, 멀티모달 AI
유료인가요?
이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.
관련 워크플로우 추천
YouTube 댓글 감정 및 키워드 추출기
Gemini AI를 사용하여 YouTube 댓글 감성 및 키워드 분석 및 Telegram으로 보고
Set
Code
Telegram
+
Set
Code
Telegram
20 노드Budi SJ
시장 조사
자동화된 비디오 생성기
DeepSeek, TTS, Together.ai를 사용하여 스크립트에서 AI 비디오 생성
Set
Code
Wait
+
Set
Code
Wait
81 노드Lakindu Siriwardana
콘텐츠 제작
AI, 소셜 미디어 및 WhatsApp 링크 기반 자동화된 로컬 비즈니스 리드 생성기
AI, 소셜 미디어 및 WhatsApp 링크를 사용한 지역 비즈니스 리드 자동 생성
If
Code
Limit
+
If
Code
Limit
29 노드Budi SJ
리드 생성
자동화된 애플리케이션 분석 및 ASO 보고서 생성기
Gemini AI와 Google Docs를 사용하여 Google Play 앱에서 ASO 보고서 생성
Code
Telegram
Google Docs
+
Code
Telegram
Google Docs
13 노드Budi SJ
시장 조사
Telegram의 DOI URL을 통해 Zotero에 연구 논문을 자동으로 가져오기
Telegram에서 연구 논문을 Zotero에 가져오기, AI 요약 포함
If
Set
Code
+
If
Set
Code
25 노드Budi SJ
AI 요약
AI 기반 잠재고객 자격 평가 및 개인화 접근 (Relevance AI 활용)
AI 기반 잠재고객 자격 평가 및 개인화 접근: Relevance AI 사용
Set
Code
Gmail
+
Set
Code
Gmail
34 노드Diptamoy Barman
콘텐츠 제작
워크플로우 정보
난이도
고급
노드 수17
카테고리2
노드 유형11
저자
Budi SJ
@budisjI’m a Product Designer who also works as an Automation Developer. With a background in product design and systems thinking, I build user-centered workflows. My focus is on helping teams and businesses work more productively through impactful automation systems.
외부 링크
n8n.io에서 보기 →
이 워크플로우 공유