{
  "name": "Summarize YouTube videos & chat about content with GPT-4o-mini via Telegram",
  "nodes": [
    {
      "id": "a9cb4358-f9ec-4d81-9422-f1b7133f1f2a",
      "name": "Split Transcript into Segments",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        800,
        680
      ]
    },
    {
      "id": "03650773-fd85-4ecb-a218-0d18e2f88e68",
      "name": "Extract YouTube URL from Input",
      "type": "n8n-nodes-base.set",
      "position": [
        580,
        220
      ]
    },
    {
      "id": "9b55683c-6b04-44e6-8af2-ef69a50e783a",
      "name": "Extract Video ID from URL",
      "type": "n8n-nodes-base.code",
      "position": [
        580,
        460
      ]
    },
    {
      "id": "8552bb5d-c857-4a4e-b97b-7482b5e97244",
      "name": "gpt-4o-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1280,
        960
      ]
    },
    {
      "id": "5cea6925-cbf7-47a4-9a26-45f42f91c074",
      "name": "Generate Summary with GPT-4o-mini",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1260,
        760
      ]
    },
    {
      "id": "cba394e4-3ae3-4506-a1d9-7b8ffbdf5d93",
      "name": "Concatenate Transcript Segments",
      "type": "n8n-nodes-base.summarize",
      "position": [
        1000,
        680
      ]
    },
    {
      "id": "c4b266bd-ab23-4823-8f2c-f12704bad58f",
      "name": "Trigger on Telegram Message",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        360,
        100
      ]
    },
    {
      "id": "57f22922-29fd-402e-b5c3-79cb133209cd",
      "name": "Extract YouTube Transcript",
      "type": "n8n-nodes-youtube-transcription-kasha.youtubeTranscripter",
      "position": [
        580,
        680
      ]
    },
    {
      "id": "196453ad-8a63-4fbc-9dc3-37a1ee611857",
      "name": "Send Summary via Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1660,
        760
      ]
    },
    {
      "id": "7754143b-9449-427c-9e04-e91434c4bc74",
      "name": "Receive YouTube URL via Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        360,
        320
      ]
    },
    {
      "id": "e9aaec56-2458-49a4-989e-eb4af03441b9",
      "name": "Send Response to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1860,
        760
      ]
    },
    {
      "id": "bac178f2-be91-4f28-a024-d7dbef11c442",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        240,
        1040
      ]
    },
    {
      "id": "128b8e7a-9b56-4d98-a270-9f627f188b8b",
      "name": "Retrieve Transcript from Google Docs",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1280,
        520
      ]
    },
    {
      "id": "d4377188-fac7-4d48-8ef4-747f9dd39cf0",
      "name": "Update Transcript in Google Docs",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1480,
        520
      ]
    },
    {
      "id": "25504013-f1e0-4556-a318-dbc482bde4fa",
      "name": "Handle User Questions via AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        440,
        1040
      ]
    },
    {
      "id": "562ce57d-600e-4bb2-a5a2-e6d005f840bd",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        380,
        1220
      ]
    },
    {
      "id": "39ba9c74-a5c1-455e-b51b-9d36bce76635",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        540,
        1260
      ]
    },
    {
      "id": "1983dc09-f74f-4863-8b2c-9069bc6d64d9",
      "name": "Google Docs2",
      "type": "n8n-nodes-base.googleDocsTool",
      "position": [
        660,
        1280
      ]
    },
    {
      "id": "4dfcba99-98e5-49e4-b8bd-31fb841a0985",
      "name": "Send AI Response via Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        840,
        1040
      ]
    },
    {
      "id": "29c22c9f-cca2-459f-8ef0-577c6e1ddd93",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 540,
        "height": 500,
        "content": "## Get a video URL\nGet video url via webhook or message\n\nFor this I recommend using a shortcut \nif you are using apple. \nThis allows you to share a video\ndirectly to n8n via webhook\n"
      }
    },
    {
      "id": "7a987035-42cc-4b52-b4e3-f75194173a58",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        360
      ],
      "parameters": {
        "width": 540,
        "height": 360,
        "content": "## Load memory \nUploading the transcript about the memory in google docs so you can then ask questions about the film"
      }
    },
    {
      "id": "2c7446b3-d7bf-4d0c-9b07-87e6ffaea0da",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        900
      ],
      "parameters": {
        "width": 1020,
        "height": 600,
        "content": "## Ask AI about video"
      }
    }
  ],
  "connections": {
    "gpt-4o-mini": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Summary with GPT-4o-mini",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Docs2": {
      "ai_tool": [
        [
          {
            "node": "Handle User Questions via AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Handle User Questions via AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Handle User Questions via AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract Video ID from URL": {
      "main": [
        [
          {
            "node": "Extract YouTube Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Summary via Telegram": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract YouTube Transcript": {
      "main": [
        [
          {
            "node": "Split Transcript into Segments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger on Telegram Message": {
      "main": [
        [
          {
            "node": "Extract YouTube URL from Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle User Questions via AI": {
      "main": [
        [
          {
            "node": "Send AI Response via Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract YouTube URL from Input": {
      "main": [
        [
          {
            "node": "Extract Video ID from URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Transcript into Segments": {
      "main": [
        [
          {
            "node": "Concatenate Transcript Segments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Concatenate Transcript Segments": {
      "main": [
        [
          {
            "node": "Generate Summary with GPT-4o-mini",
            "type": "main",
            "index": 0
          },
          {
            "node": "Retrieve Transcript from Google Docs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive YouTube URL via Webhook": {
      "main": [
        [
          {
            "node": "Extract YouTube URL from Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Summary with GPT-4o-mini": {
      "main": [
        [
          {
            "node": "Send Summary via Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Transcript from Google Docs": {
      "main": [
        [
          {
            "node": "Update Transcript in Google Docs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}