{
  "name": "01 · Social Media / UGC Rights & Approval Gate",
  "active": false,
  "nodes": [
    {
      "id": "eee61f7b-056a-461e-9996-17808b951d4f",
      "name": "📘 Guide",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -640,
        -120
      ],
      "parameters": {
        "content": "## 01 · Social Media · UGC Rights & Approval Gate\n\n### What this does\nWebhook intake for UGC submissions, stores metadata, runs brand-safety checks, and only publishes after an approval token is confirmed.\n\n### Setup checklist\n1. Point storage HTTP to S3/Drive\n2. Set approval secret in Set node\n3. Wire publish HTTP to your social publisher workflow\n\n### How to test locally\nPOST `social-ugc-submit` then POST `social-ugc-approve` with `{ \"id\":\"...\", \"token\":\"APPROVE\" }`\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": 5
      }
    },
    {
      "id": "0831f262-7021-49eb-b805-1c09641b3d31",
      "name": "⚙️ Config",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -640,
        480
      ],
      "parameters": {
        "content": "## Config map\n\n- **Webhook path:** `social-ugc-submit`\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": "9e10f805-5979-42c7-ba41-71045f066e94",
      "name": "Intake Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        200
      ],
      "webhookId": "431aa3d9-f2a8-4487-9c6e-650b5ab2f724",
      "parameters": {
        "httpMethod": "POST",
        "path": "social-ugc-submit",
        "responseMode": "responseNode",
        "options": {}
      }
    },
    {
      "id": "1185bf57-701f-47e5-b011-ca6b6e1106d4",
      "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": "84a8be08-52a6-4dba-854a-0a27c02c89c9",
      "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": "3d824657-a10d-490d-a62c-987b481101de",
              "leftValue": "={{ $json.approved }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "1c8434fc-fc06-40af-9094-6fa0941f2c49",
      "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": "c4bdb7e9-da99-45ad-8f3e-04017dcad132",
      "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": "a4292a91-5563-402c-b3d7-5e52e5f069f2",
      "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": "Webhook intake for UGC submissions, stores metadata, runs brand-safety checks, and only publishes after an approval token is confirmed."
  },
  "pinData": {}
}