{
  "name": "Monitor PostgreSQL data quality and generate remediation alerts with Slack",
  "nodes": [
    {
      "id": "b2fcf63e-b2a0-4d0a-8df1-6e06e2b3dc1e",
      "name": "Schedule DB Quality Scan",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -672,
        224
      ]
    },
    {
      "id": "bad30ec6-11fa-4d9c-b66f-f685546fb82d",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -464,
        224
      ]
    },
    {
      "id": "b3eebfd6-88bb-435f-80d7-411fb423f546",
      "name": "Get Schema Metadata",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -128,
        -48
      ]
    },
    {
      "id": "40d7ac18-bef8-47f5-964a-0bbe59107125",
      "name": "Get Table Statistics",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -128,
        224
      ]
    },
    {
      "id": "5a61e58d-fd77-4bc0-aef0-eabc3fc410a9",
      "name": "Get Historical Baselines",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -128,
        416
      ]
    },
    {
      "id": "42867364-5006-44b2-ab56-3f7c0897fcb8",
      "name": "Detect Schema Drift",
      "type": "n8n-nodes-base.code",
      "position": [
        208,
        -48
      ]
    },
    {
      "id": "7ac59653-ed75-41ac-b19d-02e2e2beeee3",
      "name": "Detect Null Explosions",
      "type": "n8n-nodes-base.code",
      "position": [
        208,
        160
      ]
    },
    {
      "id": "d2790027-d863-4126-9ce8-c2998809ae3a",
      "name": "Detect Outlier Distributions",
      "type": "n8n-nodes-base.code",
      "position": [
        208,
        384
      ]
    },
    {
      "id": "dbe44b7a-936f-44cd-a376-888c71f5e242",
      "name": "Combine All Issues",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        464,
        128
      ]
    },
    {
      "id": "7835d9d6-b483-496e-a8f1-e4861d29fed2",
      "name": "Calculate Confidence Scores",
      "type": "n8n-nodes-base.code",
      "position": [
        640,
        128
      ]
    },
    {
      "id": "ba0f352a-1a7c-4c62-9c2b-bc3a9c42d730",
      "name": "Check Confidence Threshold",
      "type": "n8n-nodes-base.if",
      "position": [
        800,
        128
      ]
    },
    {
      "id": "fecc8343-1930-4730-9fc0-8760aaf6097b",
      "name": "Generate SQL Fixes",
      "type": "n8n-nodes-base.code",
      "position": [
        1088,
        112
      ]
    },
    {
      "id": "8f05dfe2-f1b7-4cf4-8645-887cb7c9bb12",
      "name": "Store Issue in Audit Log",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1344,
        112
      ]
    },
    {
      "id": "bd9b5a43-277f-4b70-940f-ea546ab079cd",
      "name": "Send Alert to Team",
      "type": "n8n-nodes-base.slack",
      "position": [
        1552,
        112
      ]
    },
    {
      "id": "03b96358-29c8-497a-a1da-8bd9d4723c76",
      "name": "Update Baselines",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1728,
        112
      ]
    },
    {
      "id": "3b790b9c-eb8b-4cee-a353-147f5220f9ec",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        -32
      ],
      "parameters": {
        "width": 256,
        "height": 368,
        "content": "## Suggestions\n\nFor high-confidence issues, the workflow generates SQL suggestions for investigation or correction."
      }
    },
    {
      "id": "ab37b97d-d2c9-4bd9-a634-a7005e5930aa",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        96
      ],
      "parameters": {
        "width": 448,
        "height": 448,
        "content": "## Autonomous Data Quality Monitoring and Remediation for Production Databases\n This workflow continuously monitors PostgreSQL database health by running automated data quality checks every six hours."
      }
    },
    {
      "id": "c55ed3d0-c3dd-49ab-822e-5c3a59bc32e4",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        -16
      ],
      "parameters": {
        "width": 704,
        "height": 336,
        "content": "## Logging, Alerts & Baseline Updates\n\nConfirmed issues are stored in a PostgreSQL audit table and alerts are sent to Slack.\nFinally, the workflow updates baseline statistics to improve future anomaly"
      }
    },
    {
      "id": "e15e09e6-e46a-4fbf-aa43-f0b3f181c326",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        -32
      ],
      "parameters": {
        "width": 544,
        "height": 368,
        "content": "## Issue Scoring & Filtering\n\nEach issue receives a confidence score based on severity, frequency, data volume affected, and consistency.\nOnly issues exceeding the configured confidence threshold proc"
      }
    },
    {
      "id": "77d8b644-03cc-4cd3-878d-7cc869621d74",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        -272
      ],
      "parameters": {
        "width": 304,
        "height": 1040,
        "content": "## Data Quality Detection Engine\n\nThree parallel checks detect potential problems:\n1>Schema drift (structure changes)\n2>Null explosions (unexpected missing values)\n3>Outlier distributions (statistical"
      }
    },
    {
      "id": "16a1ff1b-c8e2-49d6-819b-087f0100a606",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -272
      ],
      "parameters": {
        "width": 352,
        "height": 1040,
        "content": "## Database Metadata Collection\n\nFetches schema metadata, table statistics, and historical baseline records from PostgreSQL.\nThese datasets provide the reference points required to analyze schema chan"
      }
    },
    {
      "id": "afbd454d-4ee3-43b4-b105-b90b42e4906c",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        80
      ],
      "parameters": {
        "width": 464,
        "height": 320,
        "content": "## Workflow Trigger & Configuration\n\nRuns every 6 hours to monitor database quality."
      }
    }
  ],
  "connections": {
    "Combine All Issues": {
      "main": [
        [
          {
            "node": "Calculate Confidence Scores",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate SQL Fixes": {
      "main": [
        [
          {
            "node": "Store Issue in Audit Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Alert to Team": {
      "main": [
        [
          {
            "node": "Update Baselines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Schema Drift": {
      "main": [
        [
          {
            "node": "Combine All Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Schema Metadata": {
      "main": [
        [
          {
            "node": "Detect Schema Drift",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Table Statistics": {
      "main": [
        [
          {
            "node": "Detect Null Explosions",
            "type": "main",
            "index": 0
          },
          {
            "node": "Detect Outlier Distributions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Null Explosions": {
      "main": [
        [
          {
            "node": "Combine All Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Get Schema Metadata",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Table Statistics",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Historical Baselines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule DB Quality Scan": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Issue in Audit Log": {
      "main": [
        [
          {
            "node": "Send Alert to Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Confidence Threshold": {
      "main": [
        [
          {
            "node": "Generate SQL Fixes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Confidence Scores": {
      "main": [
        [
          {
            "node": "Check Confidence Threshold",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Outlier Distributions": {
      "main": [
        [
          {
            "node": "Combine All Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}