{
  "name": "SQL Table to Documentation Generator",
  "nodes": [
    {
      "parameters": {},
      "id": "trigger-manual",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 7
            }
          ]
        }
      },
      "id": "trigger-schedule",
      "name": "Weekly Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        250,
        500
      ],
      "disabled": true
    },
    {
      "parameters": {
        "command": "cd \"${SQL_TABLE_DOCS_DIR:-sql-docs-generator}\" && python sql_table_to_docs.py"
      },
      "id": "execute-python",
      "name": "Run Documentation Generator",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        500,
        400
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "condition-success",
              "leftValue": "={{ $json.exitCode }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "check-result",
      "name": "Check Result",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        750,
        400
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "assign-success",
              "name": "status",
              "value": "SUCCESS",
              "type": "string"
            },
            {
              "id": "assign-message",
              "name": "message",
              "value": "=Documentation generated successfully!\n\nOutput:\n{{ $json.stdout }}",
              "type": "string"
            },
            {
              "id": "assign-timestamp",
              "name": "timestamp",
              "value": "={{ $now.toISO() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "success-response",
      "name": "Success Response",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1000,
        300
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "assign-error",
              "name": "status",
              "value": "ERROR",
              "type": "string"
            },
            {
              "id": "assign-error-msg",
              "name": "message",
              "value": "=Documentation generation failed!\n\nError:\n{{ $json.stderr }}",
              "type": "string"
            },
            {
              "id": "assign-error-time",
              "name": "timestamp",
              "value": "={{ $now.toISO() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "error-response",
      "name": "Error Response",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1000,
        500
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Run Documentation Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Schedule": {
      "main": [
        [
          {
            "node": "Run Documentation Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Documentation Generator": {
      "main": [
        [
          {
            "node": "Check Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Result": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2026-01-30T07:00:00.000Z",
  "versionId": "1"
}