Files
n8n-workspace/Creat-New-Paperless-Korrospodent.json

645 lines
20 KiB
JSON
Raw Permalink 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-08-26T20:27:46.756Z",
"createdAt": "2026-08-26T19:36:41.957Z",
"id": "AyI9y5ewxWbEacD6",
"name": "Creat-New-Paperless-Korrospodent",
"active": false,
"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": "AITag2"
},
{
"name": "tags__id__in",
"value": "17"
}
]
},
"options": {
"response": {
"response": {}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
-1344,
624
],
"id": "2dcaf020-8864-4077-837a-ccf887a9ef02",
"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": "5ab009ad-1fc7-45c2-b4c8-1ce5d9b0b74b",
"name": "Edit Fields",
"executeOnce": false
},
{
"parameters": {
"fieldToSplitOut": "results",
"options": {}
},
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"position": [
-1120,
624
],
"id": "b2a0ee1d-a88d-452a-97ca-388d6ab3c2bc",
"name": "Split Out"
},
{
"parameters": {
"options": {
"reset": false
}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
-896,
624
],
"id": "1b486ac2-1b35-44c7-b2f9-abaa4a93e8ec",
"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": "6e3c99cd-6d0c-48bb-9063-3b7b23bc6fea",
"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": "de15b266-e0ff-4dc8-b427-059a217ad5fd",
"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": "ea4bbfaa-424b-4733-b8b3-ab22fcd13295",
"name": "dataPreparationToJSON"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
1024,
480
],
"id": "6a45617e-d893-4fa9-a17b-6c2125dd135d",
"name": "Merge"
},
{
"parameters": {
"url": "=https://paperless.prinz-pilaw.de/api/correspondents/",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"options": {
"response": {
"response": {}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
1472,
608
],
"id": "b664e5ec-0bc6-454e-9703-eb00e67e1260",
"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": "94405365-458e-4d1b-ac74-7e9889c68402",
"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": "ed0736e4-c99b-4761-b171-f6edc2b16207",
"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": "1a63e077-fee0-40b7-99a4-6a72d61c2955",
"name": "Call 'paperless_get_component'"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
0,
336
],
"id": "369c02b5-b435-4825-a71b-ee05c06c6386",
"name": "Merge1",
"executeOnce": true
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-1600,
336
],
"id": "1c464ae4-8c64-4f4e-a0ee-a6f6bf10c22a",
"name": "When clicking ‘Execute workflow’"
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "ministral-3:3b",
"mode": "list",
"cachedResultName": "ministral-3:3b"
},
"messages": {
"values": [
{
"content": "=[Dokument Inhalt Start]\n{{ $('documentObject').item.json.document[0].title}}\n[Dokument Inhalt Ende]"
}
]
},
"options": {
"system": "Kannst du bitte für dieses Dokumenten Titel den passenden Korrespondent zuweisen, welche ich in Paperless für Dokument benutze. \nVersuch aus dem Title den Korrespondent, DokumentType und Tags Vorzuschlage der für einfache Suche später in Paperless nützlich wäre.\n\n\nStelle sicher das ausschließlich mit purem JSON. Nutze keine Markdown-Formatierung wie ` ` `json. Beginne direkt mit der öffnenden geschweiften Klammer {.\n\n\nBeispielantwort 2 wenn du einen neunen Korrespondent vorschlägst\n{\n\"Title\": \"Bestellung Aliexpress\",\n\"Korrespondent\": \"Aliexpress\"\n\"Korrespondent\": \"Aliexpress\"\n\"Tags:[\"Online Einkauf\"],\n\"Dokumenttyp\": \"Bestellung\"\n}",
"format": "json"
}
},
"type": "@n8n/n8n-nodes-langchain.ollama",
"typeVersion": 1,
"position": [
432,
320
],
"id": "8f764717-9b44-4ba6-828c-5d69ae5e1bc0",
"name": "Message a model1",
"executeOnce": true,
"credentials": {
"ollamaApi": {
"id": "fgaZliEtIoej3jtn",
"name": "Ollama account"
}
}
},
{
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 3
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.3,
"position": [
-1600,
528
],
"id": "db39fbc6-ed71-4496-af1a-2be4cdbc7c93",
"name": "Schedule Trigger"
}
],
"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": "Merge1",
"type": "main",
"index": 0
}
],
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"correspondents": {
"main": [
[
{
"node": "Call 'paperless_get_component'",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Message a model1",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "correspondents",
"type": "main",
"index": 0
},
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Message a model1": {
"main": [
[
{
"node": "dataPreparationToJSON",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "correspondents",
"type": "main",
"index": 0
},
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1",
"availableInMCP": false,
"binaryMode": "separate"
},
"staticData": {
"node:Schedule Trigger": {
"recurrenceRules": []
}
},
"meta": {
"templateCredsSetupCompleted": true
},
"pinData": {
"Message a model1": [
{
"json": {
"content": "{\n \"Title\": \"Parkentgeltbeleg Heidelberg\",\n \"Korrespondent\": \"Stadt Heidelberg\",\n \"Tags\": [\"Parkgebühren\", \"Beleg\", \"Öffentliche Einrichtung\"],\n \"Dokumenttyp\": \"Parkgebühr/Rechnung\"\n}"
},
"pairedItem": {
"item": 0
}
}
]
},
"versionId": "ee4360d3-70b3-403d-80a8-46e5df49771a",
"activeVersionId": null,
"triggerCount": 1,
"shared": [
{
"updatedAt": "2026-08-26T19:36:42.069Z",
"createdAt": "2026-08-26T19:36:42.069Z",
"role": "workflow:owner",
"workflowId": "AyI9y5ewxWbEacD6",
"projectId": "cSAaWNJydnksD5EB"
}
],
"activeVersion": null,
"tags": [
{
"updatedAt": "2026-02-07T16:44:35.454Z",
"createdAt": "2026-02-07T16:44:35.454Z",
"id": "0tHqAlm05JhR7voQ",
"name": "ollama_paperless"
}
]
}