This workflow follows the Google Drive → 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 →
{
"name": "B \u2014 \u041c\u043e\u043d\u0442\u0430\u0436 \u0433\u043e\u0442\u043e\u0432: \u0442\u0435\u043a\u0441\u0442\u044b \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 (\u0427\u0435\u043b\u043b\u0435\u043d\u0434\u0436 200 \u0434\u043d\u0435\u0439)",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "submagic-done",
"responseMode": "onReceived",
"options": {}
},
"id": "b-webhook",
"name": "Webhook Submagic",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-1400,
0
]
},
{
"parameters": {
"jsCode": "const body = $json.body || $json;\nconst projectId = body.projectId || body.id || body.project_id;\nif (!projectId) {\n throw new Error('Webhook Submagic: \u0432 payload \u043d\u0435\u0442 projectId. Payload: ' + JSON.stringify(body).slice(0, 500));\n}\nreturn [{ json: {\n projectId,\n webhookDownloadUrl: body.downloadUrl || body.download_url || null,\n webhookTranscript: body.transcript || null,\n webhookStatus: body.status || null\n} }];"
},
"id": "b-extract",
"name": "\u0418\u0437\u0432\u043b\u0435\u0447\u044c projectId",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-1180,
0
]
},
{
"parameters": {
"url": "=https://api.submagic.co/v1/projects/{{ $json.projectId }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SUBMAGIC_API_KEY }}"
}
]
},
"options": {}
},
"id": "b-submagic-get",
"name": "Submagic: \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-960,
0
],
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 5000
},
{
"parameters": {
"jsCode": "const wh = $('\u0418\u0437\u0432\u043b\u0435\u0447\u044c projectId').first().json;\nconst proj = $json;\n\nconst downloadUrl = proj.downloadUrl || proj.download_url || proj.outputUrl || wh.webhookDownloadUrl;\nlet transcript = wh.webhookTranscript || proj.transcript || '';\nif (!transcript && Array.isArray(proj.words)) {\n // Submagic: \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043b\u043e\u0432 \u0441 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0430\u043c\u0438; \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u043c \u0432 \u0442\u0435\u043a\u0441\u0442, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u043f\u0430\u0443\u0437\u044b\n transcript = proj.words\n .filter(w => w.text && w.type !== 'silence')\n .map(w => w.text)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n}\nif (!downloadUrl) {\n throw new Error('Submagic: \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d downloadUrl \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u043e\u043b\u0438\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 ' + wh.projectId);\n}\nreturn [{ json: { projectId: wh.projectId, downloadUrl, transcript } }];"
},
"id": "b-combine",
"name": "\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-740,
0
]
},
{
"parameters": {
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $env.GOOGLE_SHEETS_ID }}"
},
"sheetName": {
"__rl": true,
"mode": "name",
"value": "pipeline"
},
"filtersUI": {
"values": [
{
"lookupColumn": "submagic_project_id",
"lookupValue": "={{ $json.projectId }}"
}
]
},
"options": {}
},
"id": "b-sheets-find",
"name": "\u041d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
-520,
0
]
},
{
"parameters": {
"jsCode": "// \u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0431\u0435\u0440\u0451\u043c \u0438\u0437 \u0440\u0435\u0447\u0438 \u0432 \u0440\u043e\u043b\u0438\u043a\u0435: \u00abSeit 55 Tagen\u2026\u00bb \u2192 55.\n// HeyGen \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u043d\u0435\u043c\u0435\u0446\u043a\u0438\u0439, Submagic \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u0447\u0438\u0441\u043b\u0430 \u0446\u0438\u0444\u0440\u0430\u043c\u0438.\n// \u0410\u0432\u0442\u043e\u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f (\u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 + 1) \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u0430\u0441\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c.\nconst row = $('\u041d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443').first().json;\nconst words = $('Submagic: \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430').first().json.words || [];\nconst text = words.filter(w => w && w.type !== 'silence').map(w => w.text || '').join(' ');\n\nlet day = null;\nconst m = text.match(/(\\d{1,3})\\s*(?:\\.|-)?\\s*Tag/i) || text.match(/Tag\\w*\\s*(?:Nummer\\s*)?(\\d{1,3})/i);\nif (m) { const n = Number(m[1]); if (n >= 1 && n <= 999) day = n; }\n\nreturn [{ json: { ...row,\n day_number: day ?? row.day_number,\n day_number_auto: row.day_number,\n day_from_speech: day !== null,\n} }];"
},
"id": "b-day-from-speech",
"name": "\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-520,
-60
]
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $env.GOOGLE_SHEETS_ID }}"
},
"sheetName": {
"__rl": true,
"mode": "name",
"value": "pipeline"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"submagic_project_id": "={{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.submagic_project_id }}",
"day_number": "={{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.day_number }}"
},
"matchingColumns": [
"submagic_project_id"
],
"schema": []
},
"options": {}
},
"id": "b-renumber",
"name": "\u041f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u043d\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
-180,
-160
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json.status }}",
"rightValue": "editing",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "b-idempotency",
"name": "\u0418\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c (status = editing)",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-300,
0
]
},
{
"parameters": {},
"id": "b-noop",
"name": "\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 webhook \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
-80,
180
]
},
{
"parameters": {
"url": "={{ $('\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430').first().json.downloadUrl }}",
"options": {
"response": {
"response": {
"responseFormat": "file"
}
}
}
},
"id": "b-download-final",
"name": "\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-80,
-60
],
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 5000
},
{
"parameters": {
"name": "=day_{{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.day_number }}_final.mp4",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $env.GDRIVE_FOLDER_FINAL }}"
},
"options": {}
},
"id": "b-drive-final",
"name": "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 Drive (final)",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 3,
"position": [
140,
-60
]
},
{
"parameters": {
"operation": "share",
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"permissionsUi": {
"permissionsValues": {
"role": "reader",
"type": "anyone"
}
},
"options": {}
},
"id": "b-share-final",
"name": "\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f (final)",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 3,
"position": [
360,
-60
]
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $env.GOOGLE_SHEETS_ID }}"
},
"sheetName": {
"__rl": true,
"mode": "name",
"value": "pipeline"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"day_number": "={{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.day_number }}",
"final_url": "=https://drive.usercontent.google.com/download?export=download&confirm=t&id={{ $('\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 Drive (final)').first().json.id }}",
"transcript_de": "={{ $('\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430').first().json.transcript }}"
},
"matchingColumns": [
"day_number"
],
"schema": []
},
"options": {}
},
"id": "b-sheets-final",
"name": "\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c: final",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
580,
-60
]
},
{
"parameters": {
"jsCode": "const row = $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json;\nconst transcript = $('\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430').first().json.transcript || '';\nconst fallbackDay = row.day_number;\nconst total = Number($env.CHALLENGE_TOTAL_DAYS || 200);\n\nconst system = `\u0422\u044b \u043f\u0438\u0448\u0435\u0448\u044c \u0442\u0435\u043a\u0441\u0442\u044b \u0434\u043b\u044f \u043d\u0435\u043c\u0435\u0446\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u043e \u0447\u0435\u043b\u043b\u0435\u043d\u0434\u0436\u0435 \"200 \u0434\u043d\u0435\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438\". \u0410\u0432\u0442\u043e\u0440 \u0431\u043b\u043e\u0433\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0432\u0438\u0434\u0435\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u043d \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e (n8n, API, AI-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b); \u0446\u0435\u043b\u044c \u0447\u0435\u043b\u043b\u0435\u043d\u0434\u0436\u0430 \u2014 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0444\u0444\u0435\u0440 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443.\\n\\n\u041d\u041e\u041c\u0415\u0420 \u0414\u041d\u042f: \u0430\u0432\u0442\u043e\u0440 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0434\u0435\u043d\u044c \u0447\u0435\u043b\u043b\u0435\u043d\u0434\u0436\u0430 \u043f\u0440\u044f\u043c\u043e \u0432 \u0432\u0438\u0434\u0435\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \"Tag f\u00fcnf\", \"am f\u00fcnften Tag\", \"Tag 5\", \"heute ist Tag 12\"). \u041d\u0430\u0439\u0434\u0438 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0432 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u0418\u041c\u0415\u041d\u041d\u041e \u0415\u0413\u041e \u0432\u043e \u0432\u0441\u0435\u0445 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f\u0445 \"Tag N/${total}\". \u0415\u0441\u043b\u0438 \u0432 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u043d\u0435 \u043d\u0430\u0437\u0432\u0430\u043d \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u0437\u0430\u043f\u0430\u0441\u043d\u043e\u0439 \u043d\u043e\u043c\u0435\u0440 N=${fallbackDay}. \u0412\u0441\u0435\u0433\u0434\u0430 \u043f\u0438\u0448\u0438 \u0447\u0438\u0441\u043b\u043e \u0446\u0438\u0444\u0440\u043e\u0439 (Tag 5, \u043d\u0435 Tag f\u00fcnf).\\n\\n\u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0441\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0443\u043a\u0430 \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \"Tag N/${total}\".\\n\\n\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u043c:\\n- caption_linkedin: \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u043e\u043d, 600\u2013900 \u0437\u043d\u0430\u043a\u043e\u0432, 3\u20135 \u0445\u044d\u0448\u0442\u0435\u0433\u043e\u0432.\\n- caption_instagram: \u0436\u0438\u0432\u043e\u0439 \u0442\u043e\u043d, 300\u2013500 \u0437\u043d\u0430\u043a\u043e\u0432, \u041c\u0410\u041a\u0421\u0418\u041c\u0423\u041c 5 \u0445\u044d\u0448\u0442\u0435\u0433\u043e\u0432 (Instagram \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u043f\u043e\u0441\u0442\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u043c), \u044d\u043c\u043e\u0434\u0437\u0438 \u0443\u043c\u0435\u0440\u0435\u043d\u043d\u043e.\\n- title_youtube: \u0434\u043e 70 \u0437\u043d\u0430\u043a\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \"Tag N/${total}\".\\n- caption_youtube: \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 200\u2013400 \u0437\u043d\u0430\u043a\u043e\u0432.\\n\\n\u0412\u0441\u0435 \u0442\u0435\u043a\u0441\u0442\u044b \u043d\u0430 \u043d\u0435\u043c\u0435\u0446\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.\\n\\n\u0412\u0435\u0440\u043d\u0438 \u0422\u041e\u041b\u042c\u041a\u041e \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 JSON \u0431\u0435\u0437 markdown \u0438 \u0431\u0435\u0437 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439, \u0440\u043e\u0432\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:\\n{ \"caption_linkedin\": \"...\", \"caption_instagram\": \"...\", \"caption_youtube\": \"...\", \"title_youtube\": \"...\" }`;\n\nconst user = `\u0422\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435\u043c\u0435\u0446\u043a\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u0438\u0434\u0435\u043e (\u043d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u043d\u0430\u0439\u0434\u0438 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435; \u0437\u0430\u043f\u0430\u0441\u043d\u043e\u0439 \u043d\u043e\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0437\u0432\u0430\u043d: ${fallbackDay}):\\n\\n${transcript}`;\n\nreturn [{ json: {\n day_number: fallbackDay,\n claudeRequest: {\n model: 'claude-sonnet-4-6',\n max_tokens: 2000,\n system,\n messages: [{ role: 'user', content: user }]\n }\n} }];"
},
"id": "b-claude-build",
"name": "\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a Claude",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
800,
-60
]
},
{
"parameters": {
"method": "POST",
"url": "https://api.anthropic.com/v1/messages",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.ANTHROPIC_API_KEY }}"
},
{
"name": "anthropic-version",
"value": "2023-06-01"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify($json.claudeRequest) }}",
"options": {}
},
"id": "b-claude",
"name": "Claude: \u0442\u0435\u043a\u0441\u0442\u044b",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1020,
-60
],
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 5000
},
{
"parameters": {
"jsCode": "let text = ($json.content && $json.content[0] && $json.content[0].text) || '';\ntext = text.trim().replace(/^```(json)?\\s*/i, '').replace(/```\\s*$/, '').trim();\ntry {\n const p = JSON.parse(text);\n if (!p.caption_linkedin || !p.caption_instagram || !p.caption_youtube || !p.title_youtube) throw new Error('missing fields');\n return [{ json: { ok: true, ...p } }];\n} catch (e) {\n return [{ json: { ok: false, raw: text } }];\n}"
},
"id": "b-parse",
"name": "\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c JSON",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1240,
-60
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json.ok }}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "b-parse-ok",
"name": "JSON \u0432\u0430\u043b\u0438\u0434\u0435\u043d?",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
1460,
-60
]
},
{
"parameters": {
"method": "POST",
"url": "https://api.anthropic.com/v1/messages",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.ANTHROPIC_API_KEY }}"
},
{
"name": "anthropic-version",
"value": "2023-06-01"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify(Object.assign({}, $('\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a Claude').first().json.claudeRequest, { messages: $('\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a Claude').first().json.claudeRequest.messages.concat([{ role: 'user', content: '\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u0431\u044b\u043b \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c JSON. \u0412\u0435\u0440\u043d\u0438 \u0422\u041e\u041b\u042c\u041a\u041e \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 JSON \u043d\u0443\u0436\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0431\u0435\u0437 markdown-\u043e\u0431\u0451\u0440\u0442\u043e\u043a \u0438 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439.' }]) })) }}",
"options": {}
},
"id": "b-claude-retry",
"name": "Claude: \u043f\u043e\u0432\u0442\u043e\u0440",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1680,
120
],
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 5000
},
{
"parameters": {
"jsCode": "let text = ($json.content && $json.content[0] && $json.content[0].text) || '';\ntext = text.trim().replace(/^```(json)?\\s*/i, '').replace(/```\\s*$/, '').trim();\ntry {\n const p = JSON.parse(text);\n if (!p.caption_linkedin || !p.caption_instagram || !p.caption_youtube || !p.title_youtube) throw new Error('missing fields');\n return [{ json: { ok: true, ...p } }];\n} catch (e) {\n throw new Error('Claude \u0432\u0435\u0440\u043d\u0443\u043b \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 JSON \u0434\u0432\u0430\u0436\u0434\u044b. \u041e\u0442\u0432\u0435\u0442: ' + text.slice(0, 300));\n}"
},
"id": "b-parse-retry",
"name": "\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c JSON (\u043f\u043e\u0432\u0442\u043e\u0440)",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1900,
120
]
},
{
"parameters": {
"jsCode": "// Instagram \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u043f\u043e\u0441\u0442\u044b \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0441 5 \u0445\u044d\u0448\u0442\u0435\u0433\u0430\u043c\u0438 (Blotato: 422).\n// \u041f\u0440\u043e\u043c\u043f\u0442 \u043f\u0440\u043e\u0441\u0438\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 5, \u043d\u043e \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u0441\u044f \u2014 \u0441\u0440\u0435\u0437\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0438\u0435.\nfunction capTags(text, max = 5) {\n if (!text) return text;\n let seen = 0;\n return text.replace(/#[\\p{L}\\p{N}_]+/gu, m => (++seen <= max ? m : ''))\n .replace(/[ \\t]{2,}/g, ' ')\n .replace(/\\n{3,}/g, '\\n\\n')\n .trim();\n}\n\nreturn [{ json: {\n caption_linkedin: $json.caption_linkedin,\n caption_instagram: capTags($json.caption_instagram),\n caption_youtube: $json.caption_youtube,\n title_youtube: $json.title_youtube\n} }];"
},
"id": "b-texts-final",
"name": "\u0422\u0435\u043a\u0441\u0442\u044b (\u0438\u0442\u043e\u0433)",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
2000,
-60
]
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $env.GOOGLE_SHEETS_ID }}"
},
"sheetName": {
"__rl": true,
"mode": "name",
"value": "pipeline"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"day_number": "={{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.day_number }}",
"caption_linkedin": "={{ $json.caption_linkedin }}",
"caption_instagram": "={{ $json.caption_instagram }}",
"caption_youtube": "={{ $json.caption_youtube }}",
"title_youtube": "={{ $json.title_youtube }}",
"status": "awaiting_approval"
},
"matchingColumns": [
"day_number"
],
"schema": []
},
"options": {}
},
"id": "b-sheets-texts",
"name": "\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u044b",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
2120,
-60
]
},
{
"parameters": {
"operation": "editMessageText",
"chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
"messageId": "={{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.tg_status_msg_id }}",
"text": "=\u2705 \u0414\u0435\u043d\u044c {{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.day_number }}/{{ $env.CHALLENGE_TOTAL_DAYS || 200 }} \u0433\u043e\u0442\u043e\u0432!\n\n\u2593\u2593\u2593\u2593\u2593\u2593\u2593\u2593\u2593\u2593 100% \u2014 \u043f\u0440\u0435\u0432\u044c\u044e \u043d\u0438\u0436\u0435 \u2193",
"additionalFields": {
"appendAttribution": false
},
"messageType": "message"
},
"id": "b-progress-done",
"name": "\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441: \u0433\u043e\u0442\u043e\u0432\u043e",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
2230,
-200
],
"onError": "continueRegularOutput",
"retryOnFail": true,
"maxTries": 2,
"waitBetweenTries": 3000
},
{
"parameters": {
"jsCode": "// Telegram \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0430\u043c\u0438 \u0431\u0430\u0439\u0442\u044b, \u0430 \u043d\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 Drive:\n// Drive \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u0442\u0434\u0430\u0451\u0442 HTML-\u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0438\u0434\u0435\u043e.\nconst src = $('\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e').first();\nreturn [{ json: $input.first().json, binary: src.binary }];"
},
"id": "b-attach-video",
"name": "\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u0432\u0438\u0434\u0435\u043e",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
2340,
-200
]
},
{
"parameters": {
"operation": "sendVideo",
"chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
"binaryData": true,
"binaryPropertyName": "data",
"replyMarkup": "inlineKeyboard",
"inlineKeyboard": {
"rows": [
{
"row": {
"buttons": [
{
"text": "\u2705 \u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0439\u0447\u0430\u0441",
"additionalFields": {
"callback_data": "=publish:{{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.day_number }}"
}
}
]
}
},
{
"row": {
"buttons": [
{
"text": "\ud83d\uddd3 \u0412 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c (\u0430\u0432\u0442\u043e, 18:00)",
"additionalFields": {
"callback_data": "=queue:{{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.day_number }}"
}
}
]
}
},
{
"row": {
"buttons": [
{
"text": "\u274c \u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c",
"additionalFields": {
"callback_data": "=reject:{{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.day_number }}"
}
}
]
}
}
]
},
"additionalFields": {
"caption": "=\ud83c\udfac \u0414\u0435\u043d\u044c {{ $('\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438').first().json.day_number }}/{{ $env.CHALLENGE_TOTAL_DAYS || 200 }} \u0433\u043e\u0442\u043e\u0432. \u0422\u0435\u043a\u0441\u0442\u044b \u0443\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u2014 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c?",
"appendAttribution": false,
"duration": "={{ Math.round($('Submagic: \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430').first().json.videoMetaData?.duration || 0) }}",
"width": "={{ $('Submagic: \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430').first().json.videoMetaData?.width || 720 }}",
"height": "={{ $('Submagic: \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430').first().json.videoMetaData?.height || 1280 }}"
}
},
"id": "b-tg-video",
"name": "\u041f\u0440\u0435\u0432\u044c\u044e: \u0432\u0438\u0434\u0435\u043e + \u043a\u043d\u043e\u043f\u043a\u0438",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
2340,
-60
],
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 5000
}
],
"connections": {
"Webhook Submagic": {
"main": [
[
{
"node": "\u0418\u0437\u0432\u043b\u0435\u0447\u044c projectId",
"type": "main",
"index": 0
}
]
]
},
"\u0418\u0437\u0432\u043b\u0435\u0447\u044c projectId": {
"main": [
[
{
"node": "Submagic: \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430",
"type": "main",
"index": 0
}
]
]
},
"Submagic: \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430": {
"main": [
[
{
"node": "\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430",
"type": "main",
"index": 0
}
]
]
},
"\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430": {
"main": [
[
{
"node": "\u041d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443",
"type": "main",
"index": 0
}
]
]
},
"\u041d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443": {
"main": [
[
{
"node": "\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438",
"type": "main",
"index": 0
}
]
]
},
"\u0418\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c (status = editing)": {
"main": [
[
{
"node": "\u041f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u043d\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443",
"type": "main",
"index": 0
}
],
[
{
"node": "\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 webhook \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c",
"type": "main",
"index": 0
}
]
]
},
"\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e": {
"main": [
[
{
"node": "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 Drive (final)",
"type": "main",
"index": 0
}
]
]
},
"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 Drive (final)": {
"main": [
[
{
"node": "\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f (final)",
"type": "main",
"index": 0
}
]
]
},
"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f (final)": {
"main": [
[
{
"node": "\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c: final",
"type": "main",
"index": 0
}
]
]
},
"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c: final": {
"main": [
[
{
"node": "\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a Claude",
"type": "main",
"index": 0
}
]
]
},
"\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a Claude": {
"main": [
[
{
"node": "Claude: \u0442\u0435\u043a\u0441\u0442\u044b",
"type": "main",
"index": 0
}
]
]
},
"Claude: \u0442\u0435\u043a\u0441\u0442\u044b": {
"main": [
[
{
"node": "\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c JSON",
"type": "main",
"index": 0
}
]
]
},
"\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c JSON": {
"main": [
[
{
"node": "JSON \u0432\u0430\u043b\u0438\u0434\u0435\u043d?",
"type": "main",
"index": 0
}
]
]
},
"JSON \u0432\u0430\u043b\u0438\u0434\u0435\u043d?": {
"main": [
[
{
"node": "\u0422\u0435\u043a\u0441\u0442\u044b (\u0438\u0442\u043e\u0433)",
"type": "main",
"index": 0
}
],
[
{
"node": "Claude: \u043f\u043e\u0432\u0442\u043e\u0440",
"type": "main",
"index": 0
}
]
]
},
"Claude: \u043f\u043e\u0432\u0442\u043e\u0440": {
"main": [
[
{
"node": "\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c JSON (\u043f\u043e\u0432\u0442\u043e\u0440)",
"type": "main",
"index": 0
}
]
]
},
"\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c JSON (\u043f\u043e\u0432\u0442\u043e\u0440)": {
"main": [
[
{
"node": "\u0422\u0435\u043a\u0441\u0442\u044b (\u0438\u0442\u043e\u0433)",
"type": "main",
"index": 0
}
]
]
},
"\u0422\u0435\u043a\u0441\u0442\u044b (\u0438\u0442\u043e\u0433)": {
"main": [
[
{
"node": "\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u044b",
"type": "main",
"index": 0
}
]
]
},
"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u044b": {
"main": [
[
{
"node": "\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441: \u0433\u043e\u0442\u043e\u0432\u043e",
"type": "main",
"index": 0
}
]
]
},
"\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441: \u0433\u043e\u0442\u043e\u0432\u043e": {
"main": [
[
{
"node": "\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u0432\u0438\u0434\u0435\u043e",
"type": "main",
"index": 0
}
]
]
},
"\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u0432\u0438\u0434\u0435\u043e": {
"main": [
[
{
"node": "\u041f\u0440\u0435\u0432\u044c\u044e: \u0432\u0438\u0434\u0435\u043e + \u043a\u043d\u043e\u043f\u043a\u0438",
"type": "main",
"index": 0
}
]
]
},
"\u041d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u0438\u0437 \u0440\u0435\u0447\u0438": {
"main": [
[
{
"node": "\u0418\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c (status = editing)",
"type": "main",
"index": 0
}
]
]
},
"\u041f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u043d\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443": {
"main": [
[
{
"node": "\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
B — Монтаж готов: тексты и подтверждение (Челлендж 200 дней). Uses httpRequest, googleSheets, googleDrive, telegram. Webhook trigger; 24 nodes.
Source: https://github.com/nikita-automation/content-publishing-pipeline/blob/main/workflows/B-edit-texts-approval.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.
WF_UNIFIED_LEGAL_AUTOMATION. Uses googleSheets, httpRequest, telegram, telegramTrigger. Webhook trigger; 53 nodes.
PsyCardv2. Uses executeCommand, telegram, readBinaryFile, googleDrive. Webhook trigger; 41 nodes.
This template monitors Google Drive folder for new files, extracts text from PDFs, images, text files, CSVs, and Google Docs., reads images with meta/llama-3.2-11b-vision-instruct, structures the resu
A — Приём и перевод (Челлендж 200 дней). Uses executeWorkflowTrigger, telegram, httpRequest, executeCommand. Event-driven trigger; 32 nodes.
This workflow is an AI-assisted clean plate and object removal pipeline built for modern VFX production environments. It transforms a single plate image and removal brief into multiple high-quality cl