{ "updatedAt": "2026-01-01T23:29:48.000Z", "createdAt": "2025-12-21T08:27:02.744Z", "id": "N4n2HmA6azz8n7Uw", "name": "ollama", "active": false, "isArchived": false, "nodes": [ { "parameters": {}, "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -176, -128 ], "id": "14b9aab7-ef42-4b8b-a9de-7ca6403fc9bd", "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{{ $input.first().json.allData.toJsonString()}}\n[Korrespodent End]\n\n[Dokument Inhalt Start]\n{{ $input.last().json.document[0].content.substring(0,1000) }}\n[Dokument Inhalt Ende]" } ] }, "options": { "system": "Kannst du bitte für dieses Dokument einen Title, Korrespondent und Dokumenttyp extrahieren. Die ich für mein Paperless verwenden kann?\nVersuche erst einen passenden Korrespondent aus meiner Liste was ich anhänge zu finden. Wenn du es nicht findest weise selber eins 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 vorhanden ist\n\n{\n\"Title\": \"SLK Klinik Beinoperation\",\n\"Korrespondent-ID\": 1,\n\"Korrespondent\": \"SLK Klinik\",\n\"Dokumenttyp\": \"Arztbrief\"\n}\n\nBeispielantwort 2 wenn eine Korrespondent ID nicht vorhanden ist\n{\n\"Title\": \"SLK Klinik Beinoperation\",\n\"Korrespondent-ID\": null,\n\"Korrespondent\": \"SLK Klinik\",\n\"Dokumenttyp\": \"Arztbrief\"\n}\n\n", "format": "json" } }, "type": "@n8n/n8n-nodes-langchain.ollama", "typeVersion": 1, "position": [ 1104, -352 ], "id": "8e7a99f1-ca7f-4b2d-8b30-22749e613aa2", "name": "Message a model", "executeOnce": false, "credentials": { "ollamaApi": { "id": "4Timi9hA5ACxVRmT", "name": "Ollama account" } } }, { "parameters": { "url": "=http://192.168.178.101:8000/api/documents/", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "tags__name__icontains", "value": "inbox" } ] }, "options": { "response": { "response": {} } } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 48, -32 ], "id": "141bc592-9bcf-4b75-8490-6ed9b312b2cf", "name": "HTTP Request", "credentials": { "httpHeaderAuth": { "id": "zyL5PgYOGlAptjwA", "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": [ 1744, -128 ], "id": "d1346069-1484-453f-b2a1-85dc69c8cb62", "name": "Edit Fields", "executeOnce": false }, { "parameters": { "fieldToSplitOut": "results", "options": {} }, "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 272, -32 ], "id": "74697e07-3ac6-4f65-b3d8-637472a5a0f4", "name": "Split Out" }, { "parameters": { "options": { "reset": false } }, "type": "n8n-nodes-base.splitInBatches", "typeVersion": 3, "position": [ 528, 48 ], "id": "2c3873ee-ce74-4c04-bb32-88b7c2f51c28", "name": "Loop Over Items", "executeOnce": false }, { "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": [ 1472, -368 ], "id": "3caf3164-5298-47ea-9696-eec8fd64bb39", "name": "Edit Fields2" }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 2 }, "conditions": [ { "id": "abfbb141-819d-4df5-abcb-3facf527e19e", "leftValue": "={{ $json.next }}", "rightValue": "={{ $('get_correspondents').last().json.next }}", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ 496, -224 ], "id": "c32913b1-88b1-447e-93ff-9cd6f331e88c", "name": "weitere Seiten vorhanden", "alwaysOutputData": false }, { "parameters": { "jsCode": "const allData = []\nvar json_lst = []\n\nlet counter = 0;\ndo {\n try {\n const response = $items(\"get_correspondents\", 0, counter)[0].json;\n \n const filtered = response.results.map(item => {\n return {\n id: item.id,\n slub: item.slug,\n name: item.name\n };\n });\n allData.push(...filtered);\n } catch (error) {\n return [{json: {allData}}]; \n }\n\n counter++;\n} while(true);\n\n\n" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 720, -224 ], "id": "e694365a-2f85-41a6-9f60-8442f86d9e55", "name": "Code in JavaScript" }, { "parameters": { "url": "={{ \n $('weitere Seiten vorhanden').isExecuted == false ? \"http://192.168.178.101:8000/api/correspondents/\" : $node['weitere Seiten vorhanden'].json.next\n}}", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "options": { "response": { "response": {} } } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 272, -224 ], "id": "1e3e3a80-66e9-4401-a485-786f7c70a2da", "name": "get_correspondents", "credentials": { "httpHeaderAuth": { "id": "zyL5PgYOGlAptjwA", "name": "paperless_api_token" } } }, { "parameters": { "mode": "combine", "combineBy": "combineAll", "options": {} }, "type": "n8n-nodes-base.merge", "typeVersion": 3.2, "position": [ 976, -96 ], "id": "73a54e13-82ed-4ce8-9678-4931272b86fd", "name": "Merge1", "notesInFlow": false }, { "parameters": { "mode": "raw", "jsonOutput": "={\n \"document\": [{{$json.toJsonString()}}]\n}\n", "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 816, 64 ], "id": "9b804e40-985c-4573-8828-6f38baa284d9", "name": "Edit Fields3" }, { "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.data.Title }}" } ] }, "options": { "response": { "response": {} } } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 1968, -128 ], "id": "74982eed-7fa2-4d69-9ae0-c2be5e28c5b0", "name": "HTTP Request2", "credentials": { "httpHeaderAuth": { "id": "zyL5PgYOGlAptjwA", "name": "paperless_api_token" } } }, { "parameters": { "mode": "combine", "combineBy": "combineAll", "options": {} }, "type": "n8n-nodes-base.merge", "typeVersion": 3.2, "position": [ 1520, -128 ], "id": "fe7927f5-dc86-4b7f-a355-eb019405b83b", "name": "Merge" } ], "connections": { "When clicking ‘Execute workflow’": { "main": [ [ { "node": "HTTP Request", "type": "main", "index": 0 }, { "node": "get_correspondents", "type": "main", "index": 0 } ] ] }, "HTTP Request": { "main": [ [ { "node": "Split Out", "type": "main", "index": 0 } ] ] }, "Message a model": { "main": [ [ { "node": "Edit Fields2", "type": "main", "index": 0 } ] ] }, "Split Out": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Loop Over Items": { "main": [ [], [ { "node": "Edit Fields3", "type": "main", "index": 0 } ] ] }, "Edit Fields": { "main": [ [ { "node": "HTTP Request2", "type": "main", "index": 0 } ] ] }, "Edit Fields2": { "main": [ [ { "node": "Merge", "type": "main", "index": 0 } ] ] }, "weitere Seiten vorhanden": { "main": [ [ { "node": "get_correspondents", "type": "main", "index": 0 } ], [ { "node": "Code in JavaScript", "type": "main", "index": 0 } ] ] }, "get_correspondents": { "main": [ [ { "node": "weitere Seiten vorhanden", "type": "main", "index": 0 } ] ] }, "Code in JavaScript": { "main": [ [ { "node": "Merge1", "type": "main", "index": 0 } ] ] }, "Merge1": { "main": [ [ { "node": "Message a model", "type": "main", "index": 0 }, { "node": "Merge", "type": "main", "index": 1 } ] ] }, "Edit Fields3": { "main": [ [ { "node": "Merge1", "type": "main", "index": 1 } ] ] }, "Merge": { "main": [ [ { "node": "Edit Fields", "type": "main", "index": 0 } ] ] }, "HTTP Request2": { "main": [ [] ] } }, "settings": { "executionOrder": "v1" }, "staticData": null, "meta": { "templateCredsSetupCompleted": true }, "pinData": {}, "versionId": "03025593-e7d9-4312-8ea1-c69ccfed1b87", "triggerCount": 0, "shared": [ { "updatedAt": "2025-12-21T08:27:02.747Z", "createdAt": "2025-12-21T08:27:02.747Z", "role": "workflow:owner", "workflowId": "N4n2HmA6azz8n7Uw", "projectId": "S4tmpzSj6JlGFOze" } ], "tags": [] }