은행 거래명세서 분석기 - 간소화 버전
중급
이것은Document Extraction, AI Summarization분야의자동화 워크플로우로, 9개의 노드를 포함합니다.주로 If, Code, OpenAi, Webhook, Postgres 등의 노드를 사용하며. AI 기반 은행 거래명세서 분석 및 거래 분류
사전 요구사항
- •OpenAI API Key
- •HTTP Webhook 엔드포인트(n8n이 자동으로 생성)
- •PostgreSQL 데이터베이스 연결 정보
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
"name": "Bank Statement Analyzer - Simplified",
"tags": [],
"nodes": [
{
"id": "webhook-001",
"name": "명세서 업로드",
"type": "n8n-nodes-base.webhook",
"position": [
400,
300
],
"parameters": {
"path": "/upload-statement",
"options": {
"rawBody": true
},
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "file-handler-001",
"name": "파일 핸들러",
"type": "n8n-nodes-base.code",
"position": [
600,
300
],
"parameters": {
"jsCode": "// Simple file processor\nconst inputData = $input.all()[0];\nconst files = [];\n\n// Handle file uploads\nif (inputData.binary) {\n Object.keys(inputData.binary).forEach(key => {\n const file = inputData.binary[key];\n files.push({\n filename: file.fileName,\n contentType: file.mimeType,\n uploadedAt: new Date().toISOString()\n });\n });\n}\n\nreturn files.map(file => ({\n json: {\n filename: file.filename,\n contentType: file.contentType,\n uploadedAt: file.uploadedAt,\n status: 'ready_for_processing'\n },\n binary: inputData.binary\n}));"
},
"typeVersion": 2
},
{
"id": "file-type-switch-001",
"name": "파일 형식 확인",
"type": "n8n-nodes-base.if",
"position": [
800,
300
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "pdf-condition",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.contentType }}",
"rightValue": "application/pdf"
}
]
}
},
"typeVersion": 2
},
{
"id": "pdf-extractor-001",
"name": "PDF 텍스트 추출",
"type": "n8n-nodes-base.extractFromFile",
"position": [
1000,
200
],
"parameters": {
"operation": "extractText"
},
"typeVersion": 1
},
{
"id": "excel-parser-001",
"name": "Excel/CSV 파싱",
"type": "n8n-nodes-base.spreadsheetFile",
"position": [
1000,
400
],
"parameters": {
"options": {
"headerRow": 0
},
"operation": "parseExcel"
},
"typeVersion": 2
},
{
"id": "ai-extractor-001",
"name": "AI 데이터 추출기",
"type": "n8n-nodes-base.openAi",
"position": [
1200,
300
],
"parameters": {
"model": "gpt-4o-mini",
"messages": {
"values": [
{
"role": "system",
"content": "Extract bank statement data and return clean JSON:\n\n{\n \"account_number\": \"****1234\",\n \"bank_name\": \"Bank Name\",\n \"statement_period\": \"2024-01-01 to 2024-01-31\",\n \"opening_balance\": 1500.00,\n \"closing_balance\": 1250.00,\n \"transactions\": [\n {\n \"date\": \"2024-01-15\",\n \"description\": \"GROCERY STORE\",\n \"amount\": -45.67,\n \"category\": \"groceries\"\n }\n ]\n}\n\nUse negative amounts for expenses, positive for income. Categorize transactions as: groceries, dining, gas, shopping, utilities, healthcare, entertainment, income, fees, or other."
},
{
"role": "user",
"content": "{{ $json.data || $json.extracted_text }}"
}
]
}
},
"credentials": {
"openAiApi": {
"id": "",
"name": "OpenAI API"
}
},
"typeVersion": 1
},
{
"id": "data-processor-001",
"name": "처리 및 요약",
"type": "n8n-nodes-base.code",
"position": [
1400,
300
],
"parameters": {
"jsCode": "// Clean and validate extracted data\nconst inputData = $input.all()[0];\nlet extractedData = {};\n\n// Parse AI response\ntry {\n const content = inputData.json.message?.content || inputData.json;\n if (typeof content === 'string') {\n const jsonMatch = content.match(/{[\\s\\S]*}/);\n if (jsonMatch) {\n extractedData = JSON.parse(jsonMatch[0]);\n }\n } else {\n extractedData = content;\n }\n} catch (error) {\n console.log('Parse error:', error.message);\n extractedData = { transactions: [] };\n}\n\n// Clean transaction data\nconst cleanTransactions = (extractedData.transactions || []).map((tx, index) => ({\n id: `tx_${Date.now()}_${index}`,\n date: tx.date,\n description: (tx.description || '').trim().toUpperCase(),\n amount: parseFloat(tx.amount) || 0,\n category: tx.category || 'other',\n processed_at: new Date().toISOString()\n}));\n\n// Calculate summary\nconst totalExpenses = cleanTransactions\n .filter(tx => tx.amount < 0)\n .reduce((sum, tx) => sum + Math.abs(tx.amount), 0);\n\nconst totalIncome = cleanTransactions\n .filter(tx => tx.amount > 0)\n .reduce((sum, tx) => sum + tx.amount, 0);\n\nconst categoryTotals = {};\ncleanTransactions.forEach(tx => {\n if (tx.amount < 0) { // Only expenses\n categoryTotals[tx.category] = (categoryTotals[tx.category] || 0) + Math.abs(tx.amount);\n }\n});\n\nreturn [{\n json: {\n account_info: {\n account_number: extractedData.account_number || 'Unknown',\n bank_name: extractedData.bank_name || 'Unknown',\n statement_period: extractedData.statement_period || 'Unknown',\n opening_balance: parseFloat(extractedData.opening_balance) || 0,\n closing_balance: parseFloat(extractedData.closing_balance) || 0\n },\n transactions: cleanTransactions,\n summary: {\n total_transactions: cleanTransactions.length,\n total_expenses: totalExpenses,\n total_income: totalIncome,\n net_change: totalIncome - totalExpenses,\n category_breakdown: categoryTotals\n },\n processed_at: new Date().toISOString(),\n status: 'completed'\n }\n}]);"
},
"typeVersion": 2
},
{
"id": "save-to-db-001",
"name": "데이터베이스 저장",
"type": "n8n-nodes-base.postgres",
"position": [
1600,
200
],
"parameters": {
"table": "bank_statements",
"columns": {
"value": {
"raw_data": "={{ JSON.stringify($json) }}",
"bank_name": "={{ $json.account_info.bank_name }}",
"processed_at": "={{ $json.processed_at }}",
"total_income": "={{ $json.summary.total_income }}",
"account_number": "={{ $json.account_info.account_number }}",
"total_expenses": "={{ $json.summary.total_expenses }}",
"statement_period": "={{ $json.account_info.statement_period }}",
"total_transactions": "={{ $json.summary.total_transactions }}"
},
"mappingMode": "defineBelow"
},
"resource": "database",
"operation": "insert"
},
"credentials": {
"postgres": {
"id": "",
"name": "PostgreSQL"
}
},
"typeVersion": 2.4
},
{
"id": "response-001",
"name": "응답 전송",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1600,
400
],
"parameters": {
"respondWith": "json",
"responseBody": "={\n \"success\": true,\n \"message\": \"Statement processed successfully\",\n \"data\": {\n \"account\": \"{{ $json.account_info.account_number }}\",\n \"transactions_processed\": {{ $json.summary.total_transactions }},\n \"total_expenses\": {{ $json.summary.total_expenses }},\n \"total_income\": {{ $json.summary.total_income }},\n \"categories\": {{ JSON.stringify($json.summary.category_breakdown) }}\n }\n}"
},
"typeVersion": 1
}
],
"notes": [
{
"id": "note-001",
"width": 160,
"height": 80,
"content": "📥 **ENTRY POINT**\n\nUsers upload bank statements here via POST request",
"position": [
320,
180
]
},
{
"id": "note-002",
"width": 160,
"height": 100,
"content": "🔍 **FILE PREP**\n\nExtracts file info and prepares for processing. Handles multiple file formats.",
"position": [
520,
180
]
},
{
"id": "note-003",
"width": 160,
"height": 120,
"content": "🔀 **SMART ROUTING**\n\nPDFs go to text extraction\nExcel/CSV files go to spreadsheet parser\n\nAutomatic format detection",
"position": [
720,
120
]
},
{
"id": "note-004",
"width": 160,
"height": 90,
"content": "📄 **PDF HANDLER**\n\nExtracts text from PDF bank statements using OCR",
"position": [
920,
80
]
},
{
"id": "note-005",
"width": 160,
"height": 90,
"content": "📊 **SPREADSHEET HANDLER**\n\nParses Excel/CSV files and converts to structured data",
"position": [
920,
480
]
},
{
"id": "note-006",
"width": 160,
"height": 140,
"content": "🤖 **AI MAGIC**\n\nGPT-4 extracts:\n• Account details\n• All transactions \n• Auto-categorizes expenses\n• Calculates balances\n\nSmart & accurate!",
"position": [
1120,
140
]
},
{
"id": "note-007",
"width": 160,
"height": 120,
"content": "🧹 **DATA CLEANUP**\n\nCleans & validates:\n• Transaction formatting\n• Amount calculations\n• Category summaries\n• Error handling",
"position": [
1320,
140
]
},
{
"id": "note-008",
"width": 160,
"height": 80,
"content": "💾 **PERSISTENCE**\n\nSaves processed data to PostgreSQL database",
"position": [
1520,
80
]
},
{
"id": "note-009",
"width": 160,
"height": 100,
"content": "✅ **SUCCESS RESPONSE**\n\nReturns summary:\n• Transaction count\n• Expense totals\n• Category breakdown",
"position": [
1520,
480
]
},
{
"id": "note-010",
"width": 200,
"height": 120,
"content": "💡 **WORKFLOW FEATURES**\n\n✓ Handles PDF & Excel files\n✓ AI-powered extraction \n✓ Auto-categorization\n✓ Database storage\n✓ Clean API responses",
"position": [
200,
450
]
},
{
"id": "note-011",
"width": 180,
"height": 140,
"content": "🎯 **TYPICAL OUTPUT**\n\n```json\n{\n \"success\": true,\n \"transactions_processed\": 45,\n \"total_expenses\": 2847.32,\n \"categories\": {\n \"groceries\": 450.23,\n \"dining\": 287.45\n }\n}\n```",
"position": [
1700,
240
]
}
],
"pinData": {},
"updatedAt": "2024-01-15T10:30:00.000Z",
"versionId": "1",
"staticData": null,
"connections": {
"file-handler-001": {
"main": [
[
{
"node": "file-type-switch-001",
"type": "main",
"index": 0
}
]
]
},
"file-type-switch-001": {
"main": [
[
{
"node": "pdf-extractor-001",
"type": "main",
"index": 0
}
],
[
{
"node": "excel-parser-001",
"type": "main",
"index": 0
}
]
]
},
"excel-parser-001": {
"main": [
[
{
"node": "ai-extractor-001",
"type": "main",
"index": 0
}
]
]
},
"pdf-extractor-001": {
"main": [
[
{
"node": "ai-extractor-001",
"type": "main",
"index": 0
}
]
]
},
"webhook-001": {
"main": [
[
{
"node": "file-handler-001",
"type": "main",
"index": 0
}
]
]
},
"ai-extractor-001": {
"main": [
[
{
"node": "data-processor-001",
"type": "main",
"index": 0
}
]
]
},
"data-processor-001": {
"main": [
[
{
"node": "save-to-db-001",
"type": "main",
"index": 0
},
{
"node": "response-001",
"type": "main",
"index": 0
}
]
]
}
},
"triggerCount": 0
}자주 묻는 질문
이 워크플로우를 어떻게 사용하나요?
위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.
이 워크플로우는 어떤 시나리오에 적합한가요?
중급 - 문서 추출, AI 요약
유료인가요?
이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.
관련 워크플로우 추천
AI 기반 GPT-4-Turbo 과제 채점 및 다중 형식 출력
GPT-4-Turbo를 사용한 과제 채점 및 다중 형식 보고서 생성 자동화
Set
Code
Webhook
+
Set
Code
Webhook
15 노드Cheng Siong Chin
문서 추출
내 워크플로우 2
ScrapeGraphAI, GPT-4 및 Google Sheets를 사용한 딥 리서치 자동화
Code
Merge
Webhook
+
Code
Merge
Webhook
16 노드vinci-king-01
시장 조사
자동 채점 기준 생성 기능을 갖춘 AI 기반 동료 검토 과제 시스템
GPT-4-nano, Slack 및 이메일 알림을 사용한 동료 검토 할당 자동화
Set
Code
Slack
+
Set
Code
Slack
22 노드Cheng Siong Chin
문서 추출
영업 파이프라인 자동화 대시보드
HubSpot CRM, ScrapeGraphAI 및 Google Sheets 대시보드를 사용한 영업 파이프라인 자동화
If
Code
Slack
+
If
Code
Slack
22 노드vinci-king-01
고객관계관리
블록체인 모니터
基于ScrapeGraphAI风险检测의区块链모니터링器,即时警报및Slack알림
If
Code
Slack
+
If
Code
Slack
14 노드vinci-king-01
암호화폐 거래
내 작업流程 2
ScrapeGraphAI, Google 스프레드시트, Slack 알림을 사용하여 작업 분석 대시보드를 지원하는 시스템을 구축합니다.
If
Code
Slack
+
If
Code
Slack
15 노드vinci-king-01
티켓 관리