{
  "name": "ARIA \u2014 Wiki Lint (Weekly Maintenance)",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 5 * * 0"
            }
          ]
        }
      },
      "name": "Sunday 5 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        240,
        300
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://aria-api:8420/wiki/lint",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "body": {
          "dry_run": false
        },
        "options": {
          "timeout": 300000
        }
      },
      "name": "Run Wiki Lint",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        460,
        300
      ],
      "typeVersion": 4
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{ $json.issues_found }}",
              "operation": "largerEqual",
              "value2": 1
            }
          ]
        }
      },
      "name": "Issues Found?",
      "type": "n8n-nodes-base.if",
      "position": [
        680,
        300
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://aria-api:8420/memory/store",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "body": {
          "content": "={{ 'Wiki lint: ' + $json.issues_found + ' issues found, ' + $json.issues_fixed + ' fixed. Split candidates: ' + $json.split_candidates.join(', ') }}",
          "namespace": "aria:aria:journal",
          "metadata": {
            "type": "wiki-lint",
            "issues_found": "={{ $json.issues_found }}",
            "issues_fixed": "={{ $json.issues_fixed }}"
          }
        }
      },
      "name": "Log to Journal",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        900,
        200
      ],
      "typeVersion": 4
    }
  ],
  "connections": {
    "Sunday 5 AM": {
      "main": [
        [
          {
            "node": "Run Wiki Lint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Wiki Lint": {
      "main": [
        [
          {
            "node": "Issues Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Issues Found?": {
      "main": [
        [
          {
            "node": "Log to Journal",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "wiki"
    },
    {
      "name": "maintenance"
    }
  ]
}