{
  "name": "FlowForge → Privacy Scan Alert",
  "description": "Weekly privacy scan — calls check-priv on host, emails if issues found. 4 nodes.",
  "active": false,
  "settings": {
    "timezone": "UTC",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "tags": [
    "flowforge",
    "privacy",
    "security"
  ],
  "nodes": [
    {
      "id": "6524a4cd-0dcd-427a-9f05-773edc8f761c",
      "name": "Weekly Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 4 * * 0"
            }
          ]
        }
      }
    },
    {
      "id": "31691b84-d6de-4391-92e7-6f78d948f91e",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        250,
        500
      ],
      "parameters": {}
    },
    {
      "id": "31607043-3b4e-4516-b664-eec705715bdc",
      "name": "Run Privacy Scan",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        500,
        400
      ],
      "parameters": {
        "url": "http://172.18.0.1:9199/webhook/check-priv",
        "authentication": "none",
        "options": {
          "timeout": 180000,
          "allowUnauthorizedCerts": true
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Pipeline-Token",
              "value": "YOUR_PIPELINE_TOKEN"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "sendQuery": false,
        "sendHeaders": true,
        "method": "POST"
      }
    },
    {
      "id": "8880c0a5-fc69-4933-98b8-975c249f097c",
      "name": "Issues Found?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        750,
        400
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "39636362-9510-4596-9d76-75f2f5d581e3",
              "leftValue": "={{ $json.clean }}",
              "rightValue": false,
              "operator": {
                "type": "boolean",
                "operand": "equal"
              }
            }
          ]
        }
      }
    },
    {
      "id": "ec82638b-cb38-4746-a48f-ec56ced36d42",
      "name": "Alert Team",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        1000,
        300
      ],
      "credentials": {
        "smtp": {
          "id": "ppRdYzQFLTAlpkfK",
          "name": "SMTP account"
        }
      },
      "parameters": {
        "fromEmail": "security@flowforge.toolyft.com",
        "toEmail": "flowforge@toolyft.com",
        "subject": "={{ '⚠️ Privacy Scan Alert — ' + $json.exit_code + ' issue(s) found' }}",
        "text": "={{ 'Privacy scan detected issues in the project.\\n\\n' +\n  'Exit code: ' + $json.exit_code + '\\n' +\n  'Duration: ' + $json.duration_seconds + 's\\n\\n' +\n  'Report on server:\\n' +\n  '  check-priv --report\\n\\n' +\n  'Action required: Review flagged items above and fix before next scan.' }}",
        "options": {}
      }
    },
    {
      "id": "58b0145a-b37b-4acb-933f-9518cd3b20fb",
      "name": "All Clean",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1000,
        600
      ],
      "parameters": {}
    }
  ],
  "connections": {
    "Weekly Schedule": {
      "main": [
        [
          {
            "node": "Run Privacy Scan",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Run Privacy Scan",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Privacy Scan": {
      "main": [
        [
          {
            "node": "Issues Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Issues Found?": {
      "main": [
        [
          {
            "node": "Alert Team",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "All Clean",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}