{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "d3ccf483-864c-42da-98a2-81d0d42d3b0e",
      "name": "Add bot to meet",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -240,
        -512
      ],
      "parameters": {
        "url": "https://gateway.dev.vexa.ai/bots",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "platform",
              "value": "google_meet"
            },
            {
              "name": "native_meeting_id",
              "value": "={{ $json.conferenceData.conferenceId }}"
            },
            {
              "name": "bot_name",
              "value": "MyMeetingBot"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4ec42f69-06d3-451b-bdce-a929a39bc8bf",
      "name": "Google Calendar Trigger",
      "type": "n8n-nodes-base.googleCalendarTrigger",
      "position": [
        -544,
        -512
      ],
      "parameters": {
        "options": {
          "matchTerm": ""
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "eventStarted",
        "calendarId": {
          "__rl": true,
          "mode": "id",
          "value": "='primary'"
        }
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7d4de5a4-7aef-4447-88b3-7f32677b6395",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        1456,
        -560
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#general"
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "03516d84-dea0-429f-b0d0-00dbb5099a94",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1056,
        -560
      ],
      "parameters": {
        "text": "=# Fast Meeting Summary Prompt\n\nAnalyze this meeting transcription and create a brief Slack summary. Keep it under 800 characters total.\n\n**Meeting Transcript:**\n{{ $json.fullTranscript }}\n\n**Meeting Details:**\n- Duration: {{ $json.durationMinutes }} minutes\n- Participants: {{ $json.participants }}\n\n**Format (be extremely concise):**\n\n## \ud83d\udccb Meeting Summary\n**Duration:** [Start-End time]\n**Participants:** [Names only]\n\n**\ud83c\udfaf Key Points:**\n- [Main topic 1]\n- [Main topic 2]\n\n**\ud83d\udcdd Action Items:**\n- [Task - Person - Deadline]\n\n**\ud83d\udca1 Outcome:**\n[One sentence summary of result/decision]\n\nKeep each bullet point under 50 characters. Focus only on actionable information and key decisions.",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "d40e6fbf-8bf5-4ae3-bf50-969ce96f1b23",
      "name": "Get Vexa Transcript",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        304,
        -560
      ],
      "parameters": {
        "url": "=https://gateway.dev.vexa.ai/transcripts/google_meet/{{ $json.native_meeting_id }}",
        "options": {
          "timeout": 30000
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "62f19410-e908-4523-a8d5-e5af789982c2",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        768,
        -432
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "9208ae18-6bba-441a-95e5-3d13c44de206",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        512,
        -560
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "40ee5a62-d7e4-4f2e-9f41-e073dd09e575",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{$json.status}}",
              "rightValue": "completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "310ee3cb-5387-4bd7-88d5-aa7f233cee48",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1056,
        -352
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "67cced29-b716-4ea6-a41d-9bab723332d4",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        848,
        -560
      ],
      "parameters": {
        "jsCode": "// Get the input data\nconst inputData = $input.all()[0].json; // Get the first item which contains the meeting data\n\n// Extract segments from the nested structure\nconst segments = inputData.segments || [];\n\nif (!segments || segments.length === 0) {\n  return [{\n    json: {\n      fullTranscript: \"No transcript data available\",\n      participants: \"None\",\n      durationSeconds: 0,\n      durationMinutes: 0\n    }\n  }];\n}\n\n// Combine into a single readable transcript\nconst transcript = segments\n  .map(segment => {\n    const speaker = segment.speaker || 'Unknown';\n    const text = segment.text || '';\n    const time = Math.round(segment.start || 0);\n    return `[${time}s] ${speaker}: ${text}`;\n  })\n  .join('\\n');\n\n// Get unique participants\nconst participants = [...new Set(\n  segments\n    .map(segment => segment.speaker)\n    .filter(speaker => speaker && speaker !== null)\n)];\n\n// Calculate duration\nconst startTime = segments[0]?.start || 0;\nconst endTime = segments[segments.length - 1]?.end || 0;\nconst duration = Math.round(endTime - startTime);\n\n// Get meeting info from the root level\nconst meetingId = inputData.native_meeting_id || 'Unknown';\nconst platform = inputData.platform || 'Unknown';\nconst status = inputData.status || 'Unknown';\n\nreturn [{\n  json: {\n    fullTranscript: transcript,\n    participants: participants.join(', ') || 'Unknown',\n    durationSeconds: duration,\n    durationMinutes: Math.round(duration / 60),\n    meetingId: meetingId,\n    platform: platform,\n    status: status,\n    totalSegments: segments.length\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "de13ece0-8fb4-489b-b2d7-cf0f0b14114b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        -960
      ],
      "parameters": {
        "color": 3,
        "height": 544,
        "content": "## \ud83d\udccb Prerequisites & Requirements\n\n**Required Accounts:**\n- Google Calendar API access (free)\n- Vexa.ai account with API key\n- OpenAI API account with credits\n- Slack workspace admin access\n\n**Required Permissions:**\n- Google Calendar: Read calendar events\n- Slack: Post messages to channels\n- Vexa.ai: Create bots and access transcripts\n\n**Estimated Setup Time:** 15-20 minutes\n**Cost:** ~$0.01-0.05 per meeting (OpenAI costs)"
      },
      "typeVersion": 1
    },
    {
      "id": "1ed15b13-de3b-4cb1-a231-1dbcd32d6823",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -960
      ],
      "parameters": {
        "width": 304,
        "height": 672,
        "content": "## \ud83d\uddd3\ufe0f Google Calendar Setup\n\n**Steps:**\n1. Go to Google Cloud Console\n2. Enable Calendar API\n3. Create credentials (OAuth2)\n4. Add credentials to n8n\n5. Test connection\n\n**Configuration:**\n- Select your target calendar from list\n- Set trigger to 'eventStarted'\n- Ensure calendar has Meet links\n\n**\u26a0\ufe0f Important:** Only works with Google Meet links in calendar events"
      },
      "typeVersion": 1
    },
    {
      "id": "a7dbe268-d020-47c9-993e-9a53c1249043",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -960
      ],
      "parameters": {
        "width": 752,
        "height": 672,
        "content": "## \ud83e\udd16 Vexa.ai Setup\n\n**Get API Key:**\n1. Sign up at vexa.ai\n2. Navigate to API settings\n3. Generate new API key\n4. Add to n8n credentials\n\n**Bot Configuration:**\n- Platform: 'google_meet'\n- Bot name: Customize as needed\n- Meeting ID: Auto-extracted from calendar\n\n**Rate Limits:**\n- 100 requests/hour on free tier\n- Bot joins 30-60 seconds after meeting starts"
      },
      "typeVersion": 1
    },
    {
      "id": "09d0a663-c758-4c80-b5bf-19d6d3228816",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -960
      ],
      "parameters": {
        "width": 896,
        "height": 736,
        "content": "## \ud83e\udde0 OpenAI + Slack Setup\n\n**OpenAI Configuration:**\n- Model: chatgpt-4o-latest (recommended)\n- Cost: ~$0.01-0.05 per summary\n- Add API key to n8n credentials\n\n**Slack Bot Setup:**\n1. Create Slack app in workspace\n2. Add bot token scopes: chat:write\n3. Install app to workspace\n4. Add bot to target channel\n5. Copy bot token to n8n\n\n**Channel Format:** Use channel name or ID"
      },
      "typeVersion": 1
    },
    {
      "id": "6ff6c940-ada7-4743-a249-6a211c3b9288",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        -960
      ],
      "parameters": {
        "color": 3,
        "height": 896,
        "content": "## \ud83d\udd11 Credential Setup Guide\n\n**Before using this workflow:**\n\n**1. Google Calendar OAuth2:**\n- Go to Google Cloud Console\n- Enable Calendar API\n- Create OAuth2 credentials\n- Add to n8n: Google Calendar OAuth2 API\n\n**2. Vexa.ai API (HTTP Header Auth):**\n- Sign up at vexa.ai\n- Get API key from dashboard  \n- Create HTTP Header Auth credential\n- Header name: 'X-API-Key'\n- Header value: Your API key\n\n**3. OpenAI API:**\n- Get API key from OpenAI platform\n- Add to n8n: OpenAI API credential\n- Ensure account has sufficient credits\n\n**4. Slack Bot Token:**\n- Create Slack app in your workspace\n- Add bot token scopes: chat:write, channels:read\n- Install app to workspace\n- Add bot to target channel\n- Copy bot token to n8n: Slack API credential\n\n**\u26a0\ufe0f Test each credential** before running the full workflow!"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Vexa Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        []
      ]
    },
    "Add bot to meet": {
      "main": [
        [
          {
            "node": "Get Vexa Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Vexa Transcript": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar Trigger": {
      "main": [
        [
          {
            "node": "Add bot to meet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}