{
  "name": "03 · Content Marketing / Brand Kit Compliance Enforcer",
  "active": false,
  "nodes": [
    {
      "id": "44925c0f-1972-42f2-9a37-b5e00f6d9917",
      "name": "📘 Guide",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -640,
        -120
      ],
      "parameters": {
        "content": "## 03 · Content Marketing · Brand Kit Compliance Enforcer\n\n### What this does\nValidates copy against banned phrases, tone, and claim rules before allowing publish.\n\n### Setup checklist\n1. Edit brand rules in Code node\n2. Connect upstream content workflows\n3. Slack alert on violations\n\n### How to test locally\nPOST `content-brand-check` with `{ \"copy\":\"...\" }`\n\n### Tips\n- Keep credentials in n8n Credentials (never hardcode secrets).\n- Use **Test URL** on the Webhook while developing.\n- Activate only after credentials + destinations are configured.\n",
        "width": 560,
        "height": 560,
        "color": 4
      }
    },
    {
      "id": "b7739e5e-b471-4989-8fc0-8308b814e689",
      "name": "⚙️ Config",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -640,
        480
      ],
      "parameters": {
        "content": "## Config map\n\n- **Webhook path:** `content-brand-check`\n- **Replace** all `https://httpbin.org/...` calls with real integrations.\n- **Credentials:** create in n8n → Credentials, then select on HTTP nodes.\n- **Activate** workflow only after a successful Test execution.\n\n### Local files\nShared host folder is mounted at `/files` inside n8n.",
        "width": 560,
        "height": 320,
        "color": 2
      }
    },
    {
      "id": "a594dc76-3c35-44b7-8b75-4769d16138d1",
      "name": "Intake Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        200
      ],
      "webhookId": "36a5382e-22b9-406d-91ff-efed8fdea1f5",
      "parameters": {
        "httpMethod": "POST",
        "path": "content-brand-check",
        "responseMode": "responseNode",
        "options": {}
      }
    },
    {
      "id": "cb283246-79a1-4249-a080-e24cd679b8ba",
      "name": "Validate & Risk Score",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        280,
        200
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "language": "javaScript",
        "jsCode": "const body = $input.first().json.body || $input.first().json;\nconst risk = Number(body.riskScore ?? (String(body.caption||body.copy||'').match(/guarantee|free money|urgent/i) ? 80 : 20));\nconst approved = risk < 60 || body.token === 'APPROVE' || body.autoApprove === true;\nreturn [{ json: { ...body, risk, approved, decision: approved ? 'pass' : 'hold' } }];"
      }
    },
    {
      "id": "ffef9caf-8be9-4de0-8a27-55d1bd349840",
      "name": "Approved?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        560,
        200
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "3a8733a1-6ba9-45f1-a8ba-0bf5460148fd",
              "leftValue": "={{ $json.approved }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "1cde6ed6-ba1e-43ee-82d2-56422f0f497b",
      "name": "Execute Action",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        840,
        80
      ],
      "parameters": {
        "method": "POST",
        "url": "https://httpbin.org/post",
        "options": {},
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}"
      }
    },
    {
      "id": "49e96423-43e0-4737-b312-bc678c8549d6",
      "name": "Hold for Review",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        840,
        320
      ],
      "parameters": {
        "mode": "manual",
        "duplicateItem": false,
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "status",
              "value": "pending_approval",
              "type": "string"
            },
            {
              "id": "2",
              "name": "next",
              "value": "Send APPROVE token to resume / approve path",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "ebd0e6cf-9cb5-4191-8f7a-fe566651d279",
      "name": "Webhook Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1120,
        200
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {}
      }
    }
  ],
  "connections": {
    "Intake Webhook": {
      "main": [
        [
          {
            "node": "Validate & Risk Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate & Risk Score": {
      "main": [
        [
          {
            "node": "Approved?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approved?": {
      "main": [
        [
          {
            "node": "Execute Action",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Hold for Review",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Action": {
      "main": [
        [
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hold for Review": {
      "main": [
        [
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "callerPolicy": "workflowsFromSameOwner"
  },
  "tags": [],
  "meta": {
    "templateCredsSetupCompleted": true,
    "description": "Validates copy against banned phrases, tone, and claim rules before allowing publish."
  },
  "pinData": {}
}