PDF 벡터와 Webhooks를 사용하여 문서 질문과 답변 API를 구축
중급
이것은Internal Wiki, AI RAG, Multimodal AI분야의자동화 워크플로우로, 11개의 노드를 포함합니다.주로 If, Code, Webhook, PdfVector, RespondToWebhook 등의 노드를 사용하며. 사용법 PDF 벡터와 Webhooks를 사용하여 문서 질문 API 구축
사전 요구사항
- •HTTP Webhook 엔드포인트(n8n이 자동으로 생성)
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
"meta": {
"instanceId": "placeholder"
},
"nodes": [
{
"id": "overview-note",
"name": "API 개요",
"type": "n8n-nodes-base.stickyNote",
"position": [
50,
50
],
"parameters": {
"color": 5,
"width": 350,
"height": 160,
"content": "## 🤖 Document Q&A API\n\nRESTful service for document intelligence:\n• **Webhook** endpoint accepts documents\n• **AI processes** questions in context\n• **Returns** JSON with answers & citations\n• **Sub-second** response times"
},
"typeVersion": 1
},
{
"id": "request-note",
"name": "요청 형식",
"type": "n8n-nodes-base.stickyNote",
"position": [
450,
450
],
"parameters": {
"width": 280,
"height": 180,
"content": "## 📥 API Request\n\n**POST** to `/document-qa`\n\nBody:\n```json\n{\n \"question\": \"Your question\",\n \"maxTokens\": 500,\n \"file\": <binary>\n}\n```"
},
"typeVersion": 1
},
{
"id": "process-note",
"name": "질의응답 처리",
"type": "n8n-nodes-base.stickyNote",
"position": [
850,
450
],
"parameters": {
"width": 260,
"height": 160,
"content": "## 🔍 AI Processing\n\nPDF Vector:\n• Parses document\n• Finds relevant sections\n• Generates answer\n• Includes citations\n\n💡 GPT-4 powered"
},
"typeVersion": 1
},
{
"id": "response-note",
"name": "응답 형식",
"type": "n8n-nodes-base.stickyNote",
"position": [
1150,
450
],
"parameters": {
"color": 6,
"width": 260,
"height": 180,
"content": "## 📤 API Response\n\n```json\n{\n \"success\": true,\n \"answer\": \"...\",\n \"sources\": [...],\n \"confidence\": 0.95\n}\n```\n\n✅ Production ready!"
},
"typeVersion": 1
},
{
"id": "webhook-trigger",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"notes": "API endpoint for document Q&A",
"position": [
250,
300
],
"webhookId": "doc-qa-webhook",
"parameters": {
"path": "doc-qa",
"httpMethod": "POST"
},
"typeVersion": 1
},
{
"id": "validate-request",
"name": "요청 검증",
"type": "n8n-nodes-base.code",
"notes": "Validate and prepare request",
"position": [
450,
300
],
"parameters": {
"jsCode": "// Validate incoming request\nconst body = $input.first().json.body;\nconst errors = [];\n\nif (!body.documentUrl && !body.documentId) {\n errors.push('Either documentUrl or documentId is required');\n}\nif (!body.question) {\n errors.push('Question is required');\n}\n\n// Generate session ID if not provided\nconst sessionId = body.sessionId || `session-${Date.now()}`;\n\nreturn [{\n json: {\n ...body,\n sessionId,\n valid: errors.length === 0,\n errors,\n timestamp: new Date().toISOString()\n }\n}];"
},
"typeVersion": 2
},
{
"id": "check-valid",
"name": "유효한 요청?",
"type": "n8n-nodes-base.if",
"position": [
650,
300
],
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $json.valid }}",
"value2": true
}
]
}
},
"typeVersion": 1
},
{
"id": "pdfvector-ask",
"name": "PDF 벡터 - 질문하기",
"type": "n8n-nodes-pdfvector.pdfVector",
"notes": "Get answer from document",
"position": [
850,
250
],
"parameters": {
"url": "={{ $json.documentUrl }}",
"prompt": "Answer the following question about this document or image: {{ $json.question }}",
"resource": "document",
"inputType": "url",
"operation": "ask"
},
"typeVersion": 1
},
{
"id": "format-success",
"name": "성공 응답 형식화",
"type": "n8n-nodes-base.code",
"notes": "Prepare successful response",
"position": [
1050,
250
],
"parameters": {
"jsCode": "// Prepare successful response\nconst answer = $json.answer;\nconst request = $node['Validate Request'].json;\n\n// Calculate confidence score based on answer length and keywords\nlet confidence = 0.8; // Base confidence\nif (answer.length > 100) confidence += 0.1;\nif (answer.toLowerCase().includes('specifically') || answer.toLowerCase().includes('according to')) confidence += 0.1;\nconfidence = Math.min(confidence, 1.0);\n\nreturn [{\n json: {\n success: true,\n data: {\n answer,\n confidence,\n sessionId: request.sessionId,\n documentUrl: request.documentUrl,\n question: request.question\n },\n metadata: {\n processedAt: new Date().toISOString(),\n responseTime: Date.now() - new Date(request.timestamp).getTime(),\n creditsUsed: 1\n }\n }\n}];"
},
"typeVersion": 2
},
{
"id": "format-error",
"name": "오류 응답 형식화",
"type": "n8n-nodes-base.code",
"notes": "Prepare error response",
"position": [
850,
350
],
"parameters": {
"jsCode": "// Prepare error response\nconst errors = $json.errors || ['An error occurred processing your request'];\n\nreturn [{\n json: {\n success: false,\n errors,\n message: 'Invalid request',\n timestamp: new Date().toISOString()\n }\n}];"
},
"typeVersion": 2
},
{
"id": "webhook-response",
"name": "응답 전송",
"type": "n8n-nodes-base.respondToWebhook",
"notes": "Send API response",
"position": [
1250,
300
],
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify($json) }}",
"responseHeaders": {
"entries": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 1
}
],
"connections": {
"webhook-trigger": {
"main": [
[
{
"node": "validate-request",
"type": "main",
"index": 0
}
]
]
},
"check-valid": {
"main": [
[
{
"node": "pdfvector-ask",
"type": "main",
"index": 0
}
],
[
{
"node": "format-error",
"type": "main",
"index": 0
}
]
]
},
"validate-request": {
"main": [
[
{
"node": "check-valid",
"type": "main",
"index": 0
}
]
]
},
"format-error": {
"main": [
[
{
"node": "webhook-response",
"type": "main",
"index": 0
}
]
]
},
"format-success": {
"main": [
[
{
"node": "webhook-response",
"type": "main",
"index": 0
}
]
]
},
"pdfvector-ask": {
"main": [
[
{
"node": "format-success",
"type": "main",
"index": 0
}
]
]
}
}
}자주 묻는 질문
이 워크플로우를 어떻게 사용하나요?
위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.
이 워크플로우는 어떤 시나리오에 적합한가요?
중급 - 내부 위키, AI RAG, 멀티모달 AI
유료인가요?
이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.
관련 워크플로우 추천
GPT-4 및 다중 데이터베이스 검색을 사용한 학술 문헌 검토 자동화
GPT-4 및 다중 데이터베이스 검색을 사용한 학술 문헌 리뷰 자동화
If
Set
Code
+
If
Set
Code
13 노드PDF Vector
문서 추출
PDF 벡터, Google Drive 및 데이터베이스를 사용하여发票 데이터를 추출하고 저장
PDF 벡터, Google Drive, 데이터베이스를 사용하여 청구서 데이터를 추출하고 저장합니다.
If
Code
Slack
+
If
Code
Slack
26 노드PDF Vector
청구서 처리
GPT-4와 PDF Vector를 사용하여 다양한 형식의 연구 논문 요약 생성
GPT-4와 PDF Vector를 사용하여 다양한 포맷 연구 논문 요약 생성
Code
Open Ai
Webhook
+
Code
Open Ai
Webhook
9 노드PDF Vector
AI 요약
PDF 벡터 및 다중 내보내기를 포함한 5개 데이터베이스에 걸친 학술 연구 검색
跨五个데이터库의学术研究검색,含PDF向量및多重내보내기
Set
Code
Pdf Vector
+
Set
Code
Pdf Vector
9 노드PDF Vector
AI RAG
PDF 벡터, GPT-4, Neo4j를 사용하여 학술 지식 그래프를 구축
사용PDF向量、GPT-4및Neo4j에서研究论文构建学术知识图谱
Code
Neo4j
Open Ai
+
Code
Neo4j
Open Ai
10 노드PDF Vector
AI RAG
批量 PDF를 Markdown으로 변환 (Google Drive와 LLM 분석)
Google Drive와 LLM 기반의 파싱을 사용하여 대량 PDF를 Markdown로 변환
If
Set
Code
+
If
Set
Code
8 노드PDF Vector
콘텐츠 제작
워크플로우 정보
난이도
중급
노드 수11
카테고리3
노드 유형6
저자
PDF Vector
@pdfvectorA fully featured PDF APIs for developers - Parse any PDF or Word document, extract structured data, and access millions of academic papers - all through simple APIs.
외부 링크
n8n.io에서 보기 →
이 워크플로우 공유