{
  "name": "Vorlux AI | Image \u2192 Social Content Generator",
  "nodes": [
    {
      "id": "ea862334-21d9-4183-9fc0-660763cda685",
      "name": "Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        220,
        300
      ],
      "webhookId": "3cb492fa-8de0-429e-b47b-b9ed9dac50b5",
      "parameters": {
        "httpMethod": "POST",
        "path": "image-social",
        "options": {
          "responseMode": "lastNode"
        }
      }
    },
    {
      "id": "940779d9-07df-4f0c-9c26-d9de9f7b3cee",
      "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;\nconst title = d.title || 'New Content';\nconst basePrompt = d.prompt || title + ', professional, modern design';\nconst variants = [\n  {name: 'Instagram Square', prompt: basePrompt + ', 1080x1080, social media post, clean layout', width: 1080, height: 1080},\n  {name: 'Instagram Story', prompt: basePrompt + ', 1080x1920, vertical, story format, bold text', width: 1080, height: 1920},\n  {name: 'Twitter Banner', prompt: basePrompt + ', 1500x500, wide banner, minimal text', width: 1500, height: 500},\n  {name: 'YouTube Thumbnail', prompt: basePrompt + ', 1280x720, bold text, neon accents, dark', width: 1280, height: 720}\n];\nreturn [{json: {title, variants, count: variants.length}}];"
      },
      "notes": "Creates prompts for 4 platform-specific image dimensions"
    },
    {
      "id": "920bb78b-2749-4f25-9ec6-8fb0e05e7a69",
      "name": "Generate Images",
      "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\":\"thumbnail\",\"inputs\":{\"positive_prompt\":\"{{ $json.variants[0].prompt }}\",\"width\":{{ $json.variants[0].width }},\"height\":{{ $json.variants[0].height }}}}",
        "options": {
          "timeout": 120000
        }
      },
      "notes": "Generates images via ComfyUI for each platform size"
    },
    {
      "id": "a83bf996-b953-4d5f-ab4c-f1357cbf337a",
      "name": "Save Assets",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        940,
        200
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.VORLUX_HUB_URL}}/api/content/library",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({title: $json.title, type: \"social_images\", variants: $json.variants}) }}",
        "options": {
          "timeout": 15000
        }
      }
    },
    {
      "id": "ca289c99-0bd6-4516-96f0-d34a5bd8de43",
      "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 {{ $json.count }} Social Images Generated\",\"description\":\"{{ $json.variants.map(v => \"\u2022 \" + v.name + \" (\" + v.width + \"x\" + v.height + \")\").join(\"\\\\n\") }}\",\"color\":16753920}]}",
        "options": {
          "timeout": 10000
        }
      }
    },
    {
      "id": "0c99f136-1e99-4734-98a1-7fec5d6127f1",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1180,
        300
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({generated: $json.count}) }}"
      }
    }
  ],
  "connections": {
    "Trigger": {
      "main": [
        [
          {
            "node": "Generate Variants",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Variants": {
      "main": [
        [
          {
            "node": "Generate Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Images": {
      "main": [
        [
          {
            "node": "Save Assets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Assets": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveExecutionProgress": true
  }
}