{
  "name": "meerkat-ai-killswitch",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "GET",
        "path": "meerkat-ai-killswitch",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-killswitch",
      "name": "Webhook (GET /meerkat-ai-killswitch)",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [240, 300],
      "webhookId": "meerkat-ai-killswitch",
      "notes": "Public GET. Returns whether the AI Q&A widget should be active. Called by both the website (on page load) and the meerkat-ai-qa workflow (on each request)."
    },
    {
      "parameters": {
        "jsCode": "// THE KILL SWITCH.\n// Greg flips this single line to take the AI Q&A widget offline\n// across the whole site without redeploying anything.\n//\n// To flip it OFF: change ENABLED to false, save the workflow, and\n// the next time the website (or the Q&A workflow) checks, the AI\n// widget shows the offline notice instead.\n//\n// Optional: replace this with a read from a Notion/Sheets cell so\n// the toggle lives in a UI Greg already opens daily.\n\nconst ENABLED = true;\nconst REASON  = '';   // optional, e.g. \"taking it down for an hour to retrain\"\n\nreturn {\n  enabled: ENABLED,\n  reason: REASON || null,\n  checked_at: new Date().toISOString()\n};\n"
      },
      "id": "compute-state",
      "name": "Compute kill-switch state",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [460, 300]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify($json) }}",
        "options": {
          "responseHeaders": {
            "entries": [
              { "name": "Access-Control-Allow-Origin",  "value": "*" },
              { "name": "Cache-Control",                "value": "no-store" }
            ]
          }
        }
      },
      "id": "respond",
      "name": "Respond with state",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [680, 300]
    }
  ],
  "connections": {
    "Webhook (GET /meerkat-ai-killswitch)": {
      "main": [[{ "node": "Compute kill-switch state", "type": "main", "index": 0 }]]
    },
    "Compute kill-switch state": {
      "main": [[{ "node": "Respond with state", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "saveExecutionProgress": true,
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner"
  },
  "id": "meerkat-ai-killswitch",
  "tags": [{ "name": "meerkat-llc" }, { "name": "ai" }, { "name": "admin" }]
}
