This workflow follows the Chainllm → Google Sheets recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"createdAt": "2025-05-01T14:25:34.686Z",
"updatedAt": "2025-05-21T08:31:27.000Z",
"id": "4knuqjqMJ0PLaqoY",
"name": "YouTube AI analys",
"active": false,
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
0,
0
],
"id": "542dc144-25f4-47a2-9087-b1cfac13077e",
"name": "Schedule Trigger"
},
{
"parameters": {
"resource": "playlistItem",
"operation": "getAll",
"playlistId": "=UUPjNBjflYl0-HQtUvOx0Ibw",
"part": [
"snippet",
"contentDetails"
],
"options": {}
},
"type": "n8n-nodes-base.youTube",
"typeVersion": 1,
"position": [
220,
-500
],
"id": "1a068f33-e325-47d8-8f29-c6dc7793defc",
"name": "Greg Isenberg",
"credentials": {
"youTubeOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "playlistItem",
"operation": "getAll",
"playlistId": "=UUbo-KbSjJDG6JWQ_MTZ_rNA",
"part": [
"snippet",
"contentDetails"
],
"options": {}
},
"type": "n8n-nodes-base.youTube",
"typeVersion": 1,
"position": [
220,
-300
],
"id": "900640c4-c00f-49f5-8cd7-9d3829aac422",
"name": "Nick Saraev",
"credentials": {
"youTubeOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "playlistItem",
"operation": "getAll",
"playlistId": "=UU08Fah8EIryeOZRkjBRohcQ",
"part": [
"snippet",
"contentDetails"
],
"options": {}
},
"type": "n8n-nodes-base.youTube",
"typeVersion": 1,
"position": [
220,
-120
],
"id": "40ca1cbc-5aef-48d0-aea3-089d799f6825",
"name": "Creator Magic",
"credentials": {
"youTubeOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "playlistItem",
"operation": "getAll",
"playlistId": "=UUMwVTLZIRRUyyVrkjDpn4pA",
"part": [
"snippet",
"contentDetails"
],
"options": {}
},
"type": "n8n-nodes-base.youTube",
"typeVersion": 1,
"position": [
220,
120
],
"id": "3d5d3f74-d3e1-4b12-a8d6-3696dbbdfa84",
"name": "Cole Medin",
"credentials": {
"youTubeOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "playlistItem",
"operation": "getAll",
"playlistId": "=UUI4xxi0p97BghIqgEPYx6sw",
"part": [
"snippet",
"contentDetails"
],
"options": {}
},
"type": "n8n-nodes-base.youTube",
"typeVersion": 1,
"position": [
220,
320
],
"id": "4d90034a-3366-42fd-8209-6bba486affdf",
"name": "Your AI Workflow",
"credentials": {
"youTubeOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "playlistItem",
"operation": "getAll",
"playlistId": "=UUc-FovAyBAQDw2Y7PQ_v0Zw",
"part": [
"snippet",
"contentDetails"
],
"options": {}
},
"type": "n8n-nodes-base.youTube",
"typeVersion": 1,
"position": [
220,
520
],
"id": "57e2f9c8-48e9-4e6f-b229-b6ce5b8f9539",
"name": "Julian Goldie SEO",
"credentials": {
"youTubeOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "// \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c transcript\nreturn items.filter(item => {\n // \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 error \u0438\u043b\u0438 transcript === undefined, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c\n if (item.json.error) return false;\n if (item.json.transcript === undefined) return false;\n return true;\n});\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
2400,
-1380
],
"id": "bb78f923-8449-4bf6-88ff-f1028cb00ebf",
"name": "Error Filter"
},
{
"parameters": {
"url": "https://youtube-transcript3.p.rapidapi.com/api/transcript",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "videoId",
"value": "={{ $json.videoId }}"
},
{
"name": "Title",
"value": "={{ $json.title }}"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "=X-RapidAPI-Host",
"value": "=youtube-transcript3.p.rapidapi.com"
},
{
"name": "=X-RapidAPI-Key",
"value": "=f7f02f04f5mshc37f3e7eedb6f29p111f4djsn60e622f16916"
}
]
},
"options": {
"batching": {
"batch": {
"batchSize": 1,
"batchInterval": 100000
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1900,
-1540
],
"id": "7ffd3eee-efff-4825-809b-33d7e0aa1757",
"name": "youtube video parser"
},
{
"parameters": {
"jsCode": "// \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u043a\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u00ab\u043d\u0435\u0434\u0435\u043b\u044e \u043d\u0430\u0437\u0430\u0434\u00bb\nconst oneWeekAgo = Date.now() - 1 * 48 * 60 * 60 * 1000;\n\n// \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u0434\u0430\u0442\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437 snippet.publishedAt\nconst recentItems = items.filter(item => {\n const pubDate = new Date(item.json.snippet.publishedAt).getTime();\n return pubDate >= oneWeekAgo;\n});\n\nreturn recentItems;\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1000,
-20
],
"id": "25249b4c-315f-4cc3-96fc-91e00a76a907",
"name": "24 hours"
},
{
"parameters": {
"jsCode": "// \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043c \u0432\u0441\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b transcript \u0432 \u043e\u0434\u0438\u043d \u0442\u0435\u043a\u0441\u0442\nconst segs = $json.transcript || [];\nconst fullText = segs.map(s => s.text).join(' ');\n// \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044f + \u043d\u043e\u0432\u043e\u0435\nreturn [{\n json: {\n ...$json,\n transcript_original: fullText\n }\n}];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
2620,
-1380
],
"id": "11690ba9-a3f8-4925-9fd4-b52ca86461dc",
"name": "add transcript_original"
},
{
"parameters": {
"method": "POST",
"url": "https://openrouter.ai/api/v1/chat/completions",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "<redacted-credential>"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"contentType": "raw",
"rawContentType": "application/json",
"body": "={{\n JSON.stringify({\n model: \"google/gemini-2.5-pro-exp-03-25\",\n messages: [\n {\n role: \"system\",\n content: \"You are an instructional designer. Given the user\u2019s transcript text, identify the 4\u20136 major topics covered and for each provide a concise, detailed description (2\u20133 sentences). Output the result as a JSON array of objects with the schema [{\\\"topic\\\":\\\"...\\\",\\\"detail\\\":\\\"...\\\"}, \u2026]. Do not add any extra commentary.\"\n },\n {\n role: \"user\",\n content: $json.chunk\n }\n ]\n })\n}}\n",
"options": {
"batching": {
"batch": {
"batchSize": 1,
"batchInterval": 10000
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
3600,
-1520
],
"id": "a4dd0a31-cf26-4290-bde5-defe8016e61e",
"name": "Chat Completion"
},
{
"parameters": {
"jsCode": "// \u0411\u0435\u0440\u0451\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\nconst input = items[0].json;\nconst fullText = input.choices[0].message.content;\nconst { title, url, publishedAt, videoId } = input;\n\n// \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u0447\u0430\u043d\u043a\u0430\nconst maxLen = 3000;\n\n// \u0420\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0442\u043e\u0447\u043a\u0438, \u0432\u043e\u0441\u043a\u043b. \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u0442. \u0437\u043d\u0430\u043a\u0438)\nconst sentences = fullText.match(/[^\\.!\\?]+[\\.!\\?]+/g) || [fullText];\n\n// \u041d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u044c\nlet chunks = [];\nlet current = '';\n\n// \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044e\nfor (const sentence of sentences) {\n if ((current + sentence).length <= maxLen) {\n current += sentence + ' ';\n } else {\n if (current) chunks.push(current.trim());\n current = sentence + ' ';\n }\n}\n// \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0447\u0430\u043d\u043a\nif (current) chunks.push(current.trim());\n\n// \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432 items, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0435\u0440\u0432\u044b\u0439\nreturn chunks.map((textChunk, index) => {\n const base = { chunk: textChunk };\n if (index === 0) {\n // \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\n return {\n json: {\n ...base,\n title,\n url,\n publishedAt,\n videoId,\n },\n };\n }\n // \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e chunk\n return { json: base };\n});\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
3380,
-1380
],
"id": "cfbef56e-90f4-4384-a1b4-3390054695a7",
"name": "Split to Chunks"
},
{
"parameters": {
"jsCode": "// \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 \u0432\u0441\u0435\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0430\u0439\u0442\u0435\u043c\u043e\u0432\nlet allFullText = '';\n\n// \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u0431\u0435\u0440\u0435\u043c \u0438\u0445 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430\nlet title, url, publishedAt, videoId;\n\n// \u0411\u0435\u0440\u0435\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442\nif (items.length > 0 && items[0].json) {\n const firstItemJson = items[0].json;\n title = firstItemJson.title;\n url = firstItemJson.url;\n publishedAt = firstItemJson.publishedAt;\n videoId = firstItemJson.videoId;\n}\n\n\n// \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u0430\u0439\u0442\u0435\u043c\u0430\u043c \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442\nfor (const item of items) {\n // \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u043f\u043e\u043b\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0430\u0439\u0442\u0435\u043c\u0435\n if (item.json && item.json.choices && item.json.choices[0] && item.json.choices[0].message && item.json.choices[0].message.content) {\n // \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430 \u043a \u043e\u0431\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435.\n // \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043a\u0441\u0442\u0430\u043c\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0430\u0439\u0442\u0435\u043c\u043e\u0432 \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f.\n allFullText += item.json.choices[0].message.content + '\\n';\n }\n}\n\n// \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u0447\u0430\u043d\u043a\u0430 (\u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0435\u0439)\nconst maxLen = 3000;\n\n// \u0420\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\n// \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 allFullText \u043f\u0443\u0441\u0442\u043e\u0439\nconst sentences = allFullText.match(/[^\\.!\\?]+[\\.!\\?]+/g) || (allFullText ? [allFullText] : []);\n\n\n// \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0447\u0430\u043d\u043a\u0438 \u0438\u0437 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0435\u0439)\nlet chunks = [];\nlet current = '';\nfor (const sentence of sentences) {\n // \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u0437 \u043d\u0430\u0447\u0430\u043b\u0430/\u043a\u043e\u043d\u0446\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0434\u043b\u0438\u043d\u044b\n const trimmedSentence = sentence.trim();\n if (!trimmedSentence) continue; // \u041f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 trim\n\n // \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f \u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0447\u0430\u043d\u043a\n // \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0431\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\n if ((current + trimmedSentence).length + (current ? 1 : 0) <= maxLen) {\n current += trimmedSentence + ' ';\n } else {\n // \u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0447\u0430\u043d\u043a \u043d\u0435 \u043f\u0443\u0441\u0442\u043e\u0439, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0447\u0430\u043d\u043a\u043e\u0432\n if (current) chunks.push(current.trim());\n // \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0447\u0430\u043d\u043a \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\n current = trimmedSentence + ' ';\n }\n}\n// \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0447\u0430\u043d\u043a, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043f\u0443\u0441\u0442\u043e\u0439\nif (current) chunks.push(current.trim());\n\n\n// \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0447\u0430\u043d\u043a\u0438 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0430\u0439\u0442\u0435\u043c\u044b.\n// \u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0447\u0430\u043d\u043a\u0443 \u043e\u0431\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430.\nreturn chunks.map((text, idx) => {\n const base = { summary_points: text };\n if (idx === 0) {\n // \u0422\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u043c \u0430\u0439\u0442\u0435\u043c\u0435 (\u043f\u0435\u0440\u0432\u043e\u043c \u0447\u0430\u043d\u043a\u0435) \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430\n return {\n json: {\n ...base,\n title, // \u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430\n url,\n publishedAt,\n videoId,\n }\n };\n }\n // \u0414\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u043d\u043a\u043e\u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0441\u0442\n return { json: base };\n});"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
4060,
-1380
],
"id": "de080fd8-d7aa-4c0c-b76b-4634851217df",
"name": "Summarizer"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "60d0d292-7f04-40b4-acf3-8a64c13acd26",
"name": "title",
"value": "={{ $json.snippet.title }}",
"type": "string"
},
{
"id": "753c7ef6-4008-4b16-81f0-7fbe291f015a",
"name": "url",
"value": "=https://youtube.com/watch?v={{ $json.snippet.resourceId.videoId }}",
"type": "string"
},
{
"id": "b51008a2-7ca7-408c-b212-f8a441d7c3e5",
"name": "publishedAt",
"value": "={{ $json.snippet.publishedAt }}",
"type": "string"
},
{
"id": "32915e1e-22a5-452f-a234-8371d3993da3",
"name": "videoId",
"value": "={{ $json.snippet.resourceId.videoId }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1680,
-1380
],
"id": "d0e6b142-8d7d-4a02-af47-6f6dbc0be845",
"name": "Parse title ulr and publishedAt"
},
{
"parameters": {
"jsCode": "// Node 1: Clean the raw string containing the JSON array\n\n// \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0432\u0441\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u044b\u0440\u043e\u0439 JSON \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0430\u0439\u0442\u0435\u043c\u043e\u0432\nlet combinedRawJsonString = '';\n\n// \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u0431\u0435\u0440\u0435\u043c \u0438\u0445 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430\nlet title, url;\n\n// \u0411\u0435\u0440\u0435\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 (title, url) \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442\nif (items.length > 0 && items[0].json) {\n const firstInputItemJson = items[0].json;\n title = firstInputItemJson.title;\n url = firstInputItemJson.url;\n // publishedAt \u0438 videoId \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b, \u043d\u043e \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u0432\u044b\u0445\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0437\u043b\u0430.\n}\n\n// \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u0430\u0439\u0442\u0435\u043c\u0430\u043c \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u043e\u043b\u044f summary_points\nfor (const item of items) {\n // \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u043f\u043e\u043b\u0435 summary_points \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0430\u0439\u0442\u0435\u043c\u0435\n if (item.json && item.json.summary_points) {\n // \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 summary_points \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430 \u043a \u043e\u0431\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435\n // \u041f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0438\u0440\u0443\u0435\u043c, \u0442.\u043a. \u0447\u0438\u0441\u0442\u043a\u0430 \u043d\u0438\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u043c\u0438\n combinedRawJsonString += item.json.summary_points;\n }\n}\n\n// \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0439 \u0441\u044b\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439\nlet cleanedJsonString = combinedRawJsonString;\n\n// --- Cleaning Steps ---\n\n// 1. Remove potential leading 'json' marker and surrounding whitespace/newlines.\ncleanedJsonString = cleanedJsonString.replace(/^\\s*```?\\s*json\\s*\\n*/, '');\n\n// 2. Remove potential trailing backticks (``` or `) and surrounding whitespace/newlines.\ncleanedJsonString = cleanedJsonString.replace(/\\s*```?\\s*$/, '');\n\n// 3. Trim any remaining leading/trailing whitespace.\ncleanedJsonString = cleanedJsonString.trim();\n\n// --- !!! WARNING !!! ---\n// The following step removes JSON structure characters ([ ] { }).\n// As noted in the original code, this makes the string invalid JSON and JSON.parse() in the next node WILL FAIL\n// if the next node expects valid JSON. This logic is kept as per your original code.\n\n// 4. Remove square brackets ([ ]) and curly braces ({ }) using a regex\ncleanedJsonString = cleanedJsonString.replace(/[\\[\\]\\{\\}]/g, '');\n\n// --- Prepare Output for the next node ---\n// \u041c\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u0430\u0439\u0442\u0435\u043c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u0443\u044e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430.\nreturn [{\n json: {\n cleanedJsonString: cleanedJsonString, // \u041e\u0447\u0438\u0449\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n title: title, // \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 title \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430\n url: url // \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 URL \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430\n }\n}];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
4320,
-1380
],
"id": "1e5cc7c5-6547-44ce-b307-46945c4372ae",
"name": "remove json"
},
{
"parameters": {
"jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0443\u0437\u043b\u0430\nconst cleanedJsonString = items[0].json.cleanedJsonString;\n\n// \u0428\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u2014 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f topic \u0438 detail\nconst regex = /\"topic\":\\s*\"([^\"\\\\]*(\\\\.[^\"\\\\]*)*)\"\\s*,\\s*\"detail\":\\s*\"([^\"\\\\]*(\\\\.[^\"\\\\]*)*)\"/gs;\n\n// \u041c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\nlet result = [];\nlet match;\n\n// \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\nconst title = items[0].json.title;\nconst url = items[0].json.url;\n\n// \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f topic \u0438 description\nlet isFirstRow = true; // \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438\nwhile ((match = regex.exec(cleanedJsonString)) !== null) {\n // match[1] \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 'topic'\n // match[3] \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 'detail'\n let row = {\n json: {\n Topic: match[1], // \u0422\u0435\u043c\u0430\n Description: match[3] // \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\n }\n };\n\n // \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c title \u0438 url \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438\n if (isFirstRow) {\n row.json.title = title;\n row.json.url = url;\n isFirstRow = false; // \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u043b\u0430\u0433 \u0432 false\n }\n\n result.push(row);\n}\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 Topic, Description, title \u0438 url (\u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438)\nreturn result;\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
4540,
-1380
],
"id": "a4710b64-f678-422a-b41b-9cb0433a109b",
"name": "Code"
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "https://docs.google.com/spreadsheets/d/1pongTk5EFZI1D6RRpYwz_Ex_Tt3lsHfD0jHcGgnAq0k/edit?usp=sharing",
"mode": "url"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Parsing",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pongTk5EFZI1D6RRpYwz_Ex_Tt3lsHfD0jHcGgnAq0k/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Title": "={{ $json.title }}",
"Topic": "={{ $json.Topic }}",
"Description": "={{ $json.Description }}",
"Link": "={{ $json.url }}"
},
"matchingColumns": [],
"schema": [
{
"id": "Title",
"displayName": "Title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Topic",
"displayName": "Topic",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Description",
"displayName": "Description",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Link",
"displayName": "Link",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
4580,
100
],
"id": "dfcc26a9-bcdd-4d32-9476-f205b0fe0c31",
"name": "Google Sheets",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"model": "google/gemma-3-27b-it",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"typeVersion": 1,
"position": [
4180,
-960
],
"id": "ddbacad6-ee9f-4226-a888-5082dd83c405",
"name": "OpenRouter Chat Model",
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"model": "openai/gpt-4.1",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"typeVersion": 1,
"position": [
4140,
-660
],
"id": "ffd44774-8420-4578-b69b-ec3e33f4f469",
"name": "OpenRouter Chat Model1",
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"method": "POST",
"url": "=https://openrouter.ai/api/v1/chat/completions",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "=Authorization",
"value": "=<redacted-credential>"
},
{
"name": "=Content-Type",
"value": "=application/json"
}
]
},
"sendBody": true,
"contentType": "raw",
"rawContentType": "application/json",
"body": "={\n \"model\": \"google/gemini-2.5-pro-exp-03-25\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a translator. Your only task is to take the user\u2019s input and output its English translation \u2014 nothing more. Do not add any commentary, explanations, apologies or extra sentences. If the input is already English, return it verbatim.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"{{ $json.transcript_original }}\"\n }\n ]\n}\n",
"options": {
"batching": {
"batch": {
"batchSize": 1
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
2840,
-1520
],
"id": "b8257f31-848d-430b-ba31-9362ca99fd9d",
"name": "HTTP OpenRouter Request"
},
{
"parameters": {
"numberInputs": 6
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3,
"position": [
720,
-80
],
"id": "c0794ac1-4a45-48bf-b6e2-71624e0e41a5",
"name": "Merge YouTube videos"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3,
"position": [
2120,
-1400
],
"id": "72845b20-1e57-4adb-98f1-da266ced7ca4",
"name": "Merge transcribation and title, url, etc"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3,
"position": [
3120,
-1380
],
"id": "6b565cff-30ed-4ca2-ae86-a18d07ecb4e4",
"name": "Merge OpenRouter and transcript"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3,
"position": [
3840,
-1380
],
"id": "d175c838-8fff-4687-8af1-03fd4f0a33f0",
"name": "Merge Chunks and title, url, etc"
},
{
"parameters": {
"jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\nconst inputData = items; // \u042d\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438 Topic, Description \u0438 Title\n\n// \u041c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\nlet result = [];\n\n// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c title \u0438 url \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\nconst title = inputData[0].json.title;\nconst url = inputData[0].json.url;\n\n// \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438\nlet isFirstRow = true;\n\n// \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c title \u0438 url \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438\ninputData.forEach(item => {\n // \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438\n const row = {\n json: {\n Topic: item.json.Topic, // \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c Topic\n Description: item.json.Description, // \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c Description\n title: title // \u0414\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c Title \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\n }\n };\n\n // \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c url \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438\n if (isFirstRow) {\n row.json.url = url;\n isFirstRow = false; // \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u043b\u0430\u0433 \u0432 false\n }\n\n result.push(row);\n});\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nreturn result;\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
3860,
-1100
],
"id": "47088f8f-6f3c-4c8c-a225-7fd9b4946038",
"name": "Add Titles to rows"
},
{
"parameters": {
"promptType": "define",
"text": "=Generate a lesson theory without bullet points and description what students will be able to..., This project/learning centers/module... Write text like guide, not water AI answer using this materials:\nTitle: {{ $json.title }}\nTopic: {{ $json.Topic }}\nDescription: {{ $json.Description }}\n\nU need to write 2-3 paragraphs about Description that i gave you\n\nStart output from \"Lesson Description:\" \n\nDo not add any extra commentary\n"
},
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.5,
"position": [
4080,
-1100
],
"id": "2df03b0a-ea95-463b-aeda-af0ecfd917ff",
"name": "Theory Generator"
},
{
"parameters": {
"jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (input items)\nconst inputItems = items;\n\n// \u041c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\nlet mergedResult = [];\nlet fullText = ''; // \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442\n\n// \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442\ninputItems.forEach(item => {\n const lessonText = item.json.text; // \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e input\n\n // \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \"Lesson Description\", \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e\n const formattedText = lessonText.replace(/(Lesson Description)/g, '\\n$1');\n \n // \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u0442\u0435\u043a\u0441\u0442\u0443\n fullText += formattedText + ' ';\n});\n\n// \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\nmergedResult.push({\n json: {\n lessonText: fullText.trim() // \u0421\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 Lesson Description \u0432 \u043e\u0434\u0438\u043d \u0431\u043b\u043e\u043a\n }\n});\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\nreturn mergedResult;\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
4440,
-1100
],
"id": "514c7f49-e326-45ec-b777-898d810593ed",
"name": "Theory Merger"
},
{
"parameters": {
"jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\nconst inputString = $input.first().json.lessonText;\n\n// \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \"Lesson Description:\"\nconst addLessonNumber = (input) => {\n let count = 1;\n // \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0432\u0441\u0435\u0445 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \"Lesson Description:\"\n return input.replace(/(Lesson Description:)/g, () => {\n return `Lesson Description ${count++}:`; // \u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u043c\u0435\u0440 \u0443\u0440\u043e\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 \"Lesson Description:\"\n });\n};\n\n// \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0443\u0440\u043e\u043a\u043e\u0432\nconst updatedString = addLessonNumber(inputString);\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nreturn [{ json: { updatedText: updatedString } }];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
3860,
-820
],
"id": "54831ec2-5b87-4a7a-86ca-ecd9418a8c13",
"name": "Add nums to Lesson Description"
},
{
"parameters": {
"promptType": "define",
"text": "=\u041d\u0435 \u043f\u0438\u0448\u0438 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043e\u0442 \u0441\u0435\u0431\u044f\n\n\u042f \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u043a\u0441\u0442 \u0432 JSON-\u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u0430.\n\u041e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u0443\u0440\u0441\u0435:\n\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0439 \u043e\u0431\u0449\u0435\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0443\u0440\u0441\u0430 (\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u043d\u043d\u044b\u043c, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432).\n\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0439 \u043e\u0431\u0449\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0443\u0440\u0441\u0430.\n\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u043a\u0443\u0440\u0441\u0430: 680f332a16f8bb2b6ce9e71d\n\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438: beginner\n\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u0430: (\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u0443\u0441\u0442\u044b\u043c)\n\u041f\u0440\u0435\u0432\u044c\u044e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u0430: (\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u0443\u0441\u0442\u044b\u043c)\n\u041c\u043e\u0434\u0443\u043b\u0438 \u043a\u0443\u0440\u0441\u0430:\n\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0441 \"Lesson Description\" \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \"Lesson Description\" (\u0438\u043b\u0438 \u043a\u043e\u043d\u0446\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0430), \u0441\u043e\u0437\u0434\u0430\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \"modules\".\n\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f:\n\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u044f: \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0439 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u043e\u0431\u043e\u0431\u0449\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \"Lesson Description\".\n\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f: \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0439 \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u043e\u0431\u043e\u0431\u0449\u0430\u044e\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \"Lesson Description\".\n\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f (\"content\"): \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0442\u0435\u043a\u0441\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \"Lesson Description\".\n\u0423\u0440\u043e\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f (\"lessons\"): \u0421\u043e\u0437\u0434\u0430\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u0443\u0440\u043e\u043a\u0430.\n\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0443\u0440\u043e\u043a\u0430 (\"title\"): \u0421\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043a\u0430\u043a \"Module \u2116X\", \u0433\u0434\u0435 X - \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \"Lesson Description\".\n\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0443\u0440\u043e\u043a\u0430 (\"content\"): \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0442\u0435\u043a\u0441\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \"Lesson Description\".\n\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0443\u0440\u043e\u043a\u0430 (\"duration\"): 15\n\u0422\u0438\u043f \u0443\u0440\u043e\u043a\u0430 (\"type\"): text\n\u0422\u0438\u043f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 (\"contentType\"): standard\n\u0420\u0435\u0441\u0443\u0440\u0441\u044b \u0443\u0440\u043e\u043a\u0430 (\"resources\"): []\n\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u043a\u0430 (\"practiceExercises\"): []\n\u0411\u043b\u043e\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0443\u0440\u043e\u043a\u0430 (\"contentBlock\"): []\n\u0422\u0435\u0441\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u044f (\"tests\"): []\n\u0412\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043a\u0441\u0442:\n{{ $json.updatedText }}\nJSON Structure:\n{\n\"title\": \"(\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u0430)\",\n\"description\": \"(\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u0430)\",\n\"category\": \"680f332a16f8bb2b6ce9e71d\",\n\"difficulty\": \"beginner\",\n\"image\": \"\",\n\"imagePreview\": \"\",\n\"modules\": [\n{\n\"title\": \"(\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u044f 1)\",\n\"description\": \"(\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f 1)\",\n\"content\": \"(\u0442\u0435\u043a\u0441\u0442 Lesson Description 1)\",\n\"lessons\": [\n{\n\"title\": \"Module \u21161\",\n\"content\": \"(\u0442\u0435\u043a\u0441\u0442 Lesson Description 1)\",\n\"duration\": 15,\n\"type\": \"text\",\n\"contentType\": \"standard\",\n\"resources\": [],\n\"practiceExercises\": [],\n\"contentBlocks\": []\n}\n],\n\"tests\": []\n},\n{\n\"title\": \"(\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u044f 2)\",\n\"description\": \"(\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f 2)\",\n\"content\": \"(\u0442\u0435\u043a\u0441\u0442 Lesson Description 2)\",\n\"lessons\": [\n{\n\"title\": \"Module \u21162\",\n\"content\": \"(\u0442\u0435\u043a\u0441\u0442 Lesson Description 2)\",\n\"duration\": 15,\n\"type\": \"text\",\n\"contentType\": \"standard\",\n\"resources\": [],\n\"practiceExercises\": [],\n\"contentBlocks\": []\n}\n],\n\"tests\": []\n},\n// ... \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e Lesson Description \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043c\u043e\u0434\u0443\u043b\u044c\n]\n}\n\u0412\u0430\u0436\u043d\u043e: \u041e\u0431\u0440\u0430\u0442\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u0443\u0440\u0441\u0435 (title, description, category, difficulty, image, imagePreview) \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 JSON. \u041c\u0430\u0441\u0441\u0438\u0432 \"modules\" \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \"Lesson Description\". \u0438 \u041f\u0438\u0448\u0438 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c"
},
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.5,
"position": [
4080,
-820
],
"id": "285282a8-0eea-4415-a72b-48978fbee0cc",
"name": "JSON generator"
},
{
"parameters": {
"jsCode": "// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\nconst inputString = $input.first().json.text;\n\n// \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0448\u043d\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\nconst cleanString = (input) => {\n return input\n .replace(/```json\\n/g, '') // \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u043e \u0431\u043b\u043e\u043a\u0430 json\n .replace(/```/g, '') // \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u0431\u043b\u043e\u043a\u0430 json\n .replace(/\\n/g, ' ') // \u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \\n \u043d\u0430 \u043f\u0440\u043e\u0431\u0435\u043b\u044b\n .replace(/\\s+/g, ' ') // \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b (\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u043d\u0430 \u043e\u0434\u0438\u043d)\n .trim(); // \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435\n};\n\n// \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0447\u0438\u0441\u0442\u043a\u0438\nconst cleanedString = cleanString(inputString);\n\n// \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443\nreturn [{ json: { cleanedText: cleanedString } }];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
4440,
-820
],
"id": "a0e348b8-e19b-4181-a19c-045bffd036c7",
"name": "Delete trash"
},
{
"parameters": {
"url": "https://youtube-transcript3.p.rapidapi.com/api/transcript",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "videoId",
"value": "={{ $json.videoId }}"
},
{
"name": "Title",
"value": "={{ $json.title }}"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "=X-RapidAPI-Host",
"value": "=youtube-transcript3.p.rapidapi.com"
},
{
"name": "=X-RapidAPI-Key",
"value": "=4ebd2c4b95mshc8ab3534e42bb1ep1d463fjsn32e3de965ce5"
}
]
},
"options": {
"batching": {
"batch": {
"batchSize": 1,
"batchInterval": 61000
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1600,
-180
],
"id": "c1b6b6fe-f502-4dd9-ac0c-c9a2f24d796b",
"name": "youtube video parser1"
},
{
"parameters": {
"jsCode": "// \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0438\u0441\u043f\u043e\
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleSheetsOAuth2ApiopenRouterApiyouTubeOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
YouTube AI analys. Uses youTube, httpRequest, googleSheets, lmChatOpenRouter. Scheduled trigger; 55 nodes.
Source: https://github.com/AdminRHS/n8n-credentials-backup/blob/9be9e5c32e495d6bce2eb5bbc6a3411589f98c27/workflows/YouTube_AI_analys/YouTube_AI_analys.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
AI YouTube transcript. Uses youTube, googleSheets, lmChatOpenRouter, chainLlm. Scheduled trigger; 26 nodes.
YouTube AI Analys (modified) + community node transcript. Uses youTube, googleSheets, lmChatOpenRouter, chainLlm. Scheduled trigger; 26 nodes.
This n8n template acts as your automated social media data analyst. Instead of manually checking your analytics across different dashboards every week, this workflow scrapes your latest stats, calcula
What It Does
Youtube Video Creator. Uses googleSheets, chainLlm, lmChatOpenAi, outputParserStructured. Scheduled trigger; 21 nodes.