{
  "name": "AEvent Chat Bridge",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "aevent-chat",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "b1a1e001-0001-4a01-9001-aevent0000001",
      "name": "AEvent Chat Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        260,
        300
      ],
      "webhookId": "aevent-chat-bridge"
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "reply",
              "value": "=Thanks for your message, {{ $json[\"body\"][\"name\"] || \"there\" }}. Someone will help shortly."
            }
          ]
        },
        "options": {}
      },
      "id": "b1a1e002-0002-4a02-9002-aevent0000002",
      "name": "Decide your reply",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        520,
        300
      ],
      "notes": "This is where you plug in your AI or agent logic. Read the incoming chat message from the webhook body and produce a reply string. By default this simply echoes a canned reply. Replace this node with an OpenAI, Claude, or HTTP Request call to your own agent if you want smarter replies."
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://app-api.aevent.com/api/messages",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_CHAT_WRITE_TOKEN"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ message: $json[\"reply\"], webinarID: $node[\"AEvent Chat Webhook\"].json[\"body\"][\"webinarID\"], email: $node[\"AEvent Chat Webhook\"].json[\"body\"][\"email\"] }) }}",
        "options": {}
      },
      "id": "b1a1e003-0003-4a03-9003-aevent0000003",
      "name": "Post to AEvent Chat",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        780,
        300
      ]
    }
  ],
  "connections": {
    "AEvent Chat Webhook": {
      "main": [
        [
          {
            "node": "Decide your reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decide your reply": {
      "main": [
        [
          {
            "node": "Post to AEvent Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "pinData": {}
}
