Files
n8n-workspace/ollama.json
2001-01-01 00:00:00 +00:00

570 lines
18 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-01-01T22:37:57.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\nAntworte nur als JSON Ausgabe wie z.B. hier, 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\nAntworte nur als JSON Ausgabe wie z.B. hier, 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\nStelle sicher das ausschließlich mit purem JSON. Nutze keine Markdown-Formatierung wie ` ` `json. Beginne direkt mit der öffnenden geschweiften Klammer {.",
"format": "json"
}
},
"type": "@n8n/n8n-nodes-langchain.ollama",
"typeVersion": 1,
"position": [
1168,
-56
],
"id": "8e7a99f1-ca7f-4b2d-8b30-22749e613aa2",
"name": "Message a model",
"executeOnce": true,
"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",
"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": true
},
{
"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": [
496,
-32
],
"id": "2c3873ee-ce74-4c04-bb32-88b7c2f51c28",
"name": "Loop Over Items",
"executeOnce": false
},
{
"parameters": {
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "= {{ $json.data }}"
},
{
"fieldToAggregate": "title"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
272,
-448
],
"id": "b3146320-bae1-480e-8d52-e9c8ce44620e",
"name": "Aggregate1"
},
{
"parameters": {
"mode": "raw",
"jsonOutput": "={\n \"id\": {{ $('Loop Over Items').item.json.id }},\n \"title\": \"{{$json.data.Title}}\",\n \"korrespondent\": \"{{ $json.data.Korrespondent }}\",\n \"dokumenttyp\": \"{{ $json.data.Dokumenttyp }}\"\n}\n",
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
48,
-448
],
"id": "f8d862e2-cdbd-4e3c-95ba-1e99a4564be0",
"name": "Edit Fields1"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "5ef46e88-d057-485e-9a75-8dcd244c737f",
"name": "data",
"value": "={{ $json.content }}",
"type": "object"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-176,
-448
],
"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": {},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
944,
-128
],
"id": "73a54e13-82ed-4ce8-9678-4931272b86fd",
"name": "Merge1"
},
{
"parameters": {
"mode": "raw",
"jsonOutput": "={\n \"document\": [{{$json.toJsonString()}}]\n}\n",
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
720,
-32
],
"id": "9b804e40-985c-4573-8828-6f38baa284d9",
"name": "Edit Fields3"
},
{
"parameters": {
"method": "POST",
"url": "=http://192.168.178.101:8000/api/documents/",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "id",
"value": "={{ $json.data['document-id'] }}"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "title",
"value": "={{ $json.data.content.parseJson().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": {},
"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": "Merge",
"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 Fields1": {
"main": [
[
{
"node": "Aggregate1",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields2": {
"main": [
[
{
"node": "Edit Fields1",
"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
}
]
]
},
"Aggregate1": {
"main": [
[]
]
},
"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
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"staticData": null,
"meta": {
"templateCredsSetupCompleted": true
},
"pinData": {
"Message a model": [
{
"json": {
"content": "{\n\"Title\": \"Einkommensteuererklärung 2021 Ranjan Prasanna\",\n\"Korrespondent-ID\": null,\n\"Korrespondent\": \"Finanzamt Heilbronn\",\n\"Dokumenttyp\": \"ESt-Erklärung (Hauptvordruck ESt 1A)\"\n}"
}
}
]
},
"versionId": "49c87adb-2f1d-4ee3-b28b-2f8ae735afaa",
"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": []
}