{
  "name": "ZamZora PRO \u2014 CORE (safe)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "zamzora/run",
        "responseMode": "lastNode",
        "responseData": "allEntries"
      },
      "id": "1",
      "name": "Webhook Start",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "const runId=new Date().toISOString().slice(0,10)+'-'+Math.random().toString(36).slice(2,8);const j=items[0].json||{};j.run_id=runId;j.variant_count=j.variant_count||2;j.theme_pool=j.theme_pool||['The illusion of progress','Discipline over motivation','The cost of comfort','The weight of wasted time','Why you feel stuck'];return [{json:j}];"
      },
      "id": "2",
      "name": "Fn Init",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        520,
        300
      ]
    },
    {
      "parameters": {
        "property": "series",
        "rules": {
          "values": [
            {
              "operation": "isEmpty"
            }
          ]
        }
      },
      "id": "3",
      "name": "Switch Theme",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 1,
      "position": [
        760,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "const j=items[0].json;const p=Array.isArray(j.theme_pool)?j.theme_pool:[];j.series=p[Math.floor(Math.random()*p.length)]||'Discipline over motivation';return [{json:j}];"
      },
      "id": "4",
      "name": "Fn Pick Theme",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        980,
        380
      ]
    },
    {
      "parameters": {
        "url": "https://example.invalid/trends"
      },
      "id": "5",
      "name": "HTTP Trends",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        980,
        200
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "chat",
        "model": "gpt-5",
        "messages": [
          {
            "role": "system",
            "content": "You are a concise, concrete briefing generator."
          },
          {
            "role": "user",
            "content": "Theme: {{$json.series}}; Trends: {{JSON.stringify($json[\\\"HTTP Trends\\\"]||{})}}; Return JSON."
          }
        ]
      },
      "id": "6",
      "name": "OpenAI Brief",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        1200,
        300
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "chat",
        "model": "gpt-5",
        "messages": [
          {
            "role": "system",
            "content": "Write 4 hooks (<=12 words, <=3s). JSON array."
          },
          {
            "role": "user",
            "content": "Theme: {{$json.series}}; Brief: {{JSON.stringify($json[\\\"OpenAI Brief\\\"])}}."
          }
        ]
      },
      "id": "7",
      "name": "OpenAI Hooks",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        1420,
        300
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "chat",
        "model": "gpt-5",
        "messages": [
          {
            "role": "system",
            "content": "Script 80-90s. End with `Zam Zora says: ...`."
          },
          {
            "role": "user",
            "content": "Use best hook from hooks; Theme: {{$json.series}}."
          }
        ]
      },
      "id": "8",
      "name": "OpenAI Script A",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        1640,
        220
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "chat",
        "model": "gpt-5",
        "messages": [
          {
            "role": "system",
            "content": "Variation 80-90s."
          },
          {
            "role": "user",
            "content": "Theme: {{$json.series}}."
          }
        ]
      },
      "id": "9",
      "name": "OpenAI Script B",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        1640,
        380
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "chat",
        "model": "gpt-5",
        "messages": [
          {
            "role": "system",
            "content": "10-scene 9:16 storyboard. Return JSON array."
          },
          {
            "role": "user",
            "content": "Use Script A."
          }
        ]
      },
      "id": "10",
      "name": "OpenAI Storyboard",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        1860,
        300
      ]
    }
  ],
  "connections": {
    "1": {
      "main": [
        {
          "node": "2",
          "type": "main",
          "index": 0
        }
      ]
    },
    "2": {
      "main": [
        {
          "node": "3",
          "type": "main",
          "index": 0
        }
      ]
    },
    "3": {
      "main": [
        {
          "node": "4",
          "type": "main",
          "index": 0
        },
        {
          "node": "5",
          "type": "main",
          "index": 0
        }
      ]
    },
    "4": {
      "main": [
        {
          "node": "6",
          "type": "main",
          "index": 0
        }
      ]
    },
    "5": {
      "main": [
        {
          "node": "6",
          "type": "main",
          "index": 0
        }
      ]
    },
    "6": {
      "main": [
        {
          "node": "7",
          "type": "main",
          "index": 0
        }
      ]
    },
    "7": {
      "main": [
        {
          "node": "8",
          "type": "main",
          "index": 0
        },
        {
          "node": "9",
          "type": "main",
          "index": 0
        }
      ]
    },
    "8": {
      "main": [
        {
          "node": "10",
          "type": "main",
          "index": 0
        }
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "Europe/Berlin"
  },
  "active": false
}