Files
MobilityOps/n8n/workflows/fleet-ops-ragcore-procedure-sync.json
T
NuklearRabbit 81de78bd8b
MobilityOps acceptance / backend (push) Failing after 19s
MobilityOps acceptance / frontend (push) Successful in 26s
MobilityOps acceptance / e2e (push) Skipped
M56: make RAGcore sync fail closed
2026-08-24 03:58:57 +02:00

285 lines
7.7 KiB
JSON

{
"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": "https://fleetops.itworx.tech/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": {
"method": "POST",
"url": "https://fleetops.itworx.tech/api/v1/integrations/n8n/heartbeat",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"contentType": "json",
"specifyBody": "keypair",
"bodyParameters": { "parameters": [
{ "name": "workflow_id", "value": "={{ $workflow.id }}" },
{ "name": "workflow_name", "value": "={{ $workflow.name }}" },
{ "name": "execution_id", "value": "={{ $execution.id }}" },
{ "name": "status", "value": "succeeded" }
]},
"options": { "timeout": 15000 }
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [1056, -144],
"id": "workflow-heartbeat-node",
"name": "Report workflow heartbeat",
"credentials": { "httpHeaderAuth": { "name": "Fleet Ops Service Token" } },
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 1000
},
{
"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 }}"
},
{
"name": "external_id",
"value": "={{ $json.document_id + '.md' }}"
},
{
"name": "locale",
"value": "={{ $json.language }}"
},
{
"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 const body = item && item.json;\n const accepted = body && typeof body.job_id === 'string' && typeof body.status_url === 'string' && body.status_url.length > 0;\n if (accepted) {\n synced += 1;\n } else {\n failed += 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": "https://fleetops.itworx.tech/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
}
]
]
},
"Report sync result to Fleet Ops": {
"main": [[{ "node": "Report workflow heartbeat", "type": "main", "index": 0 }]]
}
},
"settings": {
"executionOrder": "v1",
"binaryMode": "separate",
"availableInMCP": false,
"errorWorkflow": "Xppn2rAEqUuyiCJF",
"callerPolicy": "workflowsFromSameOwner"
},
"active": false,
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}