{
  "nodes": [
    {
      "id": "04630cd6-316e-4f17-aa82-15f4e11505e0",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1248,
        704
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 12
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cd4940a2-a814-4742-9c9f-91496d7d0f44",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        1472,
        704
      ],
      "parameters": {
        "jsCode": "const randomNumber = Math.floor(Math.random() * 7) + 1;\nreturn { json: { randomNumber } };"
      },
      "typeVersion": 2
    },
    {
      "id": "5074ac13-50f1-4ebe-a99a-1977a2926e78",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1696,
        704
      ],
      "parameters": {
        "text": "=Generate a (title, description, and prompt) for template number: {{ $json.randomNumber }}. \nReturn only valid minified JSON that matches the required schema.\n",
        "options": {
          "systemMessage": "You are an AI that creates short-form video ideas in the style of funny home ring-camera recordings featuring pets and humans.\n\nYour ONLY output must strictly follow this JSON structure:\n{\n  \"title\": \"short, funny, descriptive title\",\n  \"description\": \"1\u20133 sentences summarizing the scene\",\n  \"prompt\": \"AI video generation prompt here\"\n}\n\nGuidelines:\n- Titles must be eye-catching yet natural.\n- Keep the humor family-safe.\n- Avoid violence or night vision scenes.\n- Describe camera angles realistically (doorbell camera, living room cam, etc).\n- Output only valid JSON - no commentary.\n\nPrimary Video Types:\n1. Cat snitching on dog for tearing the couch.\n2. Dog panicking when robot vacuum turns on.\n3. Parrot imitating the doorbell and confusing everyone.\n4. Cat attacking its own reflection.\n5. Puppy rolling off a small couch while playing.\n6. Cat knocking over a plant, then hiding in panic.\n7. Dog pretending to sleep when called for bath time."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3
    },
    {
      "id": "791dc6ad-f49a-4409-afa4-f52a0e2e7d2b",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1520,
        880
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "92ca853f-1cde-479c-94d5-cf3638063ead",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1792,
        912
      ],
      "parameters": {
        "autoFix": true,
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"title\": { \"type\": \"string\" },\n    \"description\": { \"type\": \"string\" },\n    \"prompt\": { \"type\": \"string\" }\n  },\n  \"required\": [\"title\", \"description\", \"prompt\"],\n  \"additionalProperties\": false\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "2feb3043-e2f2-4854-8737-9a1758a67a33",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        2368,
        640
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "e6105bf5-3d83-488e-b6d1-7d3cdf02049a",
      "name": "Get",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2592,
        640
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/jobs/recordInfo",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "recordId",
              "value": "=={{ $node[\"create video\"].json.data.recordId }}"
            },
            {
              "name": "taskId",
              "value": "=={{ $node[\"create video\"].json.data.taskId }}"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "adea8f9d-ba9f-426f-8b69-2bd4f69e9817",
      "name": "Upload media1",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        2816,
        640
      ],
      "parameters": {
        "mediaUrl": "={{ JSON.parse($json.data.resultJson).resultUrls[0] }}",
        "resource": "media"
      },
      "typeVersion": 2
    },
    {
      "id": "224216a0-c02f-49e2-abe4-7a1531ae340e",
      "name": "Create post1",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        3040,
        640
      ],
      "parameters": {
        "options": {},
        "platform": "youtube",
        "accountId": "YOUR_ACCOUNT_ID",
        "postContentText": "={{ $node[\"AI Agent\"].json.output.description }}",
        "postContentMediaUrls": "={{ $json.url }}",
        "postCreateYoutubeOptionTitle": "={{ $node[\"AI Agent\"].json.output.title }}",
        "postCreateYoutubeOptionContainsSyntheticMedia": true
      },
      "typeVersion": 2
    },
    {
      "id": "9fd8e17e-f924-4d95-b7b4-c6924d9d2bae",
      "name": "create video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2144,
        640
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/jobs/createTask",
        "method": "POST",
        "options": {},
        "jsonBody": "https://example.com/callback",
        "sendBody": true,
        "jsonHeaders": "https://example.com/callback",
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "specifyHeaders": "json",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.3
    },
    {
      "id": "09e61eaa-37af-4ea5-969d-23bc88780747",
      "name": "Instagram",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        3264,
        640
      ],
      "parameters": {
        "options": {},
        "accountId": "YOUR_ACCOUNT_ID",
        "postContentText": "={{ $node[\"AI Agent\"].json.output.description }}",
        "postContentMediaUrls": "={{ $json.url }}"
      },
      "typeVersion": 2
    },
    {
      "id": "f20524f3-f843-4d85-9efd-bbdbc36cbe2e",
      "name": "Youtube",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        3264,
        448
      ],
      "parameters": {
        "options": {},
        "platform": "youtube",
        "accountId": "YOUR_ACCOUNT_ID",
        "postContentText": "={{ $node[\"AI Agent\"].json.output.description }}",
        "postContentMediaUrls": "={{ $json.url }}",
        "postCreateYoutubeOptionTitle": "={{ $node[\"AI Agent\"].json.output.title }}",
        "postCreateYoutubeOptionContainsSyntheticMedia": true
      },
      "typeVersion": 2
    },
    {
      "id": "2733308f-5cca-48e0-9716-ffcd046042af",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2096,
        96
      ],
      "parameters": {
        "color": 5,
        "width": 592,
        "height": 848,
        "content": "# Create Video\n\n### AI Video Generation (KIE AI)\n\nThis section converts the text prompt into an actual AI-generated video.\n\nCreate Video sends the prompt to KIE AI.\n\nWait pauses the workflow until rendering is complete.\n\nGet Video retrieves the final video URL.\n\nAdjust aspect ratio, frame count, and other KIE AI settings inside the Create Video node.\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "47605c90-c76a-4741-ad35-6d0432386798",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2736,
        -64
      ],
      "parameters": {
        "color": 3,
        "width": 1056,
        "height": 1296,
        "content": "# Auto-Post\n\n## Automatic Multi-Platform Publishing\n\nThis section uploads your finished video and posts it across multiple social networks.\n\nUpload Media sends the file to Blotato.\n\nCreate Post publishes the content to your connected channels.\n\nSupports YouTube, Instagram, LinkedIn, TikTok, Facebook, X, and more (depending on your Blotato setup).\n\nTo publish on additional platforms, duplicate the post node and change the platform setting.\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "71229fa2-71e6-4f5b-9675-f992ebf8464e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -96
      ],
      "parameters": {
        "color": 6,
        "width": 784,
        "height": 1264,
        "content": "## Overview\n\nThis workflow automatically creates short AI-generated videos and publishes them across multiple social platforms without any manual work. It is built for creators, marketers, and automation builders who need consistent and scalable content production.\n\n## Who This Workflow Is For\n\nAnyone managing social media channels, short-form content pages, automated posting systems, or AI-powered media pipelines. Ideal for YouTubers, Instagram creators, LinkedIn content teams, automation agencies, and businesses that post frequent updates.\n\n## What This Workflow Does\n\n1. Generates a random creative concept\n2. Uses Google Gemini to produce a structured title, description, and video prompt\n3. Sends the prompt to KIE AI for Sora-style video generation\n4. Polls the API until the video is fully rendered\n5. Uploads the final video to Blotato\n6. Automatically posts it across multiple social platforms\n\n## How It Works\n\nThe scheduler initiates the workflow.\nJavaScript selects a random template index.\nGemini generates structured JSON (title, description, prompt).\nKIE AI converts the prompt into a generated video.\nAfter rendering completes, the workflow retrieves the video.\nBlotato uploads and publishes the video across selected platforms.\n\n## Requirements\n\n1. Google Gemini API key\n2. KIE AI API credential\n3. Blotato social posting account\n4. Self-hosted n8n instance (required for community nodes)\n\n## Customization Ideas\n\n1. Add more scene or prompt templates\n2. Adjust the schedule frequency\n3. Add TikTok, Facebook, X, or other Blotato-supported platforms\n4. Integrate notifications (Telegram, Discord, Slack)\n5. Store logs in Google Sheets or Notion\n\n## \u26a0\ufe0f Important\n\nThis workflow uses the Blotato community node.\nCommunity nodes work only on **self-hosted n8n**, not n8n Cloud.\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "bd398354-e36c-45f3-82e9-fcec0febe66d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        96
      ],
      "parameters": {
        "color": 4,
        "width": 880,
        "height": 928,
        "content": "# Script Video\n\n## Script Video Generator\n\nThis section generates the text content and prompt for your video.\n\nThe Schedule Trigger controls how often the workflow runs.\n\nJavaScript code selects a random template index.\n\nThe AI Agent (Gemini) creates the title, description, and detailed video prompt.\n\nThe Structured Output Parser ensures the output is always valid JSON.\n\nModify the Gemini system prompt here to adjust how your concepts are generated.\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9e801750-1482-434e-8192-f46229c6fb93",
      "name": "LinkedIn2",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        3264,
        1088
      ],
      "parameters": {
        "options": {},
        "platform": "twitter",
        "accountId": "YOUR_ACCOUNT_ID",
        "postContentText": "={{ $node[\"AI Agent\"].json.output.description }}",
        "postContentMediaUrls": "={{ $json.url }}"
      },
      "typeVersion": 2
    },
    {
      "id": "f892e737-abd0-44bc-9575-113d26f1f9e0",
      "name": "Bluesky",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        3264,
        240
      ],
      "parameters": {
        "options": {},
        "platform": "bluesky",
        "accountId": "YOUR_ACCOUNT_ID",
        "postContentText": "={{ $node[\"AI Agent\"].json.output.description }}",
        "postContentMediaUrls": "={{ $json.url }}"
      },
      "typeVersion": 2
    },
    {
      "id": "5f14f21e-9548-4b50-b91e-8a8dcc4f2fae",
      "name": "Facebook",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        3264,
        832
      ],
      "parameters": {
        "options": {},
        "platform": "facebook",
        "accountId": "YOUR_ACCOUNT_ID",
        "facebookPageId": "YOUR_FACEBOOK_PAGE_ID",
        "postContentText": "={{ $node[\"AI Agent\"].json.output.description }}",
        "postContentMediaUrls": "={{ $json.url }}"
      },
      "typeVersion": 2
    },
    {
      "id": "153d9f77-53f7-478a-b8f7-c55b21680633",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        1184
      ],
      "parameters": {
        "width": 576,
        "height": 784,
        "content": "# Fields You Must Configure Before Running\n\nEdit the following nodes before activating:\n\n### 1. API Credentials\n\n1.1 Add your Google Gemini API key\n1.2 Add your KIE AI API credential\n1.3 Add your Blotato API credential\n\n### 2. Blotato Channels\n\n2.1 Open each posting node\n2.2 Select or replace platform account IDs\n\n### 3. KIE AI Settings\n\n3.1 aspect_ratio\n3.2 n_frames\n3.3 Watermark removal\n3.4 Model choice\n\n### 4. Schedule\n\n4.1 Change frequency based on your posting needs\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c91f68c0-31a5-4774-b596-98e894505a47",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2112,
        1152
      ],
      "parameters": {
        "color": 6,
        "width": 576,
        "height": 784,
        "content": "\n\n# Tips for Best Results\n\nTest manually once before activating.\n\nVerify that video uploads correctly in Blotato.\n\nCheck that titles and descriptions are being passed properly.\n\nKeep your KIE AI credit balance topped up.\n\nAdd logging if you plan to run the workflow at high frequency.\n\n---\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Get": {
      "main": [
        [
          {
            "node": "Upload media1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Get",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "create video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create post1": {
      "main": [
        [
          {
            "node": "Youtube",
            "type": "main",
            "index": 0
          },
          {
            "node": "Facebook",
            "type": "main",
            "index": 0
          },
          {
            "node": "Instagram",
            "type": "main",
            "index": 0
          },
          {
            "node": "Bluesky",
            "type": "main",
            "index": 0
          },
          {
            "node": "LinkedIn2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create video": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload media1": {
      "main": [
        [
          {
            "node": "Create post1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}