{
  "name": "YouTube video and channel transcripts to Google Sheets (Apify YouTube Transcripts)",
  "nodes": [
    {
      "parameters": {
        "content": "## YouTube transcripts to Google Sheets\n\nPaste YouTube video, Shorts, channel or playlist URLs and get one sheet row per video with the full transcript text, title, channel, publish date, language and word count.\n\n### How it works\n1. **Get transcripts** runs the Apify actor `arcadium/youtube-transcripts` (YouTube Transcripts Scraper by Arcadium Data) and waits for the rows.\n2. **Transcripts to rows** keeps the transcript rows and picks the columns.\n3. **Append to Google Sheets** writes one row per video.\n\n### Set up\n1. Install or enable the Apify node (`@apify/n8n-nodes-apify`) and add an **Apify API** credential with your Apify token.\n2. Edit the JSON input of **Get transcripts**: `urls`, `languages`, `maxVideosPerSource` (videos per channel or playlist).\n3. Create a sheet tab **Transcripts** with this header row: `videoId | title | channel | publishDate | durationSeconds | language | autoCaptions | wordCount | url | transcript | truncated | summary | scrapedAt`. Then add a Google Sheets credential and paste your sheet URL.\n4. Execute once and check the sheet.\n\n### Cost\nPay per transcript on Apify ($0.00248 each on the Free plan at the time of writing). Videos without captions are free. The node caps a run at $0.50.",
        "height": 760,
        "width": 460
      },
      "id": "7a1e3c40-1b01-0000-4000-8000-000000000010",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-500, -300]
    },
    {
      "parameters": {
        "content": "## Optional: summarize with an LLM\n\nThe sheet has an empty `summary` column. To fill it, add an LLM node between **Transcripts to rows** and **Append to Google Sheets** (for example **Basic LLM Chain** with your own chat model credential) with a prompt like:\n\n`Summarize this transcript in 5 bullet points: {{ $json.transcript }}`\n\nThen set `summary` from the LLM output in an **Edit Fields** node. No LLM is configured in this template.",
        "height": 300,
        "width": 420,
        "color": 7
      },
      "id": "7a1e3c40-1b01-0000-4000-8000-000000000011",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [480, -240]
    },
    {
      "parameters": {},
      "id": "7a1e3c40-1b01-0000-4000-8000-000000000001",
      "name": "When clicking 'Execute workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 160]
    },
    {
      "parameters": {
        "resource": "Actors",
        "operation": "Run actor and get dataset",
        "actorId": "arcadium~youtube-transcripts",
        "actorInputMode": "json",
        "customBody": "{\n  \"urls\": [\n    \"https://www.youtube.com/watch?v=dQw4w9WgXcQ\",\n    \"https://www.youtube.com/@RickAstleyYT\"\n  ],\n  \"languages\": [\n    \"en\"\n  ],\n  \"captionType\": \"any\",\n  \"maxVideosPerSource\": 5,\n  \"includeSegments\": false,\n  \"description\": \"short\",\n  \"includeErrorRows\": true\n}",
        "timeout": 3600,
        "memory": 1024,
        "maxTotalChargeUsd": 0.5,
        "build": "",
        "authentication": "apifyApi"
      },
      "id": "7a1e3c40-1b01-0000-4000-8000-000000000002",
      "name": "Get transcripts",
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 2,
      "position": [240, 160],
      "credentials": {
        "apifyApi": {
          "id": "REPLACE_WITH_YOUR_APIFY_CREDENTIAL_ID",
          "name": "Apify account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// One sheet row per transcript. Error rows (no captions, private, age-restricted, not found) are free and skipped.\n// A Google Sheets cell holds at most 50,000 characters, so very long transcripts are cut and flagged.\nconst MAX_CHARS = 49000;\nconst out = [];\nfor (const item of $input.all()) {\n  const r = item.json;\n  if (r.rowType !== 'transcript') continue;\n  const text = r.transcript ?? '';\n  out.push({\n    json: {\n      videoId: r.videoId,\n      title: r.title ?? '',\n      channel: r.channelName ?? '',\n      publishDate: (r.publishDate ?? '').slice(0, 10),\n      durationSeconds: r.durationSeconds ?? '',\n      language: r.language ?? '',\n      autoCaptions: r.isAutoGenerated === true,\n      wordCount: r.wordCount ?? '',\n      url: r.url,\n      transcript: text.slice(0, MAX_CHARS),\n      truncated: text.length > MAX_CHARS,\n      summary: '',\n      scrapedAt: r.scrapedAt,\n    },\n  });\n}\nreturn out;"
      },
      "id": "7a1e3c40-1b01-0000-4000-8000-000000000003",
      "name": "Transcripts to rows",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [480, 160]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "sheet",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "https://docs.google.com/spreadsheets/d/REPLACE_WITH_YOUR_SPREADSHEET_ID/edit",
          "mode": "url"
        },
        "sheetName": {
          "__rl": true,
          "value": "Transcripts",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": []
        },
        "options": {}
      },
      "id": "7a1e3c40-1b01-0000-4000-8000-000000000004",
      "name": "Append to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [720, 160],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "REPLACE_WITH_YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
          "name": "Google Sheets account"
        }
      }
    }
  ],
  "connections": {
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "Get transcripts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get transcripts": {
      "main": [
        [
          {
            "node": "Transcripts to rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcripts to rows": {
      "main": [
        [
          {
            "node": "Append to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
