{ "updatedAt": "2026-02-07T17:13:43.905Z", "createdAt": "2026-02-07T16:45:07.903Z", "id": "Fw7gwUx6RgHKBZO5cmsjj", "name": "paperless_get_component", "active": true, "isArchived": false, "nodes": [ { "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": [ 672, 0 ], "id": "41d0050b-f792-4693-806b-1becb62ceffd", "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 slug: 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": [ 896, 0 ], "id": "ccb72276-0ec9-476c-a38f-1b15415111ef", "name": "Code in JavaScript" }, { "parameters": { "url": "={{ \n $('weitere Seiten vorhanden').isExecuted == false ? $('global_variables').item.json.component_url: $node['weitere Seiten vorhanden'].json.next\n}}", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "options": { "response": { "response": {} } } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 448, 0 ], "id": "1176cd8e-142f-400d-9197-f23ae7e19bd2", "name": "get_correspondents", "credentials": { "httpHeaderAuth": { "id": "Yn1cJCfoNitCVwdO", "name": "paperless_api_token" } } }, { "parameters": { "operation": "upsert", "dataTableId": { "__rl": true, "value": "={{\n$('global_variables').item.json.component_name == \"tags\" \n?\n$('global_variables').item.json.paperless_tag_db_id\n:\n$('global_variables').item.json.component_name == \"correspondents\" \n?\n$('global_variables').item.json.paperless_correspondent_db_id\n:\n$('global_variables').item.json.component_name == \"document_types\" \n?\n$('global_variables').item.json.paperless_document_type_db_id\n:null\n}}", "mode": "id" }, "filters": { "conditions": [ { "keyName": "paperless_id", "keyValue": "={{ $json.id }}" } ] }, "columns": { "mappingMode": "defineBelow", "value": { "paperless_id": "={{ $json.id }}", "slug": "={{ $json.slug }}", "name": "={{ $json.name }}" }, "matchingColumns": [], "schema": [ { "id": "paperless_id", "displayName": "paperless_id", "required": false, "defaultMatch": false, "display": true, "type": "string", "readOnly": false, "removed": false }, { "id": "slug", "displayName": "slug", "required": false, "defaultMatch": false, "display": true, "type": "string", "readOnly": false, "removed": false }, { "id": "name", "displayName": "name", "required": false, "defaultMatch": false, "display": true, "type": "string", "readOnly": false, "removed": false } ], "attemptToConvertTypes": false, "convertFieldsToString": false }, "options": { "dryRun": false } }, "type": "n8n-nodes-base.dataTable", "typeVersion": 1, "position": [ 1344, 0 ], "id": "f99670d5-1124-4439-a429-23819b045bd9", "name": "Upsert row(s)", "executeOnce": false }, { "parameters": { "fieldToSplitOut": "allData", "options": {} }, "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 1120, 0 ], "id": "0f193634-6bbe-483c-aa85-f65268d7ea49", "name": "Split Out1" }, { "parameters": { "workflowInputs": { "values": [ { "name": "component_name" }, { "name": "component_url" } ] } }, "type": "n8n-nodes-base.executeWorkflowTrigger", "typeVersion": 1.1, "position": [ 0, 0 ], "id": "87e400f6-9e17-4f47-ab64-5c9dcc3abbc2", "name": "When Executed by Another Workflow" }, { "parameters": { "assignments": { "assignments": [ { "id": "653145bb-ff78-4a14-a90a-c20f890f0889", "name": "component_name", "value": "={{ \n$('When Executed by Another Workflow').item.json.component_name || \"tags\"\n}}", "type": "string" }, { "id": "c84e488d-1891-4a18-98be-21c4c5a9f0ae", "name": "component_url", "value": "={{ \n$('When Executed by Another Workflow').item.json.component_url\n||\n\"http://192.168.178.101:8000/api/tags/\"\n}}", "type": "string" }, { "id": "40329995-bcdb-4546-b2dc-d8b33d020198", "name": "paperless_correspondent_db_id", "value": "sjO4pAZNP1j1hHH2", "type": "string" }, { "id": "ff02936f-ddb3-40e4-9255-54cdfff6c291", "name": "paperless_tag_db_id", "value": "jBGyNOUjWYnAqA8C", "type": "string" }, { "id": "ab142cd3-e7bb-4fd6-9871-d15f57cee573", "name": "paperless_document_type_db_id", "value": "UYRGUJmbU2Q3Ztv6", "type": "string" } ] }, "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 224, 0 ], "id": "44c7e2f3-aa59-4087-8664-62ecd3b6df7b", "name": "global_variables" } ], "connections": { "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": "Split Out1", "type": "main", "index": 0 } ] ] }, "Split Out1": { "main": [ [ { "node": "Upsert row(s)", "type": "main", "index": 0 } ] ] }, "When Executed by Another Workflow": { "main": [ [ { "node": "global_variables", "type": "main", "index": 0 } ] ] }, "global_variables": { "main": [ [ { "node": "get_correspondents", "type": "main", "index": 0 } ] ] }, "Upsert row(s)": { "main": [ [] ] } }, "settings": { "executionOrder": "v1", "availableInMCP": false }, "staticData": null, "meta": null, "pinData": { "When Executed by Another Workflow": [ { "json": { "component_name": "tags", "component_url": "http://192.168.178.101:8000/api/tags/" } } ] }, "versionId": "cf68cb1d-9442-4921-a000-6438a29f44a8", "activeVersionId": "a8b5c228-6234-4074-8462-7ad002240178", "triggerCount": 0, "shared": [ { "updatedAt": "2026-02-07T16:45:07.904Z", "createdAt": "2026-02-07T16:45:07.904Z", "role": "workflow:owner", "workflowId": "Fw7gwUx6RgHKBZO5cmsjj", "projectId": "cSAaWNJydnksD5EB" } ], "activeVersion": { "updatedAt": "2026-02-07T16:52:40.000Z", "createdAt": "2026-02-07T16:51:39.266Z", "versionId": "a8b5c228-6234-4074-8462-7ad002240178", "workflowId": "Fw7gwUx6RgHKBZO5cmsjj", "nodes": [ { "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": [ 672, 0 ], "id": "41d0050b-f792-4693-806b-1becb62ceffd", "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 slug: 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": [ 896, 0 ], "id": "ccb72276-0ec9-476c-a38f-1b15415111ef", "name": "Code in JavaScript" }, { "parameters": { "url": "={{ \n $('weitere Seiten vorhanden').isExecuted == false ? $('global_variables').item.json.component_url: $node['weitere Seiten vorhanden'].json.next\n}}", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "options": { "response": { "response": {} } } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 448, 0 ], "id": "1176cd8e-142f-400d-9197-f23ae7e19bd2", "name": "get_correspondents", "credentials": { "httpHeaderAuth": { "id": "Yn1cJCfoNitCVwdO", "name": "paperless_api_token" } } }, { "parameters": { "operation": "upsert", "dataTableId": { "__rl": true, "value": "={{\n$('global_variables').item.json.component_name == \"tags\" \n?\n$('global_variables').item.json.paperless_tag_db_id\n:\n$('global_variables').item.json.component_name == \"correspondents\" \n?\n$('global_variables').item.json.paperless_correspondent_db_id\n:\n$('global_variables').item.json.component_name == \"document_types\" \n?\n$('global_variables').item.json.paperless_document_type_db_id\n:null\n}}", "mode": "id" }, "filters": { "conditions": [ { "keyName": "paperless_id", "keyValue": "={{ $json.id }}" } ] }, "columns": { "mappingMode": "defineBelow", "value": { "paperless_id": "={{ $json.id }}", "slug": "={{ $json.slug }}", "name": "={{ $json.name }}" }, "matchingColumns": [], "schema": [ { "id": "paperless_id", "displayName": "paperless_id", "required": false, "defaultMatch": false, "display": true, "type": "string", "readOnly": false, "removed": false }, { "id": "slug", "displayName": "slug", "required": false, "defaultMatch": false, "display": true, "type": "string", "readOnly": false, "removed": false }, { "id": "name", "displayName": "name", "required": false, "defaultMatch": false, "display": true, "type": "string", "readOnly": false, "removed": false } ], "attemptToConvertTypes": false, "convertFieldsToString": false }, "options": { "dryRun": false } }, "type": "n8n-nodes-base.dataTable", "typeVersion": 1, "position": [ 1344, 0 ], "id": "f99670d5-1124-4439-a429-23819b045bd9", "name": "Upsert row(s)", "executeOnce": false }, { "parameters": { "fieldToSplitOut": "allData", "options": {} }, "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 1120, 0 ], "id": "0f193634-6bbe-483c-aa85-f65268d7ea49", "name": "Split Out1" }, { "parameters": { "workflowInputs": { "values": [ { "name": "component_name" }, { "name": "component_url" } ] } }, "type": "n8n-nodes-base.executeWorkflowTrigger", "typeVersion": 1.1, "position": [ 0, 0 ], "id": "87e400f6-9e17-4f47-ab64-5c9dcc3abbc2", "name": "When Executed by Another Workflow" }, { "parameters": { "assignments": { "assignments": [ { "id": "653145bb-ff78-4a14-a90a-c20f890f0889", "name": "component_name", "value": "={{ \n$('When Executed by Another Workflow').item.json.component_name || \"tags\"\n}}", "type": "string" }, { "id": "c84e488d-1891-4a18-98be-21c4c5a9f0ae", "name": "component_url", "value": "={{ \n$('When Executed by Another Workflow').item.json.component_url\n||\n\"http://192.168.178.101:8000/api/tags/\"\n}}", "type": "string" }, { "id": "40329995-bcdb-4546-b2dc-d8b33d020198", "name": "paperless_correspondent_db_id", "value": "WmMZJjFqs1LTGlxy", "type": "string" }, { "id": "ff02936f-ddb3-40e4-9255-54cdfff6c291", "name": "paperless_tag_db_id", "value": "O8FtQxHCgJRAtOy1", "type": "string" }, { "id": "ab142cd3-e7bb-4fd6-9871-d15f57cee573", "name": "paperless_document_type_db_id", "value": "9CYGbOQ8zjL0gRTE", "type": "string" } ] }, "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 224, 0 ], "id": "44c7e2f3-aa59-4087-8664-62ecd3b6df7b", "name": "global_variables" } ], "connections": { "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": "Split Out1", "type": "main", "index": 0 } ] ] }, "Split Out1": { "main": [ [ { "node": "Upsert row(s)", "type": "main", "index": 0 } ] ] }, "When Executed by Another Workflow": { "main": [ [ { "node": "global_variables", "type": "main", "index": 0 } ] ] }, "global_variables": { "main": [ [ { "node": "get_correspondents", "type": "main", "index": 0 } ] ] } }, "authors": "Prasanna Ranjan", "name": "Version a8b5c228", "description": "", "autosaved": false }, "tags": [ { "updatedAt": "2026-02-07T16:44:35.454Z", "createdAt": "2026-02-07T16:44:35.454Z", "id": "0tHqAlm05JhR7voQ", "name": "ollama_paperless" } ] }