{ "id": "6wbkc4d1AouGpmWT", "name": "Fleet Ops — RAGcore Procedure Sync", "nodes": [ { "parameters": {}, "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 128, -144 ], "id": "08f41c46-d5a9-4cb9-beec-0f074a9eb7bc", "name": "Sticky Note" }, { "parameters": { "rule": { "interval": [ {} ] } }, "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.3, "position": [ -144, -144 ], "id": "6edcd359-08eb-4d88-98e9-5ca0625047cc", "name": "Schedule Trigger" }, { "parameters": { "url": "http://192.168.10.150:1236/api/v1/integrations/n8n/procedures", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "options": { "timeout": 15000 } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [ 80, -144 ], "id": "b66d3ee4-6264-48ab-89fc-aeb4d1597435", "name": "List procedures", "retryOnFail": true, "credentials": { "httpHeaderAuth": { "name": "Fleet Ops Service Token" } } }, { "parameters": { "jsCode": "const documents = $input.first().json.documents;\nconst results = [];\nfor (const doc of documents) {\n const binary = await this.helpers.prepareBinaryData(Buffer.from(doc.content, 'utf-8'), doc.document_id + '.md', 'text/markdown');\n results.push({json: {id: doc.id, language: doc.language, document_id: doc.document_id, title: doc.title, version: doc.version, content_hash: doc.content_hash}, binary: {file: binary}});\n}\nreturn results;" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 304, -144 ], "id": "e9699a7a-87ff-4603-b89b-553dc7f2f29d", "name": "Prepare uploads" }, { "parameters": { "method": "POST", "url": "https://rag.itworx.tech/v1/uploads", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Idempotency-Key", "value": "={{ $json.id + '-' + $json.content_hash }}" } ] }, "sendBody": true, "contentType": "multipart-form-data", "bodyParameters": { "parameters": [ { "name": "space_id", "value": "f4c91e49-5cf9-48ba-b3d6-e0e9854ebccc" }, { "name": "source_id", "value": "={{ $json.id }}" }, { "parameterType": "formBinaryData", "name": "file", "inputDataFieldName": "file" } ] }, "options": { "timeout": 20000 } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [ 528, -144 ], "id": "6d38f228-ed82-44a7-bc59-c785767d4f35", "name": "Upload to RAGcore", "retryOnFail": true, "credentials": { "httpHeaderAuth": { "name": "RAGcore Sync Token" } }, "onError": "continueRegularOutput" }, { "parameters": { "jsCode": "const items = $input.all();\nlet synced = 0;\nlet failed = 0;\nfor (const item of items) {\n if (item.json && item.json.error) {\n failed += 1;\n } else {\n synced += 1;\n }\n}\nreturn [{ json: { execution_id: String($execution.id), synced, failed } }];" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 640, -144 ], "id": "4b90056e-29f8-4df0-b7b4-695f4b9e0004", "name": "Summarize sync result" }, { "parameters": { "method": "POST", "url": "http://192.168.10.150:1236/api/v1/integrations/n8n/procedures-sync-result", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "bodyParameters": { "parameters": [ { "name": "execution_id", "value": "={{ $json.execution_id }}" }, { "name": "synced", "value": "={{ $json.synced }}" }, { "name": "failed", "value": "={{ $json.failed }}" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [ 848, -144 ], "id": "953cd587-3d3e-44b5-907c-92b8355b00e3", "name": "Report sync result to Fleet Ops", "credentials": { "httpHeaderAuth": { "name": "Fleet Ops Service Token" } } } ], "connections": { "Schedule Trigger": { "main": [ [ { "node": "List procedures", "type": "main", "index": 0 } ] ] }, "List procedures": { "main": [ [ { "node": "Prepare uploads", "type": "main", "index": 0 } ] ] }, "Prepare uploads": { "main": [ [ { "node": "Upload to RAGcore", "type": "main", "index": 0 } ] ] }, "Upload to RAGcore": { "main": [ [ { "node": "Summarize sync result", "type": "main", "index": 0 } ] ] }, "Summarize sync result": { "main": [ [ { "node": "Report sync result to Fleet Ops", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1", "binaryMode": "separate", "availableInMCP": false, "errorWorkflow": "Xppn2rAEqUuyiCJF", "callerPolicy": "workflowsFromSameOwner" }, "active": false, "meta": { "templateCredsSetupCompleted": false }, "tags": [] }