{
  "nodes": [
    {
      "id": "790192b0-2b9d-4de3-aece-3e69f3668d50",
      "name": "Zoom Meeting Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        192
      ],
      "parameters": {
        "path": "zoom-meeting-ended",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "f0a94562-577d-4b73-a431-7baaffa5bbe1",
      "name": "Normalize Participants",
      "type": "n8n-nodes-base.code",
      "position": [
        240,
        192
      ],
      "parameters": {
        "jsCode": "// Extract participants + meeting details\nconst e = $input.first().json;\nconst participants = e.payload.object.participants || [];\n\nreturn participants.map(p => ({\n  json: {\n    meeting_id: e.payload.object.id,\n    topic: e.payload.object.topic,\n    host: e.payload.object.host_email,\n    participant_name: p.user_name,\n    participant_email: p.user_email,\n    transcript: e.payload.object.transcript || '',\n    timestamp: new Date().toISOString()\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "bb4b407f-ddd1-4e6c-ab3c-18fdbc4454f4",
      "name": "Generate Follow-Up Email",
      "type": "n8n-nodes-base.openAi",
      "position": [
        480,
        192
      ],
      "parameters": {
        "resource": "chat",
        "operation": "create",
        "requestOptions": {}
      },
      "typeVersion": 1
    },
    {
      "id": "129fc5cd-fb37-4624-a1eb-0efd0ca1f754",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        720,
        192
      ],
      "parameters": {
        "subject": "Follow-Up: {{ $('Normalize Participants').item.json.topic }}",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "60bbb546-9faa-48b1-baec-48bbfbe5f2e2",
      "name": "Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "height": 464,
        "content": "## \ud83d\udee0\ufe0f Setup Steps\n### 1. Zoom App\n- Enable **`meeting.ended`** event.  \n- Include participant email/name in webhook payload.  \n- Paste workflow webhook URL.\n\n### 2. Gmail\n- Connect Gmail OAuth in n8n.  \n- Emails are sent automatically per participant.\n\n### 3. OpenAI\n- Add your OpenAI API key.  \n- Uses **GPT-4** for personalized drafting.\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Zoom Meeting Webhook": {
      "main": [
        [
          {
            "node": "Normalize Participants",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Participants": {
      "main": [
        [
          {
            "node": "Generate Follow-Up Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Follow-Up Email": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}