This workflow follows the Agent → Documentdefaultdataloader recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Bazz-Doc Master (AI Document OCR & Extraction)",
"nodes": [
{
"parameters": {},
"id": "node-webhook-upload",
"name": "Document Upload Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
200,
300
],
"notes": "Triggered when a file is uploaded via WhatsApp or Web."
},
{
"parameters": {
"url": "={{ $env.DASHBOARD_URL }}/api/client-config?webhookId={{ $json.body.webhookId }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.INTERNAL_API_KEY }}"
}
]
},
"options": {}
},
"id": "node-fetch-client-config",
"name": "Fetch Client Extraction Rules",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
400,
300
],
"notes": "Pulls the specific extraction rules and JSON schema the client wants for this document type."
},
{
"parameters": {
"jsCode": "const config = $input.first().json;\nif (config.error) {\n throw new Error(`Client config error: ${config.error}`);\n}\n\nreturn [{\n json: {\n systemPrompt: config.systemPrompt,\n businessName: config.businessName,\n knowledgeBase: config.knowledgeBase\n }\n}];"
},
"id": "node-prepare-doc-context",
"name": "Prepare Document Context",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [
600,
300
]
},
{
"parameters": {
"promptType": "define",
"text": "Extract all relevant information from the attached document based on your system instructions.",
"options": {
"systemMessage": "You are Bazz-Doc, the highly accurate document extraction AI for {{ $json.businessName }}.\n\nYour task:\n{{ $json.systemPrompt }}\n\nReference Material:\n{{ $json.knowledgeBase }}\n\nPlease output the extracted data in strict JSON format."
}
},
"id": "node-ai-doc-agent",
"name": "Document AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1,
"position": [
850,
300
]
},
{
"parameters": {
"model": "gpt-4o",
"options": {
"temperature": 0.0
}
},
"id": "node-ai-model",
"name": "OpenAI Vision Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1,
"position": [
850,
500
]
},
{
"parameters": {
"name": "readDocument",
"description": "Reads and parses the uploaded document (PDF/Image/Text)",
"binaryPropertyName": "data"
},
"id": "node-doc-plugin",
"name": "Read Document File",
"type": "@n8n/n8n-nodes-langchain.toolDocumentLoader",
"typeVersion": 1,
"position": [
1000,
500
]
},
{
"parameters": {
"jsCode": "return [{ json: { extractedData: JSON.parse($input.first().json.output) } }];"
},
"id": "node-parse-json",
"name": "Parse Extracted JSON",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [
1250,
300
]
},
{
"parameters": {
"name": "readDocument",
"binaryPropertyName": "data"
},
"id": "node-doc-loader",
"name": "Read Document File",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"typeVersion": 1,
"position": [
1000,
500
]
},
{
"parameters": {
"chunkSize": 1000,
"chunkOverlap": 100
},
"id": "node-text-splitter",
"name": "Recursive Character Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"typeVersion": 1,
"position": [
1000,
650
]
},
{
"parameters": {
"sessionId": "={{ $json.businessName }}"
},
"id": "node-doc-memory",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1,
"position": [
1100,
500
]
}
],
"connections": {
"Document Upload Trigger": {
"main": [
[
{
"node": "Fetch Client Extraction Rules",
"type": "main",
"index": 0
}
]
]
},
"Fetch Client Extraction Rules": {
"main": [
[
{
"node": "Prepare Document Context",
"type": "main",
"index": 0
}
]
]
},
"Prepare Document Context": {
"main": [
[
{
"node": "Document AI Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Read Document File",
"type": "main",
"index": 0
}
]
]
},
"Document AI Agent": {
"main": [
[
{
"node": "Parse Extracted JSON",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Vision Model": {
"ai_languageModel": [
[
{
"node": "Document AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Read Document File": {
"ai_tool": [
[
{
"node": "Document AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Read Document File",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "Document AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
}
},
"settings": {
"saveManualExecutions": true
},
"tags": [
"bazz-doc",
"ocr",
"documents",
"ai-agent"
]
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Bazz-Doc Master (AI Document OCR & Extraction). Uses httpRequest, agent, lmChatOpenAi, toolDocumentLoader. Webhook trigger; 10 nodes.
Source: https://github.com/Ocholar/bazztech-agentic-team-auto/blob/13259a574ca07d4ae1d0727e9d00b139aed2960d/n8n-workflows/Bazz_Doc_Master.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow implements a complete Voice AI Chatbot system for Wordress that integrates speech recognition, guardrails for safety, retrieval-augmented generation (RAG), Qdrant vector search, and audi
This comprehensive n8n workflow template creates an intelligent AI chatbot that automatically transforms your Google Drive documents into a searchable knowledge base. The chatbot uses OpenAI's GPT mod
Bread-Meat-Delivery. Uses lmChatOpenAi, agent, httpRequest, redis. Webhook trigger; 91 nodes.
• Create a Google Drive folder to watch. • Connect your Google Drive account in n8n and authorize access. • Point the Google Drive Trigger node to this folder (new/modified files trigger the flow).
This workflow automates patient communication for medical clinics using the WhatsApp Business API. It supports appointment booking, rescheduling, service inquiries, follow-ups, and document submission