{
  "name": "Vorlux AI | Discord Event Announcer",
  "active": false,
  "nodes": [
    {
      "parameters": { "httpMethod": "POST", "path": "discord-event-announce", "options": { "responseMode": "lastNode" } },
      "id": "webhook-trigger", "name": "Event Webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 2, "position": [220, 300]
    },
    {
      "parameters": { "mode": "runOnceForAllItems", "jsCode": "const data = $input.first().json.body || $input.first().json;\nconst event = { title: data.title || 'Event', description: data.description || '', startTime: data.startTime, location: data.location || 'Discord', imageUrl: data.imageUrl || null };\nconst embed = { embeds: [{ title: '📅 ' + event.title, description: event.description + '\\n\\n📍 ' + event.location, color: 5793266, footer: { text: 'Vorlux AI HUB Events' } }] };\nreturn [{ json: { event, embed } }];" },
      "id": "build", "name": "Build Announcement", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [460, 300]
    },
    {
      "parameters": { "url": "http://host.docker.internal:3010/api/discord/events", "method": "POST", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify($json.event) }}", "options": { "timeout": 15000 } },
      "id": "create-event", "name": "Create Discord Event", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [700, 200]
    },
    {
      "parameters": { "url": "http://host.docker.internal:3010/api/discord/webhooks/send", "method": "POST", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ channel: 'announcements', payload: $json.embed }) }}", "options": { "timeout": 15000 } },
      "id": "post-announce", "name": "Post Announcement", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [700, 400]
    },
    {
      "parameters": { "mode": "runOnceForAllItems", "jsCode": "return [{ json: { success: true, event: $('Build Announcement').first().json.event.title } }];" },
      "id": "response", "name": "Response", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [960, 300]
    }
  ],
  "connections": {
    "Event Webhook": { "main": [[{ "node": "Build Announcement", "type": "main", "index": 0 }]] },
    "Build Announcement": { "main": [[{ "node": "Create Discord Event", "type": "main", "index": 0 }, { "node": "Post Announcement", "type": "main", "index": 0 }]] },
    "Create Discord Event": { "main": [[{ "node": "Response", "type": "main", "index": 0 }]] },
    "Post Announcement": { "main": [[{ "node": "Response", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" }
}
