Files
n8n-workspace/Main_paperless_ollama.json

2531 lines
89 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"updatedAt": "2026-10-01T12:13:46.765Z",
"createdAt": "2026-02-07T16:44:40.312Z",
"id": "WlfAT6ts3Dus6zD0jVITq",
"name": "Main_paperless_ollama",
"active": true,
"isArchived": false,
"nodes": [
{
"parameters": {
"url": "=http://192.168.178.101:8000/api/documents/",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "tags__name__icontains",
"value": "inbox"
},
{
"name": "tags__id__in",
"value": "2"
},
{
"name": "tags__id__none",
"value": "17"
}
]
},
"options": {
"response": {
"response": {}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
-1376,
-144
],
"id": "7881a84b-06d1-4e49-9da5-0b22b60c9e83",
"name": "HTTP Request",
"credentials": {
"httpHeaderAuth": {
"id": "Yn1cJCfoNitCVwdO",
"name": "paperless_api_token"
}
}
},
{
"parameters": {
"fieldToSplitOut": "results",
"options": {}
},
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"position": [
-1152,
-144
],
"id": "fc7117fa-7e7f-4041-b030-29363c97a060",
"name": "Split Out"
},
{
"parameters": {
"options": {
"reset": false
}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
-928,
-144
],
"id": "df8cd2dc-32ac-4302-bc6b-762f41843e53",
"name": "Loop Over Items",
"executeOnce": true
},
{
"parameters": {
"mode": "raw",
"jsonOutput": "={\n \"document\": [{{$('Loop Over Items').item.json.toJsonString()}}]\n}\n",
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-32,
-240
],
"id": "69327da0-419d-4023-90f4-07409496665d",
"name": "documentObject"
},
{
"parameters": {
"operation": "get",
"dataTableId": {
"__rl": true,
"value": "sjO4pAZNP1j1hHH2",
"mode": "list",
"cachedResultName": "paperless_correspondent",
"cachedResultUrl": "/projects/cSAaWNJydnksD5EB/datatables/sjO4pAZNP1j1hHH2"
},
"returnAll": true
},
"type": "n8n-nodes-base.dataTable",
"typeVersion": 1,
"position": [
416,
48
],
"id": "59a98aaf-11a2-4bb1-ae03-57b604a1d3a2",
"name": "getCorrespondent",
"executeOnce": true
},
{
"parameters": {
"method": "PATCH",
"url": "=http://192.168.178.101:8000/api/documents/{{ $('documentObject').item.json.document[0].id }}/",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "title",
"value": "={{ $('Ollama Output').item.json.Title }}"
},
{
"name": "tags",
"value": "={{ $('documentObject').item.json.document[0].tags.concat($('new Tags').item.json.finalTagIds).concat([17]).filter(item => item != null)\n.unique()}}"
},
{
"name": "correspondent",
"value": "={{$('new correspodent').item.json[\"corrospodent-id\"] || $('documentObject').item.json.document[0].correspondent}}"
},
{
"name": "documenttype",
"value": "={{ $('new documenttype').item.json.id }}"
}
]
},
"options": {
"response": {
"response": {}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
2656,
48
],
"id": "90966b16-62ae-4e04-9b16-1beca6300a91",
"name": "Patch Document",
"credentials": {
"httpHeaderAuth": {
"id": "Yn1cJCfoNitCVwdO",
"name": "paperless_api_token"
}
},
"notes": "Tag ID 16 = n8nAI\n"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "f3c75165-57de-407d-a23c-23d794cb78c2",
"leftValue": "={{ $json.document[0].content }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
192,
-240
],
"id": "a2de95e9-78ae-4aa9-a96f-ea5d14407eb1",
"name": "If"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "31ec728f-cb08-4bc6-af76-f96973cb39dc",
"name": "component_url",
"value": "http://192.168.178.101:8000/api/correspondents/",
"type": "string"
},
{
"id": "e339d699-2f4b-4cd2-9e77-0c46cff58c29",
"name": "component_name",
"value": "correspondents",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-704,
144
],
"id": "efb9cf1e-0436-4e15-8da5-b6f033c5cefd",
"name": "correspondents"
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "Fw7gwUx6RgHKBZO5cmsjj",
"mode": "list",
"cachedResultUrl": "/workflow/Fw7gwUx6RgHKBZO5cmsjj",
"cachedResultName": "paperless_get_component"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"component_name": "={{ $json.component_name }}",
"component_url": "={{ $json.component_url }}"
},
"matchingColumns": [
"component"
],
"schema": [
{
"id": "component_name",
"displayName": "component_name",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": false
},
{
"id": "component_url",
"displayName": "component_url",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"options": {}
},
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.3,
"position": [
-480,
144
],
"id": "bfffe890-ba83-4440-a4f5-d26c09d9aeeb",
"name": "Call 'paperless_get_component'"
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "Fw7gwUx6RgHKBZO5cmsjj",
"mode": "list",
"cachedResultUrl": "/workflow/Fw7gwUx6RgHKBZO5cmsjj",
"cachedResultName": "paperless_get_component"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"component_name": "={{ $json.component_name }}",
"component_url": "={{ $json.component_url }}"
},
"matchingColumns": [
"component"
],
"schema": [
{
"id": "component_name",
"displayName": "component_name",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": false
},
{
"id": "component_url",
"displayName": "component_url",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"options": {}
},
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.3,
"position": [
-480,
-192
],
"id": "b2a18c0e-9f1c-4fe6-9710-3392b7d63c1d",
"name": "Call 'paperless_get_component'1"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "31ec728f-cb08-4bc6-af76-f96973cb39dc",
"name": "component_url",
"value": "http://192.168.178.101:8000/api/tags/",
"type": "string"
},
{
"id": "e339d699-2f4b-4cd2-9e77-0c46cff58c29",
"name": "component_name",
"value": "tags",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-704,
-192
],
"id": "822f8c94-e903-4786-94bf-78ced0846b66",
"name": "tags"
},
{
"parameters": {
"operation": "get",
"dataTableId": {
"__rl": true,
"value": "jBGyNOUjWYnAqA8C",
"mode": "list",
"cachedResultName": "paperless_tag",
"cachedResultUrl": "/projects/cSAaWNJydnksD5EB/datatables/jBGyNOUjWYnAqA8C"
},
"returnAll": true
},
"type": "n8n-nodes-base.dataTable",
"typeVersion": 1,
"position": [
416,
-224
],
"id": "9a121c2a-b88a-4304-98a5-f64ff3d00665",
"name": "getTags",
"executeOnce": true
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
640,
-64
],
"id": "5295f635-b8c3-4888-aaa9-e11cbb6762e6",
"name": "Merge1",
"executeOnce": true
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "Fw7gwUx6RgHKBZO5cmsjj",
"mode": "list",
"cachedResultUrl": "/workflow/Fw7gwUx6RgHKBZO5cmsjj",
"cachedResultName": "paperless_get_component"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"component_url": "={{ $json.component_url }}",
"component_name": "={{ $json.component_name }}"
},
"matchingColumns": [],
"schema": [
{
"id": "component_name",
"displayName": "component_name",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
},
{
"id": "component_url",
"displayName": "component_url",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"options": {}
},
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.3,
"position": [
-480,
-384
],
"id": "660c104b-5112-4ad4-a08e-2dac025a271f",
"name": "Call 'paperless_get_component'2"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "31ec728f-cb08-4bc6-af76-f96973cb39dc",
"name": "component_url",
"value": "http://192.168.178.101:8000/api/document_types/",
"type": "string"
},
{
"id": "e339d699-2f4b-4cd2-9e77-0c46cff58c29",
"name": "component_name",
"value": "document_types",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-704,
-384
],
"id": "3f560da1-a7b6-4f0b-903d-ec53d3a57d22",
"name": "documentType"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
864,
-208
],
"id": "5e7993c9-d226-4fd8-982d-3b3787481660",
"name": "Merge2",
"executeOnce": true
},
{
"parameters": {
"operation": "get",
"dataTableId": {
"__rl": true,
"value": "UYRGUJmbU2Q3Ztv6",
"mode": "list",
"cachedResultName": "paperless_document_types",
"cachedResultUrl": "/projects/cSAaWNJydnksD5EB/datatables/UYRGUJmbU2Q3Ztv6"
},
"returnAll": true
},
"type": "n8n-nodes-base.dataTable",
"typeVersion": 1,
"position": [
640,
-384
],
"id": "59c8dbcd-6d89-4a95-81f4-270e4ea268af",
"name": "getDocuments",
"executeOnce": true
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-1600,
-240
],
"id": "e0d62cca-eae9-4d1a-9058-5c3e4020a28a",
"name": "When clicking ‘Execute workflow’"
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "ministral-3:3b",
"mode": "list",
"cachedResultName": "ministral-3:3b"
},
"messages": {
"values": [
{
"content": "=[Korrespodent Start]\n{{ JSON.stringify($('getCorrespondent').all().map(i => ({ id: i.json.paperless_id, name: i.json.name }))) }}\n[Korrespodent End]\n\n[Tags Start]\n{{ JSON.stringify($('getTags').all().map(i => ({ id: i.json.paperless_id, name: i.json.name }))) }}\n[Tags End]\n\n[Documents Start]\n{{ JSON.stringify($('getDocuments').all().map(i => ({ id: i.json.paperless_id, name: i.json.name }))) }}\n[Documents End]\n\n[Dokument Inhalt Start]\n{{ $('documentObject').item.json.document[0].content.substring(1,1000) }}\n[Dokument Inhalt Ende]"
}
]
},
"options": {
"system": "Kannst du bitte für dieses Dokument einen Title, Korrespondent, Dokumenttyp und Tags extrahieren. Die ich für mein Paperless verwenden kann?\nVersuche erst einen passenden Korrespondent und Tag aus meiner Liste was ich anhänge zu finden. Achte auf die Sin Wenn du es nicht findest weise einen passenden Vorschlag zu.\n\nStelle sicher das ausschließlich mit purem JSON. Nutze keine Markdown-Formatierung wie ` ` `json. Beginne direkt mit der öffnenden geschweiften Klammer {.\n\nBeispielantwort 1 wenn eine Korrespondent ID, Document_type und Tags vorhanden sind\n\n{\n\"Title\": \"SLK Klinik Beinoperation\",\n\"Korrespondent-ID\": 1,\n\"Korrespondent\": \"SLK Klinik\",\n\"Tags-ID\":[6,8],\n\"Tags:[\"Arztbriefe\", \"Medikamente\"],\n\"Document_type_id\": 8,\n\"Document_typ\": \"Information\"\n}\n\nBeispielantwort 2 wenn eine Korrespondent ID, Document_type und Tags nicht vorhanden sind\n{\n\"Title\": \"SLK Klinik Beinoperation\",\n\"Korrespondent-ID\": null,\n\"Korrespondent\": \"SLK Klinik\",\n\"Tags-ID\":[null],\n\"Tags:[\"Operation\", \"Varatharajan\"],\n\"Document_type_id\": null,\n\"Dokumenttyp\": \"Arztbrief\"\n}",
"format": "json"
}
},
"type": "@n8n/n8n-nodes-langchain.ollama",
"typeVersion": 1,
"position": [
-1600,
368
],
"id": "358a7df0-fa29-4053-a0b5-232e1bc3fbd2",
"name": "Message a model1",
"executeOnce": true,
"credentials": {
"ollamaApi": {
"id": "fgaZliEtIoej3jtn",
"name": "Ollama account"
}
},
"disabled": true
},
{
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 3
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.3,
"position": [
-1600,
-48
],
"id": "5dddd20a-49d6-4836-9818-b5538b983d42",
"name": "Schedule Trigger"
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "NljcXxbg9UqJVBEW",
"mode": "list",
"cachedResultUrl": "/workflow/NljcXxbg9UqJVBEW",
"cachedResultName": "paperless_ollama"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"correspondents": "={{ $('getCorrespondent').all().map(i => ({ id: i.json.paperless_id, name: i.json.name })) }}",
"tags": "={{ $('getTags').all().map(i => ({ id: i.json.paperless_id, name: i.json.name })) }}",
"documents": "={{ $('getDocuments').all().map(i => ({ id: i.json.paperless_id, name: i.json.name })) }}",
"content": "={{ $('documentObject').item.json.document[0].content.substring(1,5000) }}"
},
"matchingColumns": [],
"schema": [
{
"id": "correspondents",
"displayName": "correspondents",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "tags",
"displayName": "tags",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "documents",
"displayName": "documents",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "content",
"displayName": "content",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"options": {}
},
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.3,
"position": [
1088,
-208
],
"id": "a6527b23-9ac9-4d82-9b7d-30b24be8011e",
"name": "Call 'paperless_get_component'3",
"executeOnce": true,
"disabled": true
},
{
"parameters": {
"fieldToSplitOut": "Tags",
"options": {}
},
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"position": [
1536,
-448
],
"id": "52730f33-30ad-460c-9ffe-cc7e1d3b86aa",
"name": "Tags"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "17137399-1900-4888-b9d5-58f79af486bd",
"leftValue": "={{ $json[\"Korrespondent-ID\"] }}",
"rightValue": "",
"operator": {
"type": "number",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
1760,
-64
],
"id": "c3320851-ffc8-47d5-907d-f41fd1bf4dc4",
"name": "Korrespodent IS null"
},
{
"parameters": {
"method": "POST",
"url": "=http://192.168.178.101:8000/api/correspondents/",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "name",
"value": "={{ $json.Korrespondent }}"
}
]
},
"options": {
"response": {
"response": {
"fullResponse": true
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
1984,
-64
],
"id": "906e897f-cde3-4af4-915c-ecb07e616814",
"name": "Patch Document1",
"credentials": {
"httpHeaderAuth": {
"id": "Yn1cJCfoNitCVwdO",
"name": "paperless_api_token"
}
},
"notes": "Tag ID 16 = n8nAI\n"
},
{
"parameters": {
"method": "POST",
"url": "=http://192.168.178.101:8000/api/document_types/",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "name",
"value": "={{ $json.Dokumententyp }}"
}
]
},
"options": {
"response": {
"response": {
"fullResponse": true
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
1984,
128
],
"id": "c1ed188e-87a3-4c73-9c41-57cc8a32a03f",
"name": "Patch Document2",
"credentials": {
"httpHeaderAuth": {
"id": "Yn1cJCfoNitCVwdO",
"name": "paperless_api_token"
}
},
"notes": "Tag ID 16 = n8nAI\n"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "17137399-1900-4888-b9d5-58f79af486bd",
"leftValue": "={{ $json[\"Dokumententyp-ID\"] }}",
"rightValue": "",
"operator": {
"type": "number",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
1760,
128
],
"id": "5d7afd19-56f0-44ba-ac03-9f5382b48edc",
"name": "Documenttype IS null"
},
{
"parameters": {
"method": "POST",
"url": "=http://192.168.178.101:8000/api/tags/",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "name",
"value": "={{ $json.Name }}"
}
]
},
"options": {
"response": {
"response": {
"fullResponse": true
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
1984,
-448
],
"id": "d7e21c93-d64b-4012-8230-2aee287b061a",
"name": "Patch Document3",
"credentials": {
"httpHeaderAuth": {
"id": "Yn1cJCfoNitCVwdO",
"name": "paperless_api_token"
}
},
"onError": "continueRegularOutput",
"notes": "Tag ID 16 = n8nAI\n"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "17137399-1900-4888-b9d5-58f79af486bd",
"leftValue": "={{ $json[\"Tag-ID\"] }}",
"rightValue": "",
"operator": {
"type": "number",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
1760,
-448
],
"id": "8bdf3b4d-ffa4-46da-8786-1c7673f4c1d3",
"name": "Documenttype IS null1"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "5342bf9f-655f-4640-afef-e9498b468e90",
"name": "corrospodent-id",
"value": "={{ $json.body.id }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2208,
-64
],
"id": "3803e19d-7260-4c2b-a58f-3246202d545c",
"name": "new correspodent"
},
{
"parameters": {
"jsCode": "const ids = $input.all().map(item => item.json.id ?? item.json['Tag-ID']).filter(Boolean);\n\nreturn [{ json: { finalTagIds: ids } }];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
2208,
-448
],
"id": "315f8bdb-bc57-44de-8310-2e24c292c51a",
"name": "new Tags"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "5342bf9f-655f-4640-afef-e9498b468e90",
"name": "documenttype-id",
"value": "={{ $json.body.id }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2208,
128
],
"id": "e8068823-8bf6-445f-bc2d-9c714d61cf59",
"name": "new documenttype"
},
{
"parameters": {
"mode": "chooseBranch",
"numberInputs": 4,
"output": "empty"
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
2432,
-256
],
"id": "1651d843-bafa-4a40-a3b1-7e60d276ccc8",
"name": "Merge3"
},
{
"parameters": {
"mode": "chooseBranch",
"numberInputs": 4,
"output": "empty"
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
-256,
-272
],
"id": "6091426e-3105-41e0-9b7b-f4e68f0df71b",
"name": "Wait for all"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "1495e316-9027-4bbf-be02-6d3a2d1751cb",
"name": "Title",
"value": "={{ $json.Title }}",
"type": "string"
},
{
"id": "47d55c30-2b88-48c9-b0da-5001f9b137fc",
"name": "Korrespondent-ID",
"value": "={{ $json[\"Korrespondent-ID\"] }}",
"type": "number"
},
{
"id": "8f39fceb-a984-4715-8caf-3f104641b33d",
"name": "Korrespondent",
"value": "={{ $json.Korrespondent }}",
"type": "string"
},
{
"id": "85f9bda2-acec-415a-b582-d099f86838cc",
"name": "Dokumententyp-ID",
"value": "={{ $json[\"Dokumententyp-ID\"] }}",
"type": "number"
},
{
"id": "b7b22600-f174-47cd-bc0a-fe967bf9425b",
"name": "Dokumententyp",
"value": "={{ $json.Dokumententyp }}",
"type": "string"
},
{
"id": "d0f3f1b0-c116-452e-9eec-a2135b52f15b",
"name": "Tags",
"value": "={{ $json.Tags }}",
"type": "array"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1312,
-208
],
"id": "0eb42a83-8b48-4004-a199-a93bbf7f3b9d",
"name": "Ollama Output",
"executeOnce": false
}
],
"connections": {
"HTTP Request": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "correspondents",
"type": "main",
"index": 0
},
{
"node": "tags",
"type": "main",
"index": 0
},
{
"node": "documentType",
"type": "main",
"index": 0
}
]
]
},
"documentObject": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"getCorrespondent": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"Patch Document": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"If": {
"main": [
[
{
"node": "getCorrespondent",
"type": "main",
"index": 0
},
{
"node": "getTags",
"type": "main",
"index": 0
},
{
"node": "getDocuments",
"type": "main",
"index": 0
}
],
[]
]
},
"correspondents": {
"main": [
[
{
"node": "Call 'paperless_get_component'",
"type": "main",
"index": 0
}
]
]
},
"tags": {
"main": [
[
{
"node": "Call 'paperless_get_component'1",
"type": "main",
"index": 0
}
]
]
},
"getTags": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 1
}
]
]
},
"documentType": {
"main": [
[
{
"node": "Call 'paperless_get_component'2",
"type": "main",
"index": 0
}
]
]
},
"Merge2": {
"main": [
[
{
"node": "Call 'paperless_get_component'3",
"type": "main",
"index": 0
}
]
]
},
"getDocuments": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Message a model1": {
"main": [
[]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Call 'paperless_get_component'3": {
"main": [
[
{
"node": "Ollama Output",
"type": "main",
"index": 0
}
]
]
},
"Korrespodent IS null": {
"main": [
[
{
"node": "Patch Document1",
"type": "main",
"index": 0
}
]
]
},
"Documenttype IS null": {
"main": [
[
{
"node": "Patch Document2",
"type": "main",
"index": 0
}
]
]
},
"Documenttype IS null1": {
"main": [
[
{
"node": "Patch Document3",
"type": "main",
"index": 0
}
]
]
},
"Tags": {
"main": [
[
{
"node": "Documenttype IS null1",
"type": "main",
"index": 0
}
]
]
},
"Patch Document3": {
"main": [
[
{
"node": "new Tags",
"type": "main",
"index": 0
}
]
]
},
"Patch Document1": {
"main": [
[
{
"node": "new correspodent",
"type": "main",
"index": 0
}
]
]
},
"Patch Document2": {
"main": [
[
{
"node": "new documenttype",
"type": "main",
"index": 0
}
]
]
},
"new correspodent": {
"main": [
[
{
"node": "Merge3",
"type": "main",
"index": 1
}
]
]
},
"new Tags": {
"main": [
[
{
"node": "Merge3",
"type": "main",
"index": 0
}
]
]
},
"new documenttype": {
"main": [
[
{
"node": "Merge3",
"type": "main",
"index": 2
}
]
]
},
"Merge3": {
"main": [
[
{
"node": "Patch Document",
"type": "main",
"index": 0
}
]
]
},
"Call 'paperless_get_component'2": {
"main": [
[
{
"node": "Wait for all",
"type": "main",
"index": 0
}
]
]
},
"Call 'paperless_get_component'1": {
"main": [
[
{
"node": "Wait for all",
"type": "main",
"index": 1
}
]
]
},
"Call 'paperless_get_component'": {
"main": [
[
{
"node": "Wait for all",
"type": "main",
"index": 2
}
]
]
},
"Wait for all": {
"main": [
[
{
"node": "documentObject",
"type": "main",
"index": 0
}
]
]
},
"Ollama Output": {
"main": [
[
{
"node": "Korrespodent IS null",
"type": "main",
"index": 0
},
{
"node": "Tags",
"type": "main",
"index": 0
},
{
"node": "Documenttype IS null",
"type": "main",
"index": 0
},
{
"node": "Merge3",
"type": "main",
"index": 3
}
]
]
}
},
"settings": {
"executionOrder": "v1",
"availableInMCP": false,
"binaryMode": "separate"
},
"staticData": {
"node:Schedule Trigger": {
"recurrenceRules": []
}
},
"meta": {
"templateCredsSetupCompleted": true
},
"pinData": {
"new Tags": [
{
"json": {
"finalTagIds": []
},
"pairedItem": {
"item": 0
}
}
],
"Ollama Output": [
{
"json": {
"Title": "Bestellbestätigung für LiitoKala Lii-PD4/PD2 AC Ladegerät",
"Korrespondent-ID": null,
"Korrespondent": "AliExpress (dritter Händler)",
"Dokumententyp-ID": null,
"Dokumententyp": "Bestellbestätigung",
"Tags": [
{
"Tag-ID": null,
"Name": "Versand"
},
{
"Tag-ID": null,
"Name": "Reise"
},
{
"Tag-ID": 16,
"Name": "n8nAI"
}
]
},
"pairedItem": {
"item": 0
}
}
]
},
"versionId": "8192c2e1-3617-4d32-9459-f4214f407645",
"activeVersionId": "9e7da37b-3b10-4124-9d0c-b92810dd29b4",
"triggerCount": 1,
"shared": [
{
"updatedAt": "2026-02-07T16:44:40.317Z",
"createdAt": "2026-02-07T16:44:40.317Z",
"role": "workflow:owner",
"workflowId": "WlfAT6ts3Dus6zD0jVITq",
"projectId": "cSAaWNJydnksD5EB"
}
],
"activeVersion": {
"updatedAt": "2026-10-01T10:44:26.000Z",
"createdAt": "2026-10-01T10:44:06.206Z",
"versionId": "9e7da37b-3b10-4124-9d0c-b92810dd29b4",
"workflowId": "WlfAT6ts3Dus6zD0jVITq",
"nodes": [
{
"parameters": {
"url": "=http://192.168.178.101:8000/api/documents/",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "tags__name__icontains",
"value": "inbox"
},
{
"name": "tags__id__in",
"value": "2"
},
{
"name": "tags__id__none",
"value": "17"
}
]
},
"options": {
"response": {
"response": {}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
-1344,
624
],
"id": "7881a84b-06d1-4e49-9da5-0b22b60c9e83",
"name": "HTTP Request",
"credentials": {
"httpHeaderAuth": {
"id": "Yn1cJCfoNitCVwdO",
"name": "paperless_api_token"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "b5c0e99e-727e-4fe3-be0c-13fb5143cf8a",
"name": "=data",
"value": "={{ {...$input.first().json, \"document-id\" : $input.last().json.document[0].id} }}",
"type": "object"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1248,
480
],
"id": "0eb42a83-8b48-4004-a199-a93bbf7f3b9d",
"name": "Edit Fields",
"executeOnce": false
},
{
"parameters": {
"fieldToSplitOut": "results",
"options": {}
},
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"position": [
-1120,
624
],
"id": "fc7117fa-7e7f-4041-b030-29363c97a060",
"name": "Split Out"
},
{
"parameters": {
"options": {
"reset": false
}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
-896,
624
],
"id": "df8cd2dc-32ac-4302-bc6b-762f41843e53",
"name": "Loop Over Items",
"executeOnce": false
},
{
"parameters": {
"mode": "raw",
"jsonOutput": "={\n \"document\": [{{$json.toJsonString()}}]\n}\n",
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-672,
480
],
"id": "69327da0-419d-4023-90f4-07409496665d",
"name": "documentObject"
},
{
"parameters": {
"operation": "get",
"dataTableId": {
"__rl": true,
"value": "sjO4pAZNP1j1hHH2",
"mode": "list",
"cachedResultName": "paperless_correspondent",
"cachedResultUrl": "/projects/cSAaWNJydnksD5EB/datatables/sjO4pAZNP1j1hHH2"
},
"returnAll": true
},
"type": "n8n-nodes-base.dataTable",
"typeVersion": 1,
"position": [
-224,
368
],
"id": "59a98aaf-11a2-4bb1-ae03-57b604a1d3a2",
"name": "getCorrespondent",
"executeOnce": true
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "5ef46e88-d057-485e-9a75-8dcd244c737f",
"name": "data",
"value": "={{ $json.content.removeMarkdown().replaceAll('`','') }}",
"type": "object"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
912,
80
],
"id": "5a7867ad-9ea0-4379-ae6f-821bbee7913c",
"name": "dataPreparationToJSON"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
1024,
480
],
"id": "f02882b1-86c9-4c41-8263-15003f02e919",
"name": "Merge"
},
{
"parameters": {
"method": "PATCH",
"url": "=http://192.168.178.101:8000/api/documents/{{ $json.data['document-id'] }}/",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "title",
"value": "={{ $json.data.Title }}"
},
{
"name": "tags",
"value": "={{ \n $json.data.document[0].tags.concat(\n $json.data['Tags-ID']\n ).concat(\n [17]\n )\n.filter(item => item != null)\n.unique()\n}}"
},
{
"name": "correspondent",
"value": "={{$json.data[\"Korrespondent-ID\"] || $json.data.document[0].correspondent}}"
},
{
"name": "document_type",
"value": "={{ $json.data.data.Documenttypeid || $json.data.document[0].document_type }}"
}
]
},
"options": {
"response": {
"response": {}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
1472,
608
],
"id": "90966b16-62ae-4e04-9b16-1beca6300a91",
"name": "Patch Document",
"credentials": {
"httpHeaderAuth": {
"id": "Yn1cJCfoNitCVwdO",
"name": "paperless_api_token"
}
},
"notes": "Tag ID 16 = n8nAI\n"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "f3c75165-57de-407d-a23c-23d794cb78c2",
"leftValue": "={{ $json.document[0].content }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-448,
272
],
"id": "a2de95e9-78ae-4aa9-a96f-ea5d14407eb1",
"name": "If"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "31ec728f-cb08-4bc6-af76-f96973cb39dc",
"name": "component_url",
"value": "http://192.168.178.101:8000/api/correspondents/",
"type": "string"
},
{
"id": "e339d699-2f4b-4cd2-9e77-0c46cff58c29",
"name": "component_name",
"value": "correspondents",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-1344,
432
],
"id": "efb9cf1e-0436-4e15-8da5-b6f033c5cefd",
"name": "correspondents"
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "Fw7gwUx6RgHKBZO5cmsjj",
"mode": "list",
"cachedResultUrl": "/workflow/Fw7gwUx6RgHKBZO5cmsjj",
"cachedResultName": "paperless_get_component"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"component_name": "={{ $json.component_name }}",
"component_url": "={{ $json.component_url }}"
},
"matchingColumns": [
"component"
],
"schema": [
{
"id": "component_name",
"displayName": "component_name",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": false
},
{
"id": "component_url",
"displayName": "component_url",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"options": {}
},
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.3,
"position": [
-1120,
432
],
"id": "bfffe890-ba83-4440-a4f5-d26c09d9aeeb",
"name": "Call 'paperless_get_component'"
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "Fw7gwUx6RgHKBZO5cmsjj",
"mode": "list",
"cachedResultUrl": "/workflow/Fw7gwUx6RgHKBZO5cmsjj",
"cachedResultName": "paperless_get_component"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"component_name": "={{ $json.component_name }}",
"component_url": "={{ $json.component_url }}"
},
"matchingColumns": [
"component"
],
"schema": [
{
"id": "component_name",
"displayName": "component_name",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": false
},
{
"id": "component_url",
"displayName": "component_url",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string",
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"options": {}
},
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.3,
"position": [
-1120,
240
],
"id": "b2a18c0e-9f1c-4fe6-9710-3392b7d63c1d",
"name": "Call 'paperless_get_component'1"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "31ec728f-cb08-4bc6-af76-f96973cb39dc",
"name": "component_url",
"value": "http://192.168.178.101:8000/api/tags/",
"type": "string"
},
{
"id": "e339d699-2f4b-4cd2-9e77-0c46cff58c29",
"name": "component_name",
"value": "tags",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-1344,
240
],
"id": "822f8c94-e903-4786-94bf-78ced0846b66",
"name": "tags"
},
{
"parameters": {
"operation": "get",
"dataTableId": {
"__rl": true,
"value": "jBGyNOUjWYnAqA8C",
"mode": "list",
"cachedResultName": "paperless_tag",
"cachedResultUrl": "/projects/cSAaWNJydnksD5EB/datatables/jBGyNOUjWYnAqA8C"
},
"returnAll": true
},
"type": "n8n-nodes-base.dataTable",
"typeVersion": 1,
"position": [
-224,
176
],
"id": "9a121c2a-b88a-4304-98a5-f64ff3d00665",
"name": "getTags",
"executeOnce": true
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
0,
336
],
"id": "5295f635-b8c3-4888-aaa9-e11cbb6762e6",
"name": "Merge1",
"executeOnce": true
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "Fw7gwUx6RgHKBZO5cmsjj",
"mode": "list",
"cachedResultUrl": "/workflow/Fw7gwUx6RgHKBZO5cmsjj",
"cachedResultName": "paperless_get_component"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"component_url": "={{ $json.component_url }}",
"component_name": "={{ $json.component_name }}"
},
"matchingColumns": [],
"schema": [
{
"id": "component_name",
"displayName": "component_name",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
},
{
"id": "component_url",
"displayName": "component_url",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"type": "string"
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"options": {}
},
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.3,
"position": [
-1120,
48
],
"id": "660c104b-5112-4ad4-a08e-2dac025a271f",
"name": "Call 'paperless_get_component'2"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "31ec728f-cb08-4bc6-af76-f96973cb39dc",
"name": "component_url",
"value": "http://192.168.178.101:8000/api/document_types/",
"type": "string"
},
{
"id": "e339d699-2f4b-4cd2-9e77-0c46cff58c29",
"name": "component_name",
"value": "document_types",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-1344,
48
],
"id": "3f560da1-a7b6-4f0b-903d-ec53d3a57d22",
"name": "documentType"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
224,
336
],
"id": "5e7993c9-d226-4fd8-982d-3b3787481660",
"name": "Merge2",
"executeOnce": true
},
{
"parameters": {
"operation": "get",
"dataTableId": {
"__rl": true,
"value": "UYRGUJmbU2Q3Ztv6",
"mode": "list",
"cachedResultName": "paperless_document_types",
"cachedResultUrl": "/projects/cSAaWNJydnksD5EB/datatables/UYRGUJmbU2Q3Ztv6"
},
"returnAll": true
},
"type": "n8n-nodes-base.dataTable",
"typeVersion": 1,
"position": [
0,
0
],
"id": "59c8dbcd-6d89-4a95-81f4-270e4ea268af",
"name": "getDocuments",
"executeOnce": true
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-1600,
336
],
"id": "e0d62cca-eae9-4d1a-9058-5c3e4020a28a",
"name": "When clicking ‘Execute workflow’"
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "ministral-3:3b",
"mode": "list",
"cachedResultName": "ministral-3:3b"
},
"messages": {
"values": [
{
"content": "=[Korrespodent Start]\n{{ JSON.stringify($('getCorrespondent').all().map(i => ({ id: i.json.paperless_id, name: i.json.name }))) }}\n[Korrespodent End]\n\n[Tags Start]\n{{ JSON.stringify($('getTags').all().map(i => ({ id: i.json.paperless_id, name: i.json.name }))) }}\n[Tags End]\n\n[Documents Start]\n{{ JSON.stringify($('getDocuments').all().map(i => ({ id: i.json.paperless_id, name: i.json.name }))) }}\n[Documents End]\n\n[Dokument Inhalt Start]\n{{ $('documentObject').item.json.document[0].content.substring(1,1000) }}\n[Dokument Inhalt Ende]"
}
]
},
"options": {
"system": "Kannst du bitte für dieses Dokument einen Title, Korrespondent, Dokumenttyp und Tags extrahieren. Die ich für mein Paperless verwenden kann?\nVersuche erst einen passenden Korrespondent und Tag aus meiner Liste was ich anhänge zu finden. Achte auf die Sin Wenn du es nicht findest weise einen passenden Vorschlag zu.\n\nStelle sicher das ausschließlich mit purem JSON. Nutze keine Markdown-Formatierung wie ` ` `json. Beginne direkt mit der öffnenden geschweiften Klammer {.\n\nBeispielantwort 1 wenn eine Korrespondent ID, Document_type und Tags vorhanden sind\n\n{\n\"Title\": \"SLK Klinik Beinoperation\",\n\"Korrespondent-ID\": 1,\n\"Korrespondent\": \"SLK Klinik\",\n\"Tags-ID\":[6,8],\n\"Tags:[\"Arztbriefe\", \"Medikamente\"],\n\"Document_type_id\": 8,\n\"Document_typ\": \"Information\"\n}\n\nBeispielantwort 2 wenn eine Korrespondent ID, Document_type und Tags nicht vorhanden sind\n{\n\"Title\": \"SLK Klinik Beinoperation\",\n\"Korrespondent-ID\": null,\n\"Korrespondent\": \"SLK Klinik\",\n\"Tags-ID\":[null],\n\"Tags:[\"Operation\", \"Varatharajan\"],\n\"Document_type_id\": null,\n\"Dokumenttyp\": \"Arztbrief\"\n}",
"format": "json"
}
},
"type": "@n8n/n8n-nodes-langchain.ollama",
"typeVersion": 1,
"position": [
432,
320
],
"id": "358a7df0-fa29-4053-a0b5-232e1bc3fbd2",
"name": "Message a model1",
"executeOnce": true,
"credentials": {
"ollamaApi": {
"id": "fgaZliEtIoej3jtn",
"name": "Ollama account"
}
},
"disabled": true
},
{
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 3
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.3,
"position": [
-1600,
528
],
"id": "5dddd20a-49d6-4836-9818-b5538b983d42",
"name": "Schedule Trigger"
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "NljcXxbg9UqJVBEW",
"mode": "list",
"cachedResultUrl": "/workflow/NljcXxbg9UqJVBEW",
"cachedResultName": "paperless_ollama"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"correspondents": "={{ $('getCorrespondent').all().map(i => ({ id: i.json.paperless_id, name: i.json.name })) }}",
"tags": "={{ $('getTags').all().map(i => ({ id: i.json.paperless_id, name: i.json.name })) }}",
"documents": "={{ $('getDocuments').all().map(i => ({ id: i.json.paperless_id, name: i.json.name })) }}",
"content": "={{ $('documentObject').item.json.document[0].content.substring(1,5000) }}"
},
"matchingColumns": [],
"schema": [
{
"id": "correspondents",
"displayName": "correspondents",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "tags",
"displayName": "tags",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "documents",
"displayName": "documents",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "content",
"displayName": "content",
"required": false,
"defaultMatch": false,
"display": true,
"canBeUsedToMatch": true,
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"options": {}
},
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.3,
"position": [
432,
32
],
"id": "a6527b23-9ac9-4d82-9b7d-30b24be8011e",
"name": "Call 'paperless_get_component'3",
"executeOnce": true
}
],
"connections": {
"HTTP Request": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "documentObject",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Patch Document",
"type": "main",
"index": 0
}
]
]
},
"documentObject": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
},
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"getCorrespondent": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"dataPreparationToJSON": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Patch Document": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"If": {
"main": [
[
{
"node": "getCorrespondent",
"type": "main",
"index": 0
},
{
"node": "getTags",
"type": "main",
"index": 0
},
{
"node": "getDocuments",
"type": "main",
"index": 0
}
],
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"correspondents": {
"main": [
[
{
"node": "Call 'paperless_get_component'",
"type": "main",
"index": 0
}
]
]
},
"tags": {
"main": [
[
{
"node": "Call 'paperless_get_component'1",
"type": "main",
"index": 0
}
]
]
},
"getTags": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 1
}
]
]
},
"documentType": {
"main": [
[
{
"node": "Call 'paperless_get_component'2",
"type": "main",
"index": 0
}
]
]
},
"Merge2": {
"main": [
[
{
"node": "Message a model1",
"type": "main",
"index": 0
},
{
"node": "Call 'paperless_get_component'3",
"type": "main",
"index": 0
}
]
]
},
"getDocuments": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "documentType",
"type": "main",
"index": 0
},
{
"node": "tags",
"type": "main",
"index": 0
},
{
"node": "correspondents",
"type": "main",
"index": 0
},
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Message a model1": {
"main": [
[]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "documentType",
"type": "main",
"index": 0
},
{
"node": "tags",
"type": "main",
"index": 0
},
{
"node": "correspondents",
"type": "main",
"index": 0
},
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Call 'paperless_get_component'3": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
}
},
"authors": "Prasanna Ranjan",
"name": "Version 9e7da37b",
"description": "",
"autosaved": true
},
"tags": [
{
"updatedAt": "2026-02-07T16:44:35.454Z",
"createdAt": "2026-02-07T16:44:35.454Z",
"id": "0tHqAlm05JhR7voQ",
"name": "ollama_paperless"
}
]
}