{
  "id": "k0Kebprms2GkvaiL",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "YouTube Video Translator & Summarizer \u2192 Slack Auto-Post",
  "tags": [],
  "nodes": [
    {
      "id": "12d7d3b4-f93a-4ba5-9aa4-eab50c190415",
      "name": "Send Summary to Slack (#youtube-summary)",
      "type": "n8n-nodes-base.slack",
      "position": [
        1376,
        -80
      ],
      "parameters": {
        "text": "=\ud83c\udfa5 *New YouTube Video Summary*\n\n\ud83d\udd52 Posted: {{ $('YouTube RSS Trigger (Channel 1)').item.json.pubDate }}\n\ud83e\udde9 Title: {{ $('YouTube RSS Trigger (Channel 1)').item.json.title }}\n\ud83d\udd17 Link: {{ $('YouTube RSS Trigger (Channel 1)').item.json.link }}\n\ud83d\udcdd Summary: {{$json[\"message\"][\"content\"]}}\n",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09LVUG4S5U",
          "cachedResultName": "youtube-summary"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "80facbb9-3728-4c99-b9fd-8fbf9df3cd7d",
      "name": "YouTube RSS Trigger (Channel 1)",
      "type": "n8n-nodes-base.rssFeedReadTrigger",
      "position": [
        208,
        -80
      ],
      "parameters": {
        "feedUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=",
        "pollTimes": {
          "item": [
            {
              "mode": "everyX",
              "value": 1
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3908d543-a4e3-4c6e-a9cc-32b87b291c23",
      "name": "Get YouTube Transcript via RapidAPI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        512,
        -80
      ],
      "parameters": {
        "url": "=https://youtube-transcript3.p.rapidapi.com/api/transcript?videoId={{$json[\"id\"].replace(\"yt:video:\", \"\")}}\n",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-key",
              "value": "YOUR_RAPIDAPI_KEY_HERE"
            },
            {
              "name": "x-rapidapi-host",
              "value": "youtube-transcript3.p.rapidapi.com"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b2534af6-112b-4545-80c9-e5396c7a901d",
      "name": "Combine Transcript Text (Code)",
      "type": "n8n-nodes-base.code",
      "position": [
        800,
        -80
      ],
      "parameters": {
        "jsCode": "const rss = $item(0, 0).$node[\"YouTube RSS Trigger (Channel 1)\"].json;\nconst transcript = $json.transcript || [];\n\nreturn {\n  json: {\n    title: rss.title,\n    link: rss.link,\n    full_text: transcript.map(t => t.text).join(' '),\n  },\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "6cbfe83d-a942-4ea9-adfd-7b1789ae97bf",
      "name": "Generate Japanese Summary (OpenAI)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1040,
        -80
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o-mini"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Summarize the following YouTube video transcript into **3 concise sentences in Japanese.**\n{{$json[\"full_text\"]}}\n"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "33628cdc-54fd-41a3-b4b9-06d65c205307",
      "name": "Sticky: HTTP Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        -272
      ],
      "parameters": {
        "color": 5,
        "width": 288,
        "height": 400,
        "content": "## Fetch Video Transcript\nUses the \u201cyoutube-transcript3\u201d API (via RapidAPI) to retrieve subtitles\nfor the detected video. Works for both English and Japanese videos."
      },
      "typeVersion": 1
    },
    {
      "id": "a589d990-f3bd-45b2-bfcf-d9be27ed54b2",
      "name": "Sticky: Code Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -272
      ],
      "parameters": {
        "color": 2,
        "width": 272,
        "height": 400,
        "content": "## Merge Transcript Text\nThis Code node combines all the transcript segments\ninto a single clean block of text for easier processing."
      },
      "typeVersion": 1
    },
    {
      "id": "5915165b-7d27-416b-b6e0-c17fa779d765",
      "name": "Sticky: OpenAI Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        -272
      ],
      "parameters": {
        "color": 4,
        "width": 272,
        "height": 400,
        "content": "## Generate a 3-Line Summary (Japanese)\nYouTube Video Caption Summarizer to Slack"
      },
      "typeVersion": 1
    },
    {
      "id": "ca6e6333-600a-42fb-894c-6e46f40ba485",
      "name": "Sticky: Slack Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -272
      ],
      "parameters": {
        "color": 3,
        "width": 256,
        "height": 400,
        "content": "## YouTube Video Caption Summarizer to Slack\nAutomatically posts the video title, link, and Japanese summary\nto the #youtube-summary Slack channel."
      },
      "typeVersion": 1
    },
    {
      "id": "e88bb15f-d17d-431e-9475-bdb1a20b2228",
      "name": "Sticky: HTTP Info1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        -272
      ],
      "parameters": {
        "color": 6,
        "width": 304,
        "height": 400,
        "content": "## Detect New YouTube Uploads\nThis node monitors the specified YouTube channel\u2019s RSS feed.\nWhen a new video is uploaded, it automatically triggers the workflow."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6a06db3a-a283-4c0c-95ff-2231a94cedc9",
  "connections": {
    "Combine Transcript Text (Code)": {
      "main": [
        [
          {
            "node": "Generate Japanese Summary (OpenAI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YouTube RSS Trigger (Channel 1)": {
      "main": [
        [
          {
            "node": "Get YouTube Transcript via RapidAPI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Japanese Summary (OpenAI)": {
      "main": [
        [
          {
            "node": "Send Summary to Slack (#youtube-summary)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get YouTube Transcript via RapidAPI": {
      "main": [
        [
          {
            "node": "Combine Transcript Text (Code)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}