{
  "name": "TEST_Child",
  "nodes": [
    {
      "parameters": {
        "inputSource": "passthrough"
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        -240,
        144
      ],
      "id": "7600028c-33bb-4607-91aa-93b9262a623d",
      "name": "When Executed by Another Workflow"
    },
    {
      "parameters": {
        "batchSize": "=1",
        "options": {
          "reset": false
        }
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        256,
        144
      ],
      "id": "77daf7d6-0e5d-416a-8ecc-cd35c6e21d4e",
      "name": "Loop Over Items1",
      "alwaysOutputData": false
    },
    {
      "parameters": {
        "resource": "image",
        "prompt": "={{ $json.output.substring(0, 999) }}",
        "options": {},
        "requestOptions": {}
      },
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        1360,
        400
      ],
      "id": "d511a215-ae0e-46dc-9580-2629d3ec4982",
      "name": "G\u00f6rsel \u00dcretimi",
      "disabled": true
    },
    {
      "parameters": {
        "operation": "write",
        "fileName": "={{ $('Edit Fields2').item.json.ImagePath }}",
        "options": {}
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1,
      "position": [
        1440,
        592
      ],
      "id": "ecc332c8-caa6-4a0c-b66a-1bba338c3cc4",
      "name": "Read/Write Files from Disk",
      "disabled": true
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=content: {{ $('Loop Over Items1').item.json.output.slides.content }}",
        "options": {
          "systemMessage": "You are an elite visual prompt engineer for professional educational video production.\n\n## YOUR TASK\nProduce exactly one image-generation prompt (single paragraph, max 950 characters) per scene.\n\nNo text, letters, numbers, words, logos, trademarks, watermarks, signage, or UI elements anywhere in the image. All signs, screens, labels, and apparel completely blank."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.1,
      "position": [
        720,
        400
      ],
      "id": "f119b18a-dc52-43a9-8602-cf2e3b11f9b9",
      "name": "G\u00f6rsel Prompt \u00dcretimi"
    },
    {
      "parameters": {
        "fieldToSplitOut": "output.slides",
        "include": "allOtherFields",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        48,
        144
      ],
      "id": "bfdbfbe4-4f1d-4d09-ac56-c3e371a855e0",
      "name": "Split Out"
    },
    {
      "parameters": {
        "content": "# LOOP 2\n",
        "height": 816,
        "width": 1696,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "fceec5d0-3f58-4fea-bc46-3d0a157846d5",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "# G\u00f6rsel \u00dcretimi",
        "height": 480,
        "width": 1408,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        288,
        336
      ],
      "id": "55d31157-2a29-4049-876d-0e3b38ff18df",
      "name": "Sticky Note5",
      "disabled": true
    },
    {
      "parameters": {
        "content": "# Video \u00dcretimi",
        "height": 224,
        "width": 384,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        0
      ],
      "typeVersion": 1,
      "id": "17a9b0c9-293b-4998-b772-853b34b5e7f1",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "jsCode": "const konuId = $('Split Out').first().json.KonuId;\nconst slideCount = $('Split Out').first().json.SlideCount;\nconst saniyeBundle = $('Split Out').first().json.SaniyeBundle;\n\nconst base = \"C:/Users/busra/OneDrive/Desktop/AlevPenceOtomasyonu/Proje/Konular\";\nconst konuPath = `${base}/Konu${konuId}`;\nconst imgDir = `${konuPath}/G\u00f6rseller`;\nconst textDir = `${konuPath}/Slidelar`;\nconst audioPath = `${konuPath}/Ses${konuId}.mp3`;\nconst outputPath = `C:/Users/busra/OneDrive/Desktop/AlevPenceOtomasyonu/Proje/VideoB\u00f6l\u00fcmler/output${konuId}.mp4`;\n\nfunction fixPath(p) {\n  let s = p.replace(/\\\\/g, \"/\");\n  s = s.replace(/:/, \"\\\\:\");\n  return s;\n}\n\nconst fontFileEscaped = fixPath(\"C:\\\\Windows\\\\Fonts\\\\calibrib.ttf\");\n\nconst imageInputs = [];\nfor (let i = 1; i <= slideCount; i++) {\n  const dur = saniyeBundle[i - 1];\n  const imgPath = `${imgDir}/GorselSlide${i}.jpg`;\n  imageInputs.push(`-loop 1 -t ${dur} -i \"${imgPath}\"`);\n}\n\nconst filterBlocks = [];\nfor (let i = 1; i <= slideCount; i++) {\n  const idx = i - 1;\n  const txtPathRaw = `${textDir}/Slide${i}.txt`;\n  const txtPath = fixPath(txtPathRaw);\n\n  const block = `[${idx}:v]scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080,setsar=1,format=yuv420p,` +\n    `drawbox=x=0:y=0:w=iw:h=ih:color=white@0.3:t=fill,` +\n    `drawtext=fontfile='${fontFileEscaped}':textfile='${txtPath}':fontcolor=white:fontsize=32:` +\n    `x=(w-text_w)/2:y=(h-text_h)/2:shadowcolor=black:shadowx=4:shadowy=4:box=1:` +\n    `boxcolor=black@0.6:boxborderw=50:line_spacing=4[v${idx}]`;\n\n  filterBlocks.push(block);\n}\n\nconst vChain = Array.from({ length: slideCount }, (_, k) => `[v${k}]`).join(\"\");\nconst concatFilter = `${vChain}concat=n=${slideCount}:v=1:a=0,format=yuv420p[video]`;\n\nconst filterComplex = filterBlocks.join(\";\") + \";\" + concatFilter;\n\nconst mapLine = `-map \"[video]\" -map ${slideCount}:a`;\nconst codecLine = `-c:v libx264 -c:a aac -b:a 192k -shortest \"${outputPath}\"`;\n\nconst ffmpegCommand =\n  \"ffmpeg \" +\n  imageInputs.join(\" \") + \" \" +\n  `-i \"${audioPath}\" ` +\n  `-filter_complex \"${filterComplex}\" ` +\n  `${mapLine} ` +\n  `${codecLine}`;\n\nreturn [{ json: { ffmpegCommand } }];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        640,
        80
      ],
      "id": "59a401e3-2c18-4ff7-a3d0-eec81535357b",
      "name": "Video \u00fcretme servisi ffmpeg"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        720,
        624
      ],
      "id": "c3d8ece6-5200-40b2-b0e2-40f9445b0fef",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash-image",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash-image (Nano Banana)"
        },
        "prompt": "={{ $json.output.substring(0, 999) }}",
        "options": {
          "binaryPropertyOutput": "data"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1.1,
      "position": [
        1216,
        400
      ],
      "id": "6b03421b-9211-46bf-8f7d-0c8bff00c635",
      "name": "Generate an image",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "method": "POST",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        1600,
        592
      ],
      "id": "ddbe7196-0d0a-4218-b9b0-1380f7db6d3a",
      "name": "Dosya Kaydet",
      "disabled": true
    },
    {
      "parameters": {
        "url": "=https://image.pollinations.ai/prompt/{{ $json.output }}",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "width",
              "value": "500"
            },
            {
              "name": "height",
              "value": "500"
            },
            {
              "name": "model",
              "value": "flux"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "image.png"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        1040,
        400
      ],
      "id": "5de13f66-8923-4765-afbc-29d1cda4522e",
      "name": "resim \u00fcretme"
    },
    {
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "key",
              "value": "<redacted-credential>"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        1136,
        832
      ],
      "id": "7b3f150e-0957-47a7-99c3-83f0b097df54",
      "name": "resim \u00fcretme1",
      "disabled": true
    }
  ],
  "connections": {
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Video \u00fcretme servisi ffmpeg",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "G\u00f6rsel Prompt \u00dcretimi",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "G\u00f6rsel \u00dcretimi": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read/Write Files from Disk": {
      "main": [
        [
          {
            "node": "Dosya Kaydet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "G\u00f6rsel Prompt \u00dcretimi": {
      "main": [
        [
          {
            "node": "resim \u00fcretme",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "G\u00f6rsel Prompt \u00dcretimi",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generate an image": {
      "main": [
        [
          {
            "node": "G\u00f6rsel \u00dcretimi",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dosya Kaydet": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "resim \u00fcretme": {
      "main": [
        [
          {
            "node": "Generate an image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "8d5476be-fa00-45f6-ab2b-d0144383fcef",
  "id": "1HEyhiAHm_tvydq_rmEQk",
  "tags": [
    {
      "updatedAt": "2026-05-24T13:08:43.173Z",
      "createdAt": "2026-05-24T13:08:43.173Z",
      "id": "cJgNlY3X1jV7aeEd",
      "name": "main"
    }
  ]
}