DOCS/workflow/04_scheduler/scheduled_rag_reindex_retry.json
2026-03-18 23:49:20 +09:00

84 lines
2.4 KiB
JSON

{
"name": "robeing-scheduled-rag-reindex-retry",
"nodes": [
{
"parameters": {
"rule": {
"cronExpression": "0 */6 * * *"
}
},
"id": "sched-rag-001",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1,
"position": [220, 220]
},
{
"parameters": {
"operation": "executeQuery",
"query": "SELECT id, payload_json FROM rag_retry_queue WHERE status = 'pending' ORDER BY created_at ASC LIMIT 20;",
"options": {}
},
"id": "sched-rag-002",
"name": "Load Retry Queue",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.2,
"position": [470, 220]
},
{
"parameters": {
"method": "POST",
"url": "=http://192.168.219.52:8508/api/reindex",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "X-User-Id",
"value": "=system"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ $json.payload_json }}",
"options": {
"response": {
"response": {
"fullResponse": true
}
},
"timeout": 120000
}
},
"id": "sched-rag-003",
"name": "Call Reindex API",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [720, 220]
},
{
"parameters": {
"operation": "executeQuery",
"query": "UPDATE rag_retry_queue SET status = 'done', processed_at = NOW() WHERE id = '{{ $('Load Retry Queue').item.json.id }}';",
"options": {}
},
"id": "sched-rag-004",
"name": "Mark Done",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.2,
"position": [960, 220]
}
],
"connections": {
"Schedule Trigger": { "main": [[{ "node": "Load Retry Queue", "type": "main", "index": 0 }]] },
"Load Retry Queue": { "main": [[{ "node": "Call Reindex API", "type": "main", "index": 0 }]] },
"Call Reindex API": { "main": [[{ "node": "Mark Done", "type": "main", "index": 0 }]] }
},
"pinData": {},
"meta": { "templateCredsSetupCompleted": true, "instanceId": "robeing-scheduler" }
}