{
  "name": "YouTube Video Summarizer",
  "nodes": [
    {
      "parameters": {
        "url": "https://www.youtube.com/feeds/videos.xml?channel_id=UCv_s0kVd33fS2JcZ_eT-v-g"
      },
      "name": "New Video in Channel",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        450,
        300
      ],
      "notes": "Triggers when a new video is posted to a YouTube channel via its RSS feed. **ACTION REQUIRED:** Replace the channel_id in the URL with the ID of the channel you want to follow."
    },
    {
      "parameters": {
        "videoIdOrUrl": "={{ $json.link }}"
      },
      "name": "Get Transcript",
      "type": "n8n-nodes-youtube-transcript.youtubeTranscript",
      "typeVersion": 1,
      "position": [
        650,
        300
      ],
      "notes": "Fetches the transcript for the YouTube video. This requires the community node n8n-nodes-youtube-transcript to be installed."
    },
    {
      "parameters": {
        "url": "https://api.example.com/v1/chat/completions",
        "options": {},
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4"
            },
            {
              "name": "messages",
              "value": "={{ [ { \"role\": \"system\", \"content\": \"You are an expert at summarizing video content. Create a concise summary of the following YouTube video transcript, highlighting the key points.\" }, { \"role\": \"user\", \"content\": \"Video Title: \" + $node[\"New Video in Channel\"].json.title + \"\n\nTranscript: \" + $json.transcript + \"\" } ] }}"
            }
          ]
        },
        "authentication": "headerAuth"
      },
      "name": "Summarize Video",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        850,
        300
      ],
      "notes": "Sends the video transcript to an LLM for summarization. **ACTION REQUIRED:** Configure the URL and authentication for your LLM API.",
      "credentials": {
        "httpHeaderAuth": {
          "id": "placeholder",
          "name": "LLM API Key"
        }
      }
    },
    {
      "parameters": {
        "databaseId": "YOUR_DATABASE_ID",
        "properties": {
          "values": [
            {
              "name": "Name",
              "value": "={{ $node[\"New Video in Channel\"].json.title }}"
            },
            {
              "name": "Summary",
              "value": "={{ $json.choices[0].message.content }}"
            },
            {
              "name": "URL",
              "value": "={{ $node[\"New Video in Channel\"].json.link }}"
            }
          ]
        }
      },
      "name": "Save to Notion",
      "type": "n8n-nodes-base.notion",
      "typeVersion": 1,
      "position": [
        1050,
        300
      ],
      "notes": "Saves the video summary to a Notion database. **ACTION REQUIRED:** Configure Notion credentials and select your database.",
      "credentials": {
        "notionApi": {
          "id": "placeholder",
          "name": "Notion Account"
        }
      }
    }
  ],
  "connections": {
    "New Video in Channel": {
      "main": [
        [
          {
            "node": "Get Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Transcript": {
      "main": [
        [
          {
            "node": "Summarize Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Video": {
      "main": [
        [
          {
            "node": "Save to Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}