{
  "name": "Vorlux AI | Social Media Pipeline (with Images)",
  "nodes": [
    {
      "id": "35c93e3c-62f7-4f2c-85db-113694153418",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        220,
        300
      ],
      "webhookId": "337779fc-e161-4365-a5f9-de8eda6d4c2e",
      "parameters": {
        "httpMethod": "POST",
        "path": "social-distribute",
        "options": {
          "responseMode": "lastNode"
        }
      }
    },
    {
      "id": "0b442188-2f95-4153-b8cc-3dc89c22c14c",
      "name": "Generate Posts",
      "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 || '';\nconst url = d.url || '';\nconst excerpt = (d.excerpt || '').substring(0, 200);\nreturn [{json: {\n  tweet: title + '\\n\\n' + excerpt + '\\n\\n' + url + '\\n\\n#Vorlux AI #Tech',\n  discord: {embeds: [{title, description: excerpt, url, color: 5793266}]},\n  linkedin: 'New article: ' + title + '\\n\\n' + excerpt + '\\nRead more: ' + url,\n  url, title\n}}];"
      }
    },
    {
      "id": "258dbcad-1a42-475d-b792-94821202f255",
      "name": "Execute",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        200
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.VORLUX_HUB_URL}}/api/orchestrator/execute",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"action\":\"social_media_pipeline\",\"params\":{{ JSON.stringify($json) }}}",
        "options": {
          "timeout": 60000
        }
      }
    },
    {
      "id": "92dd6388-c2bc-44d8-ac78-82a1ad998be1",
      "name": "Notify",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        400
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.DISCORD_OPS_WEBHOOK}}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"embeds\":[{\"title\":\"Social Media Pipeline\",\"color\":5793266}]}",
        "options": {
          "timeout": 10000
        }
      }
    },
    {
      "id": "bb30c6b4-6c0e-434e-be12-693e124777c2",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        940,
        300
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ok:true}) }}"
      }
    },
    {
      "id": "21b5c0e9-75b4-48e1-bccd-6fceeeb529c8",
      "name": "Generate Image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        500
      ],
      "notes": "Generates social media image via ComfyUI",
      "parameters": {
        "method": "POST",
        "url": "={{$env.VORLUX_HUB_URL}}/api/comfyui",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"workflowId\":\"thumbnail\",\"inputs\":{\"positive_prompt\":\"Social media graphic, modern, bold, 1080x1080\"}}",
        "options": {
          "timeout": 120000
        }
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Generate Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Posts": {
      "main": [
        [
          {
            "node": "Execute",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveExecutionProgress": true
  }
}