{
  "name": "VisionOne Market Intel — High-Risk Insight Escalation",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "vo-marketintel-high-risk",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Webhook from Market Intel",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1.1,
      "position": [240, 300],
      "webhookId": "vo-marketintel-high-risk"
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose" },
          "conditions": [
            {
              "id": "is-high-risk",
              "leftValue": "={{ $json.body.event }}",
              "rightValue": "insight.high-risk",
              "operator": { "type": "string", "operation": "equals" }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "filter-event",
      "name": "Only insight.high-risk",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [460, 300]
    },
    {
      "parameters": {
        "resource": "channelMessage",
        "operation": "create",
        "teamId": "={{ $env.VO_TEAMS_TEAM_ID }}",
        "channelId": "={{ $env.VO_TEAMS_CHANNEL_ID }}",
        "messageType": "html",
        "message": "<h3>🚨 High-risk insight surfaced</h3><p><strong>{{ $('Webhook from Market Intel').item.json.body.payload.title }}</strong></p><p>{{ $('Webhook from Market Intel').item.json.body.payload.summary }}</p><p><em>Why this matters:</em> {{ $('Webhook from Market Intel').item.json.body.payload.whyRelevant }}</p><p><a href='{{ $env.VO_MARKETINTEL_BASE_URL }}{{ $('Webhook from Market Intel').item.json.body.payload.openInPlatformPath }}'>Open in Market Intel →</a></p>"
      },
      "id": "post-teams",
      "name": "Post Teams alert",
      "type": "n8n-nodes-base.microsoftTeams",
      "typeVersion": 2,
      "position": [680, 200]
    },
    {
      "parameters": {
        "resource": "task",
        "operation": "create",
        "listId": "={{ $env.VO_TODO_LIST_ID }}",
        "title": "Review high-risk insight: {{ $('Webhook from Market Intel').item.json.body.payload.title }}",
        "additionalFields": {
          "body": {
            "contentType": "html",
            "content": "{{ $('Webhook from Market Intel').item.json.body.payload.summary }}\n\nWhy: {{ $('Webhook from Market Intel').item.json.body.payload.whyRelevant }}"
          },
          "importance": "high"
        }
      },
      "id": "create-task",
      "name": "Create MS To-Do task",
      "type": "n8n-nodes-base.microsoftToDo",
      "typeVersion": 1,
      "position": [680, 400]
    }
  ],
  "connections": {
    "Webhook from Market Intel": { "main": [[{ "node": "Only insight.high-risk", "type": "main", "index": 0 }]] },
    "Only insight.high-risk": {
      "main": [
        [
          { "node": "Post Teams alert", "type": "main", "index": 0 },
          { "node": "Create MS To-Do task", "type": "main", "index": 0 }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": { "executionOrder": "v1" },
  "tags": [{ "name": "VisionOne Market Intel" }],
  "meta": {
    "templateNote": "After importing: (1) save the workflow to generate a webhook URL, (2) paste that URL into Market Intel under Settings → Outbound webhooks → insight.high-risk, (3) set env vars VO_TEAMS_TEAM_ID, VO_TEAMS_CHANNEL_ID, VO_TODO_LIST_ID, VO_MARKETINTEL_BASE_URL."
  }
}
