{
  "name": "Vorlux AI | A/B Thumbnail Testing",
  "nodes": [
    {
      "id": "98360f73-7de5-47be-8f4e-124275906e71",
      "name": "Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        220,
        300
      ],
      "webhookId": "219419ed-fc18-485f-a8bd-ecc2d5c70fec",
      "parameters": {
        "httpMethod": "POST",
        "path": "ab-thumbnails",
        "options": {
          "responseMode": "lastNode"
        }
      }
    },
    {
      "id": "aa594129-9213-4eb5-b2bc-695ddbdc0fde",
      "name": "Generate Variants",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const d=$input.first().json.body||$input.first().json;const title=d.title||'';const styles=[{name:'Bold Gaming',prompt:title+', bold neon text, dark background, gaming aesthetic, 1280x720'},{name:'Clean Minimal',prompt:title+', clean minimalist design, white space, modern typography, 1280x720'},{name:'Dramatic',prompt:title+', dramatic lighting, cinematic, high contrast, person looking at camera, 1280x720'},{name:'Tech Blueprint',prompt:title+', blueprint style, technical diagram, cyan on dark, circuit patterns, 1280x720'}];return [{json:{title,styles,postId:d.postId||''}}];"
      },
      "notes": "Creates 4 different thumbnail style prompts for A/B testing"
    },
    {
      "id": "2cc5dc48-a3e6-4cef-9d4d-491107144f7a",
      "name": "Generate All",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        300
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.VORLUX_HUB_URL}}/api/comfyui",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"workflowId\":\"batch\",\"inputs\":{\"positive_prompt\":\"{{ $json.styles[0].prompt }}\"}}",
        "options": {
          "timeout": 120000
        }
      },
      "notes": "Generates 4 thumbnail variants via ComfyUI batch workflow"
    },
    {
      "id": "afc0ba5c-0921-4796-a5f4-10db89e44831",
      "name": "Save Variants",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        940,
        200
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.VORLUX_HUB_URL}}/api/content/thumbnails/ab-test",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"postId\":\"{{ $json.postId }}\",\"variants\":{{ JSON.stringify($json.styles.map((s,i) => ({name: s.name, prompt: s.prompt, index: i}))) }}}",
        "options": {
          "timeout": 15000
        }
      }
    },
    {
      "id": "abc3fbf3-b5f7-4b29-b293-1927ce788230",
      "name": "Notify",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        940,
        400
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.DISCORD_CONTENT_WEBHOOK}}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"embeds\":[{\"title\":\"\ud83c\udfa8 4 Thumbnail Variants Generated\",\"description\":\"{{ $json.styles.map(s => \"\u2022 \" + s.name).join(\"\\n\") }}\",\"color\":16753920}]}",
        "options": {
          "timeout": 10000
        }
      }
    },
    {
      "id": "43920977-13af-4482-ac7b-9ae63025fa12",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1180,
        300
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({variants: 4}) }}"
      }
    }
  ],
  "connections": {
    "Trigger": {
      "main": [
        [
          {
            "node": "Generate Variants",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Variants": {
      "main": [
        [
          {
            "node": "Generate All",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate All": {
      "main": [
        [
          {
            "node": "Save Variants",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Variants": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveExecutionProgress": true
  }
}