{
  "id": "R8AH7Gqx4E3U5aqX",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Live- Automate Viral AI Video Production & Publishing with Gemini & Creatomate",
  "tags": [],
  "nodes": [
    {
      "id": "9f2d39f0-806e-45a3-a428-cee0df2a0bf2",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -2512,
        -688
      ],
      "parameters": {
        "options": {
          "topK": 40,
          "topP": 1,
          "temperature": 0.5,
          "safetySettings": {
            "values": [
              {
                "category": "HARM_CATEGORY_HARASSMENT",
                "threshold": "BLOCK_NONE"
              },
              {
                "category": "HARM_CATEGORY_HATE_SPEECH",
                "threshold": "BLOCK_NONE"
              },
              {
                "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
                "threshold": "BLOCK_NONE"
              },
              {
                "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
                "threshold": "BLOCK_NONE"
              }
            ]
          },
          "maxOutputTokens": 65536
        },
        "modelName": "models/gemini-2.0-flash"
      },
      "typeVersion": 1
    },
    {
      "id": "4a6a8224-37cc-401a-bcaf-2132b2b6458b",
      "name": "AI Agent - Create Image From Prompt",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2512,
        -832
      ],
      "parameters": {
        "text": "={{ $('Creating records in Scenes Table').item.json.fields[\"Image Prompt\"] }}",
        "options": {
          "systemMessage": "=You are an AI image\u2011prompt creation expert. Please create a post using the following JSON format:\nAI Image Generation Prompt Guidelines:\nObjective\nCreate highly realistic, high\u2010quality images\nEnsure the image content faithfully conveys the spirit of the original text\nIntegrate short text (10\u201320 characters) naturally into the image\nMaintain consistency and professionalism\n\nStandard Prompt Structure\n[Main Scene] | [Key Elements] | [Text Integration] | [Lighting & Atmosphere] | [Technical Parameters] | [Style Parameters]\n\nComponent Breakdown\n1. Main Scene (Weight ::8)\nDescribe the primary setting in line with the content.\nExamples:\nTech news: \u201cmodern tech office setting, minimalist workspace\u201d\nEconomy news: \u201cprofessional financial district, corporate environment\u201d\nEducation news: \u201cmodern classroom, advanced learning environment\u201d\n\n2. Key Elements (Weight ::8)\nList the main visual elements required.\nExamples:\n\u201clarge HD display showing text \u2018AI Ethics\u2019 in modern typography\u201d\n\u201cprofessional people in business attire discussing around interactive screen\u201d\n\u201cdetailed infographic elements floating in augmented reality style\u201d\n\n3. Text Integration (Weight ::7)\nHow to display text within the image:\ntext elements | elegant typography, clear readable text, integrated naturally into scene ::7\n\n4. Lighting & Atmosphere (Weight ::7)\nlighting | cinematic dramatic lighting, natural ambient light, professional studio setup ::7\nbackground | depth of field blur, clean professional environment ::6\n\n5. Technical Parameters\nparameters | 8k resolution, hyperrealistic, photorealistic quality, octane render, cinematic composition --ar 16:9\nsettings | sharp focus, high detail, professional photography --s 1000 --q 2\nComplete Examples\nExample\u00a01: AI Ethics News\nprofessional tech conference room | large display showing \"AI Ethics Now\" in modern typography, group of diverse executives in discussion ::8 | clean modern workspace, glass walls, tech atmosphere ::7 | cinematic lighting, natural window light ::7 | 8k resolution, hyperrealistic quality, octane render --ar 16:9 --s 1000 --q 2\nExample\u00a02: Financial Market News\nmodern stock exchange environment | giant LED wall showing \"Market Alert\" in bold typography, professional traders in action ::8 | dynamic financial data visualization, sleek modern interior ::7 | dramatic lighting, blue-tinted atmosphere ::7 | 8k resolution, photorealistic quality --ar 16:9 --s 1000 --q 2\n\nAdditional Parameters\n--chaos [0\u2013100]: Adjust randomness\n--stylize [0\u20131000]: Degree of stylization\n--seed [number]: Ensure consistency across generations\n--niji: Optimized for Asian\u2010style aesthetics\n--v 5.2: Use the latest model version\n\nImportant Notes\nText in Image\nKeep it short and legible\nUse professional fonts\nIntegrate naturally into the scene\n\nComposition\nFollow the rule of thirds\nEnsure a clear focal point\nBalance text and imagery\n\nColor\nMatch a professional tone\nProvide sufficient contrast for readability\nMaintain visual consistency\n\nTechnical Details\nAlways use high resolution (8k)\nEnsure professional lighting\nOptimize for sharpness and detail\n\nCommon Pitfalls to Avoid\nOverly generic prompts\nMissing text\u2010integration guidance\nFailing to specify composition rules\nOmitting key technical parameters\n\nThe structure is:\n{\n  prompt_image {prompt : \"\" , ...}\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "1865c8e4-d7f4-4e81-970d-c2e3efc23245",
      "name": "Code - Set Filename",
      "type": "n8n-nodes-base.code",
      "position": [
        -1728,
        -832
      ],
      "parameters": {
        "jsCode": "for (let i = 0; i < items.length; i++) {\n  items[i].json.fileName = `images_${(i + 1).toString().padStart(3, '0')}.png`;\n}\nreturn items;"
      },
      "typeVersion": 2
    },
    {
      "id": "dd4f01d5-e61f-49ca-bfec-55c739688a1b",
      "name": "Code - Get Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        -1952,
        -832
      ],
      "parameters": {
        "jsCode": "return $input.first().json.image_prompt.map(prompt => ({\n  json: {\n    body: {\n      prompt: prompt,\n  \"image_size\": {\n    \"width\": $('Setting Values for Image Model').first().json.width,\n    \"height\": $('Setting Values for Image Model').first().json.height\n  },\n  \"num_inference_steps\": 12,\n  \"guidance_scale\": 3.5,\n  \"num_images\": 1,\n  \"enable_safety_checker\": true,\n}\n    }\n  }\n));"
      },
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "d97e6223-0a9b-4f70-8e36-cd81d775eb8e",
      "name": "Code - Clean Json",
      "type": "n8n-nodes-base.code",
      "position": [
        -2176,
        -832
      ],
      "parameters": {
        "jsCode": "function cleanAndExtractJSON(response) {\n    try {\n        const result = {\n            image_prompt: []\n        };\n\n        const lines = response.split('\\n');\n        let currentPrompt = '';\n\n        for (const line of lines) {\n            if (line.includes('\"prompt\":')) {\n                if (currentPrompt) {\n                    result.image_prompt.push(currentPrompt.trim());\n                }\n                currentPrompt = line.split('\"prompt\":')[1].trim();\n            }\n        }\n\n        if (currentPrompt) {\n            result.image_prompt.push(currentPrompt.trim());\n        }\n\n        return { json: result };\n        \n    } catch (error) {\n        return { \n            json: {\n                image_prompt: []\n            }\n        };\n    }\n}\n\nconst response = $input.first().json.output;\nreturn cleanAndExtractJSON(response);"
      },
      "executeOnce": false,
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "3f7c02cd-a720-4e4a-a45f-c06ab484e7b1",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -2960,
        -848
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "aad89363-94a6-4e4a-b5cd-e693a8064071",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -3408,
        -848
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "output.scenes"
      },
      "typeVersion": 1
    },
    {
      "id": "57894828-b4dc-422c-9cea-e3b1c75e2cb0",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -4000,
        -256
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "50321720-3057-45dd-b0b1-994f7ce4d4f4",
      "name": "Content Brain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -4000,
        -416
      ],
      "parameters": {
        "text": "=Create a viral Technology & AI video script that reveals cutting-edge developments, hidden features, or game-changing applications. Focus on practical benefits viewers can use immediately. Include surprising insights about how AI is transforming daily life, work productivity, or future possibilities. Target tech enthusiasts and early adopters who want to stay ahead of trends.",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=# VIRAL CONTENT STRATEGIST\n## Expert in YouTube Shorts & Instagram Reels\n\nYou are an expert viral content strategist specializing in YouTube Shorts and Instagram Reels across high-value niches. Your expertise spans Technology & AI, Health & Fitness, Luxury & Travel, Motivation & Self-Improvement, and Educational content. You understand audience psychology, platform algorithms, and what drives engagement in each specific niche.\n\n## CONTENT SPECIFICATIONS\n- **Duration**: 45\u201350 seconds (150\u2013200 words total)\n- **Format**:Always 6 scenes optimized for attention retention\n- **Goal**: Maximum engagement, shares, saves, and monetization potential\n- **Style**: Hook-heavy, value-dense, shareable content\n\n## VIRAL CONTENT MASTERY\n\n### 1. HOOK PRINCIPLES\nStart with pattern interrupts, controversial statements, surprising statistics, or \"what if\" scenarios\n\n### 2. RETENTION TACTICS\nUse curiosity gaps, countdown formats, \"but here's what they don't tell you\" reveals\n\n### 3. VALUE DELIVERY\nProvide immediately actionable insights, insider secrets, or \"aha\" moments\n\n### 4. SOCIAL PROOF\nInclude credible sources, expert opinions, or surprising research findings\n\n### 5. ENGAGEMENT TRIGGERS\nEnd with questions, challenges, or \"try this and comment your results\"\n\n### 6. ALGORITHM OPTIMIZATION\nStructure for high completion rates, rewatches, and shares\n\n## NICHE-SPECIFIC EXPERTISE\n\n### TECHNOLOGY & AI\nFocus on practical applications, future implications, hidden features, and \"this changes everything\" moments\n\n### HEALTH & FITNESS\nEmphasize quick wins, science-backed methods, myth-busting, and immediate results\n\n### LUXURY & TRAVEL\nHighlight insider secrets, exclusive experiences, status symbols, and aspirational content\n\n### MOTIVATION & SELF-IMPROVEMENT\nUse transformation stories, mindset shifts, habit science, and personal development frameworks\n\n### EDUCATION/FACTS\nCreate \"mind-blown\" moments, historical surprises, science mysteries, and \"things that make you think\"\n\n## ADVANCED CONTENT STRATEGIES\n- Use psychological triggers (scarcity, social proof, authority, reciprocity)\n- Implement storytelling frameworks (problem-agitation-solution, before-after-bridge)\n- Create content loops that encourage rewatching\n- Design shareable moments that people want to send to friends\n- Build curiosity gaps that keep viewers engaged until the end\n\n## CONTENT FORMATTING RULES\n\n### TEXT GUIDELINES\n- **NO FORMATTING SYMBOLS**: Never use asterisks (*), double asterisks (**), underscores (_), or any markdown/formatting symbols in the spoken text\n- **NATURAL SPEECH**: Write exactly as someone would naturally speak - clean, conversational, and easy to read aloud\n- **NO EMPHASIS MARKERS**: Instead of using formatting for emphasis, use natural speech patterns like \"This is the key point\" or \"Here's what's incredible\"\n- **SMOOTH READING**: Text must flow naturally when read by text-to-speech or human narration\n\n### IMAGE PROMPT SPECIFICATIONS\n- **BACKGROUND VISUALS**: All image prompts are for background visuals that will appear behind the speaker in YouTube Shorts/Reels format\n- **VERTICAL ORIENTATION**: Design for 9:16 aspect ratio (phone screen format)\n- **VISUAL STORYTELLING**: Images should enhance and support the spoken content without distracting from it\n- **DYNAMIC CONTENT**: Use engaging, eye-catching visuals that complement the message\n- **BRAND APPROPRIATE**: Match the aesthetic and tone of the specific niche (luxury, tech, fitness, etc.)\n- **ACTION-ORIENTED**: Include movement, progression, or visual interest to maintain engagement\n\n## OUTPUT REQUIREMENT\nAlways return the response in the following exact JSON format:\n\n```json\n{\n  \"video_id\": \"VID-001\",\n  \"video_title\": \"Compelling, clickable title with emotional trigger (50-60 characters)\",\n  \"description\": \"Engaging caption with strategic hashtags and call-to-action (250-300 characters)\",\n  \"scenes\": [\n    {\n      \"scene_number\": 1,\n      \"text\": \"Exact spoken content optimized for natural speech rhythm, no formatting symbols, 18-28 words\",\n      \"image_prompt\": \"Vertical background visual for YouTube Short/Reel that enhances the message and fits niche aesthetic\"\n    }\n  ]\n}\n```\n\n## QUALITY CHECKLIST\nBefore finalizing content, ensure:\n- [ ] Text contains zero formatting symbols (*, **, _, etc.)\n- [ ] All text reads naturally when spoken aloud\n- [ ] Image prompts specify vertical/background format\n- [ ] Content follows viral engagement principles\n- [ ] Niche-specific strategies are implemented\n- [ ] JSON format is exact and valid"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "43beb7e4-bcb5-42eb-a85b-516828eed7ad",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -3824,
        -256
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"video_id\": \"VID-001\",\n  \"video_title\": \"Compelling, clickable title with emotional trigger (50-60 characters)\",\n  \"description\": \"Engaging caption with strategic hashtags and call-to-action (250-300 characters)\",\n  \"scenes\": [\n    {\n      \"scene_number\": 1,\n      \"text\": \"Exact spoken content optimized for natural speech rhythm (18-28 words)\",\n      \"image_prompt\": \"Specific visual description that enhances the message and fits the niche aesthetic\"\n    },\n    {\n      \"scene_number\": 2,\n      \"text\": \"Continuation of script with curiosity gap or key value point.\",\n      \"image_prompt\": \"Visual supporting this part of the narrative\"\n    },\n    {\n      \"scene_number\": 3,\n      \"text\": \"Third scene providing value, surprising fact, or practical insight.\",\n      \"image_prompt\": \"Visual to emphasize the fact or insight, aligned with niche aesthetic\"\n    },\n    {\n      \"scene_number\": 4,\n      \"text\": \"Further build-up with retention tactics or 'but here's what they don\u2019t tell you' reveal.\",\n      \"image_prompt\": \"Engaging, curiosity-sparking visual that adds drama\"\n    },\n    {\n      \"scene_number\": 5,\n      \"text\": \"Deliver key transformation, insight, or practical hack.\",\n      \"image_prompt\": \"Visual showcasing transformation or hack in a relatable way\"\n    },\n    {\n      \"scene_number\": 6,\n      \"text\": \"Strong climax with shocking fact, powerful insight, or credibility proof.\",\n      \"image_prompt\": \"High-impact visual, designed for maximum engagement\"\n    },\n    {\n      \"scene_number\": 7,\n      \"text\": \"Transition towards the ending with shareable moment or summarizing hook.\",\n      \"image_prompt\": \"Visual that feels clean and share-worthy\"\n    },\n    {\n      \"scene_number\": 8,\n      \"text\": \"Final call-to-action: encourage likes, shares, comments, or trying it themselves.\",\n      \"image_prompt\": \"Visually powerful ending background that fits CTA overlays\"\n    }\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "16dd8fc5-e84b-4e42-a12f-44ae63480d3d",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -4256,
        -416
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a1472269-c3f2-4f53-a3a6-e342c315ec52",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -704,
        -384
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "succeeded",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "47f960bc-72f7-4426-95de-89335536b607",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "succeeded"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "failed",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0887a3d0-4f56-4586-97de-e0c42c9fabc5",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "failed"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "being processed",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0facf4d6-acb0-4863-ac2d-7a78f9e9cbfe",
                    "operator": {
                      "type": "string",
                      "operation": "regex"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "(planned|transcribing|waiting|rendering)"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "6257ce29-c99c-4b44-a430-70b63bc4eac2",
      "name": "Stop and Error",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        -480,
        -368
      ],
      "parameters": {
        "errorMessage": "Failed Video Generation"
      },
      "typeVersion": 1
    },
    {
      "id": "7c866b16-17d1-4eb6-aeab-fd05f62a0d75",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2896,
        -16
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "7ff5142d-309b-4a12-9699-3e9ac55a0d20",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3216,
        -1136
      ],
      "parameters": {
        "color": 5,
        "width": 2336,
        "height": 496,
        "content": "## Image Generation  \n* Converts prompts into high-quality images using [Pollination AI](https://pollinations.ai/).\n* This is a **Free** to use API that you can integrate with any Image generation workflow\n* Prepares images with proper format and metadata for storage.\n* Uploads and links images directly into Airtable records.\n* Refer [Airtable Docs](https://airtable.com/developers/web/api/introduction) for more API calls!"
      },
      "typeVersion": 1
    },
    {
      "id": "9f87b01e-b340-4bbd-8346-502a85e10761",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4080,
        -640
      ],
      "parameters": {
        "color": 2,
        "width": 432,
        "height": 336,
        "content": "## AI Content Generation & Structuring\n* In **Content Brain**, we define detailed role instructions and prompt logic to generate viral, niche-specific video scripts.\n* You can also change the niche directly in the **prompt message** to target different industries or audiences.\n* In Structured Output Parser, we enforce a JSON schema to structure outputs into clean fields (title, description, scenes, image prompts)."
      },
      "typeVersion": 1
    },
    {
      "id": "d50985ab-a514-4070-9336-da7ab3e09dc0",
      "name": "Creating records in Scenes Table",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -3184,
        -848
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "{Your_Base_ID}",
          "cachedResultUrl": "https://airtable.com/{Your_Base_ID}",
          "cachedResultName": "Dynamic Video Content"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "{Your_Table_ID}",
          "cachedResultUrl": "https://airtable.com/{Your_Base_ID}/{YourTable_ID}",
          "cachedResultName": "Scenes"
        },
        "columns": {
          "value": {
            "Video ID": "={{ $json.output.video_id }}",
            "Scene Text": "={{ $json[\"output.scenes\"].text }}",
            "Description": "={{ $json.output.description }}",
            "Video Title": "={{ $json.output.video_title }}",
            "Image Prompt": "={{ $json[\"output.scenes\"].image_prompt }}",
            "Scene Number": "={{ $json[\"output.scenes\"].scene_number }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Image URL",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Image URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Scene Number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Scene Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Scene Text",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Scene Text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image Prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Image Prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Video ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Video ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Video Title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Video Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Generated Image",
              "type": "array",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Generated Image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "upsert"
      },
      "typeVersion": 2.1
    },
    {
      "id": "d0d6ef3b-9dec-4d15-af71-d03438795621",
      "name": "Setting Values for Image Model",
      "type": "n8n-nodes-base.set",
      "position": [
        -2704,
        -832
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4e04fec4-441e-45f7-acea-0017a4b5c104",
              "name": "model",
              "type": "string",
              "value": "flux"
            },
            {
              "id": "aa80cd68-1c82-4032-b1d7-e098856eec38",
              "name": "width",
              "type": "string",
              "value": "1080"
            },
            {
              "id": "da6d305f-aece-49bd-ae02-52df59915c60",
              "name": "height",
              "type": "string",
              "value": "1920"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4766b699-b631-483c-9d6c-ee625baf8559",
      "name": "Image Create Request - Pollination AI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1488,
        -832
      ],
      "parameters": {
        "url": "=https://image.pollinations.ai/prompt/ {{ $('Code - Get Prompt').item.json.body.prompt }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "jsonQuery": "={\n  \"width\": {{ $('Setting Values for Image Model').item.json.width }},\n  \"height\": {{ $('Setting Values for Image Model').item.json.height }},\n  \"model\": \"{{ $('Setting Values for Image Model').item.json.model }}\",\n  \"seed\": 42,\n  \"nologo\": true\n}",
        "sendQuery": true,
        "sendHeaders": true,
        "specifyQuery": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true,
      "waitBetweenTries": 5000
    },
    {
      "id": "fcbe297e-0d62-4812-8c28-67cea0443f88",
      "name": "Converting Image file for Storing",
      "type": "n8n-nodes-base.code",
      "position": [
        -1248,
        -832
      ],
      "parameters": {
        "jsCode": "// Get the first binary key dynamically\nconst binaryKey = Object.keys($input.item.binary || {})[0];\nif (!binaryKey) {\n  throw new Error(\"No binary data found on input item.\");\n}\n\nconst binary = $input.item.binary[binaryKey];\n\n// Convert binary to base64\nconst base64File = binary.data.toString('base64');\n\n// Build JSON payload for Airtable\nreturn [\n  {\n    json: {\n      contentType: binary.mimeType || \"image/jpeg\",\n      file: base64File,\n      filename: binary.fileName || \"upload.jpg\"\n    },\n    pairedItem: { item: 0 }   // \ud83d\udd11 keeps mapping to original input\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "a134b3a8-c07b-48c1-9762-03e177e5a02a",
      "name": "Uploading Image in Airtable",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1056,
        -832
      ],
      "parameters": {
        "url": "=https://content.airtable.com/v0/{Your_Base_ID}/{{ $('Loop Over Items').item.json.id }}/Generated_Image/uploadAttachment",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "contentType",
              "value": "={{$json[\"contentType\"]}}"
            },
            {
              "name": "file",
              "value": "={{$json[\"file\"]}}"
            },
            {
              "name": "filename",
              "value": "={{$json[\"filename\"]}}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6b2f3a3c-dfd7-4ced-87f9-6ffee28eb949",
      "name": "Get Records for Airtable",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2672,
        -368
      ],
      "parameters": {
        "url": "https://api.airtable.com/v0/{Your_Base_ID}/{Your_Table_ID}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer {Your_Airtable_Personal_Access_Token}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "fdc235fd-9590-4597-be6c-42930d34f9bd",
      "name": "Cleaning Airtable Output",
      "type": "n8n-nodes-base.code",
      "position": [
        -2464,
        -368
      ],
      "parameters": {
        "jsCode": "// Flatten records (from first item only)\nlet records = items[0].json.records;\n\n// Sort by Video Title, then Scene Number\nrecords.sort((a, b) => {\n  if (a.fields[\"Video Title\"] < b.fields[\"Video Title\"]) return -1;\n  if (a.fields[\"Video Title\"] > b.fields[\"Video Title\"]) return 1;\n  return a.fields[\"Scene Number\"] - b.fields[\"Scene Number\"];\n});\n\n// Ensure Video Title stays as plain text (not array)\nrecords.forEach(r => {\n  if (Array.isArray(r.fields[\"Video Title\"])) {\n    r.fields[\"Video Title\"] = r.fields[\"Video Title\"][0];\n  }\n});\n\n// Return sorted items WITH pairedItem reference\nreturn records.map((r, index) => ({\n  json: r,\n  pairedItem: { item: 0 } // since everything came from items[0]\n}));\n"
      },
      "typeVersion": 2
    },
    {
      "id": "17bbb89e-f9de-47a9-ad54-0c85a4a10acc",
      "name": "Filter - Latest Video file",
      "type": "n8n-nodes-base.filter",
      "position": [
        -2240,
        -368
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "18881ce5-ab42-4aed-b7e8-7fd1f141b5f9",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.fields['Video Title'] }}",
              "rightValue": "={{ $('Creating records in Scenes Table').item.json.fields['Video Title'] }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "43a23e03-0523-4f88-993a-a2414d8f0d67",
      "name": "Preparing for Creatomate",
      "type": "n8n-nodes-base.code",
      "position": [
        -1904,
        -368
      ],
      "parameters": {
        "jsCode": "// Collect all records from previous node\nlet records = items.map(item => item.json);\n\n// Sort by Scene Number (ascending)\nrecords.sort((a, b) => a.fields[\"Scene Number\"] - b.fields[\"Scene Number\"]);\n\n// Build output object\nlet output = {};\n\n// Loop through scenes dynamically\nrecords.forEach((rec, index) => {\n  const sceneNum = index + 1;\n\n  // Get full image URL from Airtable attachment field\n  let fullImageUrl = null;\n  if (rec.fields[\"Generated_Image\"] && rec.fields[\"Generated_Image\"].length > 0) {\n    const attachment = rec.fields[\"Generated_Image\"][0]; // take the first attachment\n    if (attachment.thumbnails && attachment.thumbnails.full) {\n      fullImageUrl = attachment.thumbnails.full.url;\n    } else {\n      // fallback to main URL if full not available\n      fullImageUrl = attachment.url;\n    }\n  }\n\n  output[`Image-${sceneNum}`] = fullImageUrl;\n  output[`Text-${sceneNum}`] = rec.fields[\"Scene Text\"];\n});\n\n// Add Title (from first record)\noutput[\"Title\"] = records[0].fields[\"Video Title\"];\n\n// Add Description (from first record \u2014 assuming all rows of same video have same description)\noutput[\"Description\"] = records[0].fields[\"Description\"];\n\n// Return single object\nreturn [{ json: output }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "3bff1af0-f8c3-4ff3-aa80-afd165f77fc8",
      "name": "Template for Creatomate",
      "type": "n8n-nodes-base.code",
      "position": [
        -1648,
        -368
      ],
      "parameters": {
        "jsCode": "// Input: an array with one object that contains dynamic Image-X and Text-X fields\n// Output: JSON body ready for API\n\nconst input = items[0].json;\n\nconst templateId = \"a3c6da16-0b93-4d89-8777-5ec2c1485f23\";\nconst modifications = {};\n\n// Loop through input keys (Image-1, Text-1, etc.)\nObject.keys(input).forEach(key => {\n  if (key.startsWith(\"Image-\")) {\n    const index = key.split(\"-\")[1];\n    modifications[`Image-${index}.source`] = input[key];\n  }\n  if (key.startsWith(\"Text-\")) {\n    const index = key.split(\"-\")[1];\n    modifications[`Voiceover-${index}.source`] = input[key];\n  }\n});\n\n// Build final body\nconst body = {\n  template_id: templateId,\n  modifications: modifications\n};\n\nreturn [\n  {\n    json: body\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "275e939e-e7a0-4c15-aed8-81d699a875ab",
      "name": "Video Rendering -  Creatomate",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1360,
        -368
      ],
      "parameters": {
        "url": "https://api.creatomate.com/v2/renders",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"template_id\": \"a3c6da16-0b93-4d89-8777-5ec2c1485f23\",\n  \"width\": 720,\n  \"height\": 1280,\n  \"frame_rate\": 30,\n  \"render_scale\": 1,\n  \"modifications\": {{ JSON.stringify($json.modifications) }}\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer {Your_Creatomate_API_Key}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4d15c9e8-0ad8-4e4e-980a-a47a82beffaa",
      "name": "Wait - 60 secs",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1120,
        -368
      ],
      "parameters": {
        "amount": 60
      },
      "typeVersion": 1.1
    },
    {
      "id": "0977be6b-c0df-404d-97df-7619c484b2a7",
      "name": "Set Video Title and Description",
      "type": "n8n-nodes-base.set",
      "position": [
        -3424,
        -32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cd8f9968-0a87-409e-ae11-daedf42a1301",
              "name": "output.video_title",
              "type": "string",
              "value": "={{ $json.output.video_title }}"
            },
            {
              "id": "06d3ec23-27df-458e-92a8-d2412665dd7e",
              "name": "output.description",
              "type": "string",
              "value": "={{ $json.output.description }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2f473649-572f-4797-a058-dc5e2cd46878",
      "name": "Clean - Details",
      "type": "n8n-nodes-base.code",
      "position": [
        -3168,
        -32
      ],
      "parameters": {
        "jsCode": "// Flatten all incoming items\nreturn items.map(item => {\n  return {\n    json: {\n      video_title: item.json.output.video_title,\n      description: item.json.output.description\n    }\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "a9613ebf-4cf1-4682-9c9a-29a8868983b7",
      "name": "Merging Complete Video Details",
      "type": "n8n-nodes-base.code",
      "position": [
        -2688,
        -16
      ],
      "parameters": {
        "jsCode": "// Merge every two items (text + metadata) into one object\nconst merged = [];\n\nfor (let i = 0; i < items.length; i += 2) {\n  const obj1 = items[i]?.json || {};\n  const obj2 = items[i + 1]?.json || {};\n\n  merged.push({\n    json: {\n      ...obj1,\n      ...obj2\n    }\n  });\n}\n\nreturn merged;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "c37b26dc-d12a-440d-a954-c55f6308299c",
      "name": "Get Video Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -912,
        -368
      ],
      "parameters": {
        "url": "=https://api.creatomate.com/v2/renders/{{ $json.id }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer {Your_Creatomate_API_Key}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d52ff3fa-173e-46af-a80f-404e98022672",
      "name": "Get complete Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2480,
        -16
      ],
      "parameters": {
        "url": "={{ $json.url }} ",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "e0e91192-8b9c-4824-ac8c-da8a74253d28",
      "name": "Upload on Instagram",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2096,
        176
      ],
      "parameters": {
        "url": "https://api.upload-post.com/api/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "title",
              "value": "={{ $json.video_title }}\n\n{{ $json.description }}"
            },
            {
              "name": "user",
              "value": "@yourusername"
            },
            {
              "name": "platform[]",
              "value": "instagram"
            },
            {
              "name": "video",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Apikey {Your_Upload_Post_API_Key}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "934db3e9-9d06-4c68-ac9f-26130877e832",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2752,
        -1040
      ],
      "parameters": {
        "color": 2,
        "width": 528,
        "height": 304,
        "content": "## Image Prompt & Attributes\n* In **Setting Values for Image Model**, we define key attributes like model type, width, and height for image generation.\n* In **AI Agent - Create Image From Prompt**, we enhance and structure the raw text into a professional, detailed image prompt following best-practice guidelines.\n* This prepares the output in a consistent format, making it ready for seamless use in the **Pollination API call**."
      },
      "typeVersion": 1
    },
    {
      "id": "047e5730-4833-440a-ab7c-8ade0445a171",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1552,
        -1040
      ],
      "parameters": {
        "color": 3,
        "width": 624,
        "height": 304,
        "content": "## Image Generation & Storage\n* **Image Create Request \u2013 Pollination AI** \u2192 Generates images from prompts using defined model settings. \n* **Converting Image file for Storing** \u2192 Converts the image to Base64 with metadata for safe transfer.\n* **Uploading Image in Airtable** \u2192 Saves the generated image as an attachment in Airtable records in the **Scenes** Table"
      },
      "typeVersion": 1
    },
    {
      "id": "6b247893-39b2-4a6f-910c-5db946684629",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2192,
        -1040
      ],
      "parameters": {
        "color": 4,
        "width": 592,
        "height": 304,
        "content": "## Image Prompt Processing & File Setup\n* In **Clean Json**, we extract and sanitize the raw AI response to get clean image prompts.\n* In **Get Prompt**, we structure each image prompt with model attributes (width, height, steps, guidance) for image generation.\n* In **Set Filename**, we assign unique, sequential filenames to each generated image (e.g., images_001.png)."
      },
      "typeVersion": 1
    },
    {
      "id": "53339334-83ce-4646-9d1e-6e2833e073c8",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3488,
        -176
      ],
      "parameters": {
        "color": 6,
        "width": 448,
        "height": 240,
        "content": "## Video Metadata Handling\n* **Set Video Title and Description** \u2192 Extracts video_title and description from the output and saves them.\n* **Clean \u2013 Details** \u2192 Flattens and cleans metadata so only plain text values are passed forward."
      },
      "typeVersion": 1
    },
    {
      "id": "13b3ee62-dceb-4b54-88be-a4ddda00d05b",
      "name": "Create Record in Video Table",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -3456,
        -416
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "{Your_Base_ID}",
          "cachedResultUrl": "https://airtable.com/{Your_Base_ID}",
          "cachedResultName": "Dynamic Video Content"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "{Your_Videos_Table_ID}",
          "cachedResultUrl": "https://airtable.com/{Your_Base_ID}/{Your_Videos_Table_ID}",
          "cachedResultName": "Videos"
        },
        "columns": {
          "value": {
            "Video ID": "={{ $json.output.video_id }}",
            "Description": "={{ $json.output.description }}",
            "Video Title": "={{ $json.output.video_title }}",
            "Ready to Process": false
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Video Title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Video Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Video ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Video ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Idea",
                  "value": "Idea"
                },
                {
                  "name": "Script Generated",
                  "value": "Script Generated"
                },
                {
                  "name": "Scenes Created",
                  "value": "Scenes Created"
                },
                {
                  "name": "Images Ready",
                  "value": "Images Ready"
                },
                {
                  "name": "Video Rendered",
                  "value": "Video Rendered"
                },
                {
                  "name": "Published",
                  "value": "Published"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Ready to Process",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Ready to Process",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Modified",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Last Modified",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Video Link",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Video Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Total Scenes",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Total Scenes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Scenes",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Scenes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Scenes 2",
              "type": "array",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Scenes 2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "upsert"
      },
      "typeVersion": 2.1
    },
    {
      "id": "a00265d1-c17a-485a-9788-510df0909e41",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2736,
        -544
      ],
      "parameters": {
        "color": 3,
        "width": 688,
        "height": 272,
        "content": "## Image Prompt Processing & File Setup\n* **Get Records for Airtable** \u2192 Fetches records from Airtable using your API key. Make sure to update the **base ID**, **table ID**, and **token** before use.\n* **Cleaning Airtable** \u2192 Sorts records by Video Title and Scene Number, and ensures clean text formatting.\n* **Filter** \u2013 Latest Video file \u2192 Filters records to only keep the latest video entry matching the active workflow\u2019s video title."
      },
      "typeVersion": 1
    },
    {
      "id": "db42d00f-e48e-45e1-b026-145ff728086a",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        -560
      ],
      "parameters": {
        "color": 6,
        "width": 528,
        "height": 304,
        "content": "## Preparing Video Template (Creatomate)\n* **Preparing for Creatomate** \u2192 Collects scene data from Airtable, sorts by Scene Number, and maps each scene\u2019s text + image into a structured JSON object (Title, Description, Image-X, Text-X).\n* **Template for Creatomate** \u2192 Converts that structured JSON into the required Creatomate template format with modifications (Image-X \u2192 image sources, Text-X \u2192 voiceover text). Update the template_id to match your own Creatomate template."
      },
      "typeVersion": 1
    },
    {
      "id": "46e76eb0-6dcf-4c60-81a5-15ee1fa34404",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        -560
      ],
      "parameters": {
        "color": 2,
        "width": 624,
        "height": 288,
        "content": "## Video Rendering & Status Check (Creatomate)\n* **Video Rendering** \u2013 Creatomate \u2192 Sends the template + modifications to Creatomate API to generate the final video. \n* Update the API key and template_id as needed. Configure output settings (resolution, frame rate, scale).\n* **Wait** \u2013 60 secs \u2192 Pauses the workflow to allow rendering to complete. Adjust wait time based on video length.\n* **Get Video Status** \u2192 Checks the rendering status using the video\u2019s render ID."
      },
      "typeVersion": 1
    },
    {
      "id": "a5ea8cd4-604a-4e86-b33b-c1e1e2a6f90e",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3216,
        -528
      ],
      "parameters": {
        "color": 5,
        "width": 432,
        "height": 240,
        "content": "## Video Generation Workflow\n* Refer [Airtable Docs](https://airtable.com/developers/web/api/introduction) for more Get Records API\n* Creatomate provides **50 Free** credits on a new account \n* Refer [Creatomate](https://creatomate.com/blog/how-to-create-videos-with-ai-voice-overs-using-n8n) for the usage of Template of your choice.\n* Create an account of [ElevenLabs](https://elevenlabs.io/app/developers) and create an API and integrate it with Creatomate\n* **ElevenLabs** provides **10,000** credits each month in a free account."
      },
      "typeVersion": 1
    },
    {
      "id": "06c37fde-8377-48e3-a9ba-967455dfc8a1",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2928,
        -160
      ],
      "parameters": {
        "color": 3,
        "width": 576,
        "height": 240,
        "content": "## Video Metadata Handling\n* **Merge** \u2192 Combines different data streams (e.g., text + metadata) into one object.\n* **Get Complete Video** \u2192 Fetches the final rendered video file as **Creatomate** provide shareable Video URL"
      },
      "typeVersion": 1
    },
    {
      "id": "68128cd0-9435-4fed-8e1e-39792cd76b17",
      "name": "Upload on YouTube",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -2096,
        -80
      ],
      "parameters": {
        "title": "={{ $json.video_title }}",
        "options": {
          "description": "={{ $json.description }}"
        },
        "resource": "video",
        "operation": "upload",
        "categoryId": "27",
        "regionCode": "IN"
      },
      "typeVersion": 1
    },
    {
      "id": "95879a79-2996-40de-bc74-82bb64467bab",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1920,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "height": 256,
        "content": "## Upload on YouTube\n* **Purpose** \u2192 Publishes the final rendered video directly to your connected YouTube channel.\n* **Inputs Used** \u2192 video_title (title) and description (from earlier workflow steps).\n* Settings \u2192 Region set to IN (India).\nCategory set to 27 (Education, can be changed).\n* **Authentication** \u2192 Requires a connected YouTube OAuth2 account. Refer [Google Console](https://console.cloud.google.com/marketplace/product/google/youtube.googleapis.com?q=search&referrer=search&project=youtube-social-471006)"
      },
      "typeVersion": 1
    },
    {
      "id": "b83f05cd-caec-49bc-8abb-874e9e2607dd",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1920,
        144
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "height": 256,
        "content": "## Upload on Instagram (via Upload-Post API)\n* **Purpose** \u2192 Publishes the generated video to Instagram using Upload-Post.com API.\n* You can add multiple platforms (twitter, facebook, linkedin, snapchat) in the platform[] field.\n* **API Limit** \u2192 Upload-Post.com offers **10 free** API calls/month.\n* Refer [Upload Docs](https://docs.upload-post.com/api/upload-video) for more API features."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "66de249b-3216-4aa4-9f37-d6e19f0b7ea0",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Merging Complete Video Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait - 60 secs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Creating records in Scenes Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Content Brain": {
      "main": [
        [
          {
            "node": "Set Video Title and Description",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create Record in Video Table",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait - 60 secs": {
      "main": [
        [
          {
            "node": "Get Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean - Details": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Get Records for Airtable",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Setting Values for Image Model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video Status": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Clean Json": {
      "main": [
        [
          {
            "node": "Code - Get Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Get Prompt": {
      "main": [
        [
          {
            "node": "Code - Set Filename",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get complete Video": {
      "main": [
        [
          {
            "node": "Upload on Instagram",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload on YouTube",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Set Filename": {
      "main": [
        [
          {
            "node": "Image Create Request - Pollination AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Template for Creatomate": {
      "main": [
        [
          {
            "node": "Video Rendering -  Creatomate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cleaning Airtable Output": {
      "main": [
        [
          {
            "node": "Filter - Latest Video file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Records for Airtable": {
      "main": [
        [
          {
            "node": "Cleaning Airtable Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Content Brain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Preparing for Creatomate": {
      "main": [
        [
          {
            "node": "Template for Creatomate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Content Brain",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Create Image From Prompt",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Filter - Latest Video file": {
      "main": [
        [
          {
            "node": "Preparing for Creatomate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Uploading Image in Airtable": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video Rendering -  Creatomate": {
      "main": [
        [
          {
            "node": "Wait - 60 secs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merging Complete Video Details": {
      "main": [
        [
          {
            "node": "Get complete Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setting Values for Image Model": {
      "main": [
        [
          {
            "node": "AI Agent - Create Image From Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Video Title and Description": {
      "main": [
        [
          {
            "node": "Clean - Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creating records in Scenes Table": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Converting Image file for Storing": {
      "main": [
        [
          {
            "node": "Uploading Image in Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Create Image From Prompt": {
      "main": [
        [
          {
            "node": "Code - Clean Json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Content Brain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Create Request - Pollination AI": {
      "main": [
        [
          {
            "node": "Converting Image file for Storing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}