{
  "name": "Cybersec Assistant - Alert Workflow",
  "nodes": [
    {
      "parameters": {
        "path": "cybersec-assistant-webhook",
        "httpMethod": "POST",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "WebhookTrigger",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        300,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"action\"]}}",
              "operation": "equals",
              "value2": "alert"
            }
          ]
        }
      },
      "id": "IfAlert",
      "name": "IF Alert",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        520,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "mememaking88@gmail.com",
        "toEmail": "shravanr2404@gmail.com",
        "subject": "\ud83d\udea8 Cybersecurity Alert \u2013 High Risk Event",
        "text": "\ud83d\udea8 CYBERSECURITY ALERT \ud83d\udea8\n\nType: {{$json[\"type\"]}}\nAction: {{$json[\"action\"]}}\nRisk Score: {{$json[\"combined_score\"] || $json[\"risk_score\"]}}\nConfidence: {{$json[\"confidence\"]}}\nReason: {{$json[\"reason\"]}}\n\nGenerated At: {{$now}}"
      },
      "id": "EmailAlert",
      "name": "Send Email Alert",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        760,
        200
      ],
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "http://localhost:8000/events",
        "method": "POST",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={{JSON.stringify($json)}}"
      },
      "id": "HttpLogger",
      "name": "HTTP Request (Logger)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        760,
        420
      ]
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "IF Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Alert": {
      "main": [
        [
          {
            "node": "Send Email Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request (Logger)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {},
  "versionId": "1"
}