From d409a07d46efe818ebd01b04e8dbada0289cc14a Mon Sep 17 00:00:00 2001 From: gitea Date: Mon, 1 Jan 2001 00:00:00 +0000 Subject: [PATCH] Update Main_paperless_ollama.json --- Main_paperless_ollama.json | 1063 +++++++++++++++++++++++++++++------- 1 file changed, 852 insertions(+), 211 deletions(-) diff --git a/Main_paperless_ollama.json b/Main_paperless_ollama.json index 2d5ca16..b0c6fb6 100644 --- a/Main_paperless_ollama.json +++ b/Main_paperless_ollama.json @@ -1,5 +1,5 @@ { - "updatedAt": "2026-08-18T21:37:54.307Z", + "updatedAt": "2026-10-01T12:13:46.765Z", "createdAt": "2026-02-07T16:44:40.312Z", "id": "WlfAT6ts3Dus6zD0jVITq", "name": "Main_paperless_ollama", @@ -37,8 +37,8 @@ "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ - -1344, - 624 + -1376, + -144 ], "id": "7881a84b-06d1-4e49-9da5-0b22b60c9e83", "name": "HTTP Request", @@ -49,30 +49,6 @@ } } }, - { - "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", @@ -81,8 +57,8 @@ "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ - -1120, - 624 + -1152, + -144 ], "id": "fc7117fa-7e7f-4041-b030-29363c97a060", "name": "Split Out" @@ -96,24 +72,24 @@ "type": "n8n-nodes-base.splitInBatches", "typeVersion": 3, "position": [ - -896, - 624 + -928, + -144 ], "id": "df8cd2dc-32ac-4302-bc6b-762f41843e53", "name": "Loop Over Items", - "executeOnce": false + "executeOnce": true }, { "parameters": { "mode": "raw", - "jsonOutput": "={\n \"document\": [{{$json.toJsonString()}}]\n}\n", + "jsonOutput": "={\n \"document\": [{{$('Loop Over Items').item.json.toJsonString()}}]\n}\n", "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ - -672, - 480 + -32, + -240 ], "id": "69327da0-419d-4023-90f4-07409496665d", "name": "documentObject" @@ -133,55 +109,17 @@ "type": "n8n-nodes-base.dataTable", "typeVersion": 1, "position": [ - -224, - 368 + 416, + 48 ], "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": [ - 800, - 336 - ], - "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'] }}/", + "url": "=http://192.168.178.101:8000/api/documents/{{ $('documentObject').item.json.document[0].id }}/", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, @@ -189,19 +127,19 @@ "parameters": [ { "name": "title", - "value": "={{ $json.data.data.Title }}" + "value": "={{ $('Ollama Output').item.json.Title }}" }, { "name": "tags", - "value": "={{ \n $json.data.document[0].tags.concat(\n $json.data.data['Tags-ID']\n ).concat(\n [17]\n )\n.filter(item => item != null)\n.unique()\n}}" + "value": "={{ $('documentObject').item.json.document[0].tags.concat($('new Tags').item.json.finalTagIds).concat([17]).filter(item => item != null)\n.unique()}}" }, { "name": "correspondent", - "value": "={{$json.data.data[\"Korrespondent-ID\"] || $json.data.document[0].correspondent}}" + "value": "={{$('new correspodent').item.json[\"corrospodent-id\"] || $('documentObject').item.json.document[0].correspondent}}" }, { - "name": "document_type", - "value": "={{ $json.data.data.Documenttypeid || $json.data.document[0].document_type }}" + "name": "documenttype", + "value": "={{ $('new documenttype').item.json.id }}" } ] }, @@ -214,8 +152,8 @@ "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ - 1472, - 608 + 2656, + 48 ], "id": "90966b16-62ae-4e04-9b16-1beca6300a91", "name": "Patch Document", @@ -255,8 +193,8 @@ "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ - -448, - 272 + 192, + -240 ], "id": "a2de95e9-78ae-4aa9-a96f-ea5d14407eb1", "name": "If" @@ -284,8 +222,8 @@ "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ - -1344, - 432 + -704, + 144 ], "id": "efb9cf1e-0436-4e15-8da5-b6f033c5cefd", "name": "correspondents" @@ -338,8 +276,8 @@ "type": "n8n-nodes-base.executeWorkflow", "typeVersion": 1.3, "position": [ - -1120, - 432 + -480, + 144 ], "id": "bfffe890-ba83-4440-a4f5-d26c09d9aeeb", "name": "Call 'paperless_get_component'" @@ -392,8 +330,8 @@ "type": "n8n-nodes-base.executeWorkflow", "typeVersion": 1.3, "position": [ - -1120, - 240 + -480, + -192 ], "id": "b2a18c0e-9f1c-4fe6-9710-3392b7d63c1d", "name": "Call 'paperless_get_component'1" @@ -421,8 +359,8 @@ "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ - -1344, - 240 + -704, + -192 ], "id": "822f8c94-e903-4786-94bf-78ced0846b66", "name": "tags" @@ -442,8 +380,8 @@ "type": "n8n-nodes-base.dataTable", "typeVersion": 1, "position": [ - -224, - 176 + 416, + -224 ], "id": "9a121c2a-b88a-4304-98a5-f64ff3d00665", "name": "getTags", @@ -458,8 +396,8 @@ "type": "n8n-nodes-base.merge", "typeVersion": 3.2, "position": [ - 0, - 336 + 640, + -64 ], "id": "5295f635-b8c3-4888-aaa9-e11cbb6762e6", "name": "Merge1", @@ -509,8 +447,8 @@ "type": "n8n-nodes-base.executeWorkflow", "typeVersion": 1.3, "position": [ - -1120, - 48 + -480, + -384 ], "id": "660c104b-5112-4ad4-a08e-2dac025a271f", "name": "Call 'paperless_get_component'2" @@ -538,8 +476,8 @@ "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ - -1344, - 48 + -704, + -384 ], "id": "3f560da1-a7b6-4f0b-903d-ec53d3a57d22", "name": "documentType" @@ -553,8 +491,8 @@ "type": "n8n-nodes-base.merge", "typeVersion": 3.2, "position": [ - 224, - 336 + 864, + -208 ], "id": "5e7993c9-d226-4fd8-982d-3b3787481660", "name": "Merge2", @@ -575,8 +513,8 @@ "type": "n8n-nodes-base.dataTable", "typeVersion": 1, "position": [ - 0, - 0 + 640, + -384 ], "id": "59c8dbcd-6d89-4a95-81f4-270e4ea268af", "name": "getDocuments", @@ -588,7 +526,7 @@ "typeVersion": 1, "position": [ -1600, - 336 + -240 ], "id": "e0d62cca-eae9-4d1a-9058-5c3e4020a28a", "name": "When clicking ‘Execute workflow’" @@ -616,8 +554,8 @@ "type": "@n8n/n8n-nodes-langchain.ollama", "typeVersion": 1, "position": [ - 432, - 320 + -1600, + 368 ], "id": "358a7df0-fa29-4053-a0b5-232e1bc3fbd2", "name": "Message a model1", @@ -627,7 +565,8 @@ "id": "fgaZliEtIoej3jtn", "name": "Ollama account" } - } + }, + "disabled": true }, { "parameters": { @@ -643,10 +582,459 @@ "typeVersion": 1.3, "position": [ -1600, - 528 + -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": { @@ -677,18 +1065,17 @@ [], [ { - "node": "documentObject", + "node": "correspondents", "type": "main", "index": 0 - } - ] - ] - }, - "Edit Fields": { - "main": [ - [ + }, { - "node": "Patch Document", + "node": "tags", + "type": "main", + "index": 0 + }, + { + "node": "documentType", "type": "main", "index": 0 } @@ -698,11 +1085,6 @@ "documentObject": { "main": [ [ - { - "node": "Merge", - "type": "main", - "index": 1 - }, { "node": "If", "type": "main", @@ -722,28 +1104,6 @@ ] ] }, - "dataPreparationToJSON": { - "main": [ - [ - { - "node": "Merge", - "type": "main", - "index": 0 - } - ] - ] - }, - "Merge": { - "main": [ - [ - { - "node": "Edit Fields", - "type": "main", - "index": 0 - } - ] - ] - }, "Patch Document": { "main": [ [ @@ -774,13 +1134,7 @@ "index": 0 } ], - [ - { - "node": "Loop Over Items", - "type": "main", - "index": 0 - } - ] + [] ] }, "correspondents": { @@ -842,7 +1196,7 @@ "main": [ [ { - "node": "Message a model1", + "node": "Call 'paperless_get_component'3", "type": "main", "index": 0 } @@ -863,21 +1217,6 @@ "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", @@ -888,33 +1227,12 @@ }, "Message a model1": { "main": [ - [ - { - "node": "dataPreparationToJSON", - "type": "main", - "index": 0 - } - ] + [] ] }, "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", @@ -922,6 +1240,208 @@ } ] ] + }, + "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": { @@ -937,9 +1457,48 @@ "meta": { "templateCredsSetupCompleted": true }, - "pinData": {}, - "versionId": "f8fdc15e-0f60-4a6a-a3e3-f9ae85851dd7", - "activeVersionId": "f8fdc15e-0f60-4a6a-a3e3-f9ae85851dd7", + "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": [ { @@ -951,9 +1510,9 @@ } ], "activeVersion": { - "updatedAt": "2026-08-18T21:37:58.000Z", - "createdAt": "2026-08-18T21:37:54.308Z", - "versionId": "f8fdc15e-0f60-4a6a-a3e3-f9ae85851dd7", + "updatedAt": "2026-10-01T10:44:26.000Z", + "createdAt": "2026-10-01T10:44:06.206Z", + "versionId": "9e7da37b-3b10-4124-9d0c-b92810dd29b4", "workflowId": "WlfAT6ts3Dus6zD0jVITq", "nodes": [ { @@ -1107,8 +1666,8 @@ "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ - 800, - 336 + 912, + 80 ], "id": "5a7867ad-9ea0-4379-ae6f-821bbee7913c", "name": "dataPreparationToJSON" @@ -1139,15 +1698,15 @@ "parameters": [ { "name": "title", - "value": "={{ $json.data.data.Title }}" + "value": "={{ $json.data.Title }}" }, { "name": "tags", - "value": "={{ \n $json.data.document[0].tags.concat(\n $json.data.data['Tags-ID']\n ).concat(\n [17]\n )\n.filter(item => item != null)\n.unique()\n}}" + "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.data[\"Korrespondent-ID\"] || $json.data.document[0].correspondent}}" + "value": "={{$json.data[\"Korrespondent-ID\"] || $json.data.document[0].correspondent}}" }, { "name": "document_type", @@ -1577,7 +2136,8 @@ "id": "fgaZliEtIoej3jtn", "name": "Ollama account" } - } + }, + "disabled": true }, { "parameters": { @@ -1597,6 +2157,77 @@ ], "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": { @@ -1795,6 +2426,11 @@ "node": "Message a model1", "type": "main", "index": 0 + }, + { + "node": "Call 'paperless_get_component'3", + "type": "main", + "index": 0 } ] ] @@ -1838,13 +2474,7 @@ }, "Message a model1": { "main": [ - [ - { - "node": "dataPreparationToJSON", - "type": "main", - "index": 0 - } - ] + [] ] }, "Schedule Trigger": { @@ -1872,10 +2502,21 @@ } ] ] + }, + "Call 'paperless_get_component'3": { + "main": [ + [ + { + "node": "Merge", + "type": "main", + "index": 0 + } + ] + ] } }, "authors": "Prasanna Ranjan", - "name": "Version f8fdc15e", + "name": "Version 9e7da37b", "description": "", "autosaved": true },