{
  "name": "TEST_ANA",
  "nodes": [
    {
      "parameters": {
        "operation": "pdf",
        "binaryPropertyName": "File",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        656,
        48
      ],
      "id": "ad8903f6-484b-498e-ad1d-37c17c69613d",
      "name": "dosya i\u015fleme1"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "9a307505-bf50-4d34-ba2d-1d8c38a06bb4",
              "name": "Kullan\u0131c\u0131Promptu",
              "value": "={{ $('On form submission1').item.json['Prompt gir'] }}",
              "type": "string"
            },
            {
              "id": "1dc57b40-d2b2-481b-98a1-018113403165",
              "name": "EgitimMateryali",
              "value": "={{ $('dosya i\u015fleme1').item.json.text }}",
              "type": "string"
            },
            {
              "id": "9a5efcd1-fc72-46d5-a85d-e9cea44cc362",
              "name": "IcerikUzunluk",
              "value": "={{ $('On form submission1').item.json.uzunluk }}",
              "type": "string"
            },
            {
              "id": "5eed797c-ef6b-4292-aea8-3e32c4d0a852",
              "name": "IcerikKitleSeviyesi",
              "value": "={{ $('On form submission1').item.json.Seviye }}",
              "type": "string"
            },
            {
              "id": "7f809120-d81b-4f64-aded-f20b57748f36",
              "name": "Konu Say\u0131s\u0131",
              "value": "={{ $('On form submission1').item.json.uzunluk?.toLowerCase() === 'k\u0131sa' ? 3 : 6 }}\n",
              "type": "string"
            },
            {
              "id": "e153f868-ee9c-4406-938a-ba4df59bc73e",
              "name": "D\u00f6k\u00fcman",
              "value": "={{ Math.floor(Math.random() * 100) }}",
              "type": "string"
            },
            {
              "id": "37983ab0-e0a7-46ac-9b93-fd6ff4c9529d",
              "name": "Proje Ad\u0131",
              "value": "={{ $('On form submission1').item.json['Proje Ad\u0131'] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        976,
        48
      ],
      "id": "adff3d32-d1f6-442b-b428-715e48630948",
      "name": "veri standartizasyonu1"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Kullan\u0131c\u0131Promptu: {{ $json['Kullan\u0131c\u0131Promptu'] }}\n\nEgitimMateryali: {{ $json.EgitimMateryali }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=Sen deneyimli bir video i\u00e7erik tasar\u0131mc\u0131s\u0131s\u0131n.\n\nGirdi parametreleri:\n\u2022 KullaniciPromptu   \u2192 Videonun hedefi / odak noktas\u0131  \n\u2022 EgitimMateryali    \u2192 \u0130\u015flenecek kaynak metin (parse edilmi\u015ftir)  \n\nG\u00f6rev: EgitimMateryali\u2019ni inceleyerek \u00f6\u011fretici video i\u00e7in maksimum {{ $json['Konu Say\u0131s\u0131'] }} konu say\u0131s\u0131ndan olu\u015fan Kullan\u0131c\u0131Promptunu kar\u015f\u0131layan bir konu tasla\u011f\u0131 \u00e7\u0131karmak.  \n\n\nHer konu nesnesi yaln\u0131zca a\u015fa\u011f\u0131daki \u00fc\u00e7 alan\u0131 i\u00e7erir (ba\u015fka anahtar ekleme):\n\n1. \"icerik\"\u2003\u2003: Konuda anlat\u0131lacak temel fikirlerin 2-3 c\u00fcmlelik \u00f6zeti  \n2. \"amac\"\u2003\u2003  : \u0130zleyicinin b\u00f6l\u00fcmden \u00f6\u011frenece\u011fi bilgi / beceri  \n3. \"anahtar_kelimeler\" : 3-6 maddelik anahtar kelime dizisi (her biri tek s\u00f6zc\u00fck veya k\u0131sa tamlama)\n\nKurallar\n- Kaynaktan kopyalama yapma; i\u00e7erikleri yeniden form\u00fcle et.  \n- A\u00e7\u0131klamalar sade, teknik olmayan dilde olsun.  \n- \u00c7\u0131kt\u0131 yaln\u0131zca ge\u00e7erli JSON olsun; yorum, sat\u0131r sonu a\u00e7\u0131klamas\u0131, fazladan alan vb. ekleme.  \n- Nesne ve alan adlar\u0131n\u0131 bire bir koru, s\u0131ralamay\u0131 icerik \u2192 amac \u2192 anahtar_kelimeler \u015feklinde tut.\n\n---\n\n#### \u00d6rnek \u00c7\u0131kt\u0131 (k\u0131sa video \u21d2 2 konu g\u00f6sterimi)\n\n{\n\u00a0 \"konular\": [\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 \"konu_id\": 1,\n\u00a0 \u00a0 \u00a0 \"icerik\": \"Bu b\u00f6l\u00fcm, konunun tarihsel geli\u015fimini \u00f6zetleyerek temel kavramlar\u0131 tan\u0131t\u0131r.\",\n\u00a0 \u00a0 \u00a0 \"amac\": \"\u0130zleyici, kavram\u0131n nas\u0131l ortaya \u00e7\u0131kt\u0131\u011f\u0131n\u0131 ve neden \u00f6nemli oldu\u011funu kavrar.\",\n\u00a0 \u00a0 \u00a0 \"anahtar_kelimeler\": \"tarih\u00e7e, temel_kavram, giri\u015f\"\n\u00a0 \u00a0 },\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 \"konu_id\": 2,\n\u00a0 \u00a0 \u00a0 \"icerik\": \"Bu b\u00f6l\u00fcmde y\u00f6ntemin ad\u0131m ad\u0131m nas\u0131l uyguland\u0131\u011f\u0131 \u00f6rneklerle a\u00e7\u0131klan\u0131r.\",\n\u00a0 \u00a0 \u00a0 \"amac\": \"\u0130zleyici, y\u00f6ntemi kendi projesinde uygulamak i\u00e7in gerekli ad\u0131mlar\u0131 \u00f6\u011frenir.\",\n\u00a0 \u00a0 \u00a0 \"anahtar_kelimeler\": \"uygulama, ad\u0131mlar, \u00f6rnek\"\n\u00a0 \u00a0 }\n\u00a0 ]\n}\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.1,
      "position": [
        512,
        432
      ],
      "id": "f91d2c3b-7e4b-4398-aaaf-8a10e965bb57",
      "name": "konu tasla\u011f\u0131 \u00fcretimi1"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "7bb51b06-1623-43ed-b628-4b1707189be7",
              "name": "KullaniciPromptu",
              "value": "={{ $('veri standartizasyonu1').item.json['Kullan\u0131c\u0131Promptu'] }}",
              "type": "string"
            },
            {
              "id": "e2c17ca9-5833-4955-819e-34ccdb9d8085",
              "name": "EgitimMateryali",
              "value": "={{ $('veri standartizasyonu1').item.json.EgitimMateryali }}",
              "type": "string"
            },
            {
              "id": "efb4d60b-b4fc-49e9-8fc9-11a9626cce9c",
              "name": "IcerikUzunluk",
              "value": "={{ $('veri standartizasyonu1').item.json.IcerikUzunluk }}",
              "type": "string"
            },
            {
              "id": "5107666e-7f41-4896-97fa-977282a820f8",
              "name": "IcerikKitleSeviyesi",
              "value": "={{ $('veri standartizasyonu1').item.json.IcerikKitleSeviyesi }}",
              "type": "string"
            },
            {
              "id": "0d203b60-61a9-4928-b58f-bc844e8dd89b",
              "name": "B\u00f6l\u00fcmler",
              "value": "={{ $('konu tasla\u011f\u0131 \u00fcretimi1').item.json.output }}",
              "type": "object"
            },
            {
              "id": "860d0c97-ead2-4d39-8867-f57dc10cf796",
              "name": "D\u00f6k\u00fcman",
              "value": "={{ $('veri standartizasyonu1').item.json['D\u00f6k\u00fcman'] }}",
              "type": "string"
            },
            {
              "id": "a570e914-b010-409c-b7fb-aebe20c0c98d",
              "name": "KonuSay\u0131s\u0131",
              "value": "={{ Math.max.apply(null, $('konu tasla\u011f\u0131 \u00fcretimi1').item.json.output.konular.map(k => k.konu_id)) }}",
              "type": "number"
            },
            {
              "id": "d18b9b5b-0d3a-4a73-95a3-a084ae6f7f3e",
              "name": "ProjeAd\u0131",
              "value": "={{ $('veri standartizasyonu1').item.json['Proje Ad\u0131'] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1184,
        432
      ],
      "id": "b872c344-fafe-4572-a5ae-d19496b70d08",
      "name": "veri standartizasyonu3"
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\"konular\": [{\"konu_id\": 1,\"icerik\": \"Bu b\u00f6l\u00fcm, konunun tarihsel geli\u015fimini \u00f6zetleyerek temel kavramlar\u0131 tan\u0131t\u0131r.\", \"amac\": \"\u0130zleyici, kavram\u0131n nas\u0131l ortaya \u00e7\u0131kt\u0131\u011f\u0131n\u0131 ve neden \u00f6nemli oldu\u011funu kavrar.\",\"anahtar_kelimeler\": \"tarih\u00e7e, temel_kavram, giri\u015f\"},{\"konu_id\": 2,\"icerik\": \"Bu b\u00f6l\u00fcmde y\u00f6ntemin ad\u0131m ad\u0131m nas\u0131l uyguland\u0131\u011f\u0131 \u00f6rneklerle a\u00e7\u0131klan\u0131r.\",\"amac\": \"\u0130zleyici, y\u00f6ntemi kendi projesinde uygulamak i\u00e7in gerekli ad\u0131mlar\u0131 \u00f6\u011frenir.\",\"anahtar_kelimeler\": \"uygulama, ad\u0131mlar, \u00f6rnek\"}]}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        672,
        640
      ],
      "id": "3085108f-16a6-4473-98d3-eeb4264d7972",
      "name": "Structured Output Parser1"
    },
    {
      "parameters": {
        "content": "# Kullan\u0131c\u0131 Girdisi\n## Form Submission\n## PDF Parsing\n## Create Doc\n## Edit Fields\n## LLM: Konu Tasla\u011f\u0131 \u00dcret\n### Doc Update\n## Edit Fields\n## Split Out",
        "height": 736,
        "width": 1600,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        80
      ],
      "id": "4f77fb05-fcf3-4cdc-b452-f6c0c20d4245",
      "name": "Sticky Note9"
    },
    {
      "parameters": {
        "fieldToSplitOut": "['B\u00f6l\u00fcmler'].konular",
        "include": "allOtherFields",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1472,
        432
      ],
      "id": "eacb70b3-2777-4342-a949-cd7a84c460c8",
      "name": "Split Out"
    },
    {
      "parameters": {
        "jsCode": "// Girdi: Konu say\u0131s\u0131\nvar videoCount = $('veri standartizasyonu3').first().json['KonuSay\u0131s\u0131']; // \u00d6rn: 2 veya 3\n\nif (!Number.isInteger(videoCount) || videoCount < 2) {\n  throw new Error(\"KonuSay\u0131s\u0131 integer ve en az 2 olmal\u0131.\");\n}\n\n// ---- Sabit yollar ----\nvar base = \"C:/Users/busra/OneDrive/Desktop/AlevPenceOtomasyonu/Proje\";\nvar inputDir = base + \"/VideoB\u00f6l\u00fcmler\";\nvar finalPath = base + \"/Final.mp4\";\n\n// ---- Giri\u015f arg\u00fcmanlar\u0131 ----\nvar inputArgs = [];\nfor (var i = 1; i <= videoCount; i++) {\n  inputArgs.push('-i \"' + inputDir + '/output' + i + '.mp4\"');\n}\n\n// ---- filter_complex olu\u015fturma ----\nvar streams = \"\";\nfor (var j = 0; j < videoCount; j++) {\n  streams += '[' + j + ':v:0][' + j + ':a:0]';\n}\nvar filterComplex = streams + 'concat=n=' + videoCount + ':v=1:a=1[outv][outa]';\n\n// ---- Map ve codec sat\u0131rlar\u0131 ----\nvar mapLine   = '-map \"[outv]\" -map \"[outa]\"';\nvar codecLine = '-c:v libx264 -pix_fmt yuv420p -c:a aac -b:a 192k -movflags +faststart';\n\n// ---- Tam komut ----\nvar ffmpegCommand =\n  'ffmpeg ' + inputArgs.join(' ') + ' ' +\n  '-filter_complex \"' + filterComplex + '\" ' +\n  mapLine + ' ' + codecLine + ' \"' + finalPath + '\"';\n\n// \u00c7\u0131kt\u0131\nreturn [{ json: { ffmpegCommand: ffmpegCommand } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2048,
        352
      ],
      "id": "dbf7efde-dcc8-4e54-a0ef-747a73e39296",
      "name": "Code1"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "da741e28-e211-4737-b8d5-91a0310b9ead",
              "name": "KonuId",
              "value": "={{ $json.KonuId }}",
              "type": "number"
            },
            {
              "id": "f0095469-7de6-4596-af7c-3e31cdb32f5c",
              "name": "SlideCount",
              "value": "={{ $json.SlideCount }}",
              "type": "number"
            },
            {
              "id": "62d14bea-9b97-4554-be45-1c571ec5e909",
              "name": "SaniyeBundle",
              "value": "={{ $json.SaniyeBundle }}",
              "type": "array"
            },
            {
              "id": "c4222e65-b6db-4ac8-aaf0-323b3dfcba66",
              "name": "output",
              "value": "={{ $('Slide \u00dcretme').item.json.output }}",
              "type": "object"
            },
            {
              "id": "0ad95819-0336-4f87-aa14-3231616ef649",
              "name": "ProjeAd\u0131",
              "value": "={{ $('veri standartizasyonu3').item.json['ProjeAd\u0131'] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        3856,
        720
      ],
      "id": "9c374532-fbb7-4102-9e6b-3a36ad927057",
      "name": "Edit Fields1"
    },
    {
      "parameters": {
        "jsCode": "// n8n Function Item node\n// Input ($json): { output: { KonuId, slides: [{ id, start_time, end_time }], totalSlides? } }\n// Output: { KonuId: number, SlideCount: number, SaniyeBundle: number[] }\n\nconst out = $json.output ?? $json;\nconst slides = Array.isArray(out?.slides) ? out.slides : [];\n\nconst numFromId = (s) => {\n  const m = String(s || \"\").match(/\\d+/);\n  return m ? Number(m[0]) : Number.POSITIVE_INFINITY;\n};\n\nconst slidesSorted = [...slides].sort((a, b) => {\n  const ta = Number(a?.start_time) || 0;\n  const tb = Number(b?.start_time) || 0;\n  if (ta !== tb) return ta - tb;\n  return numFromId(a?.id) - numFromId(b?.id);\n});\n\nconst SaniyeBundle = slidesSorted.map(s => {\n  const start = Number(s?.start_time) || 0;\n  const end = Number(s?.end_time) || 0;\n  const dur = Math.max(0, end - start);\n  return Number(dur.toFixed(3));\n});\n\nconst KonuId = Number(out?.KonuId) || 0;\nconst SlideCount = slidesSorted.length;\n\nreturn { KonuId, SlideCount, SaniyeBundle };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3648,
        720
      ],
      "id": "18f22a2f-45fc-492a-87ff-82f75f7ce811",
      "name": "Code2"
    },
    {
      "parameters": {
        "jsCode": "// n8n Code Node i\u00e7in\u2014tek bir string i\u00e7inde \"[[start-end]]: sentence\" format\u0131nda c\u00fcmleleri ve ses s\u00fcresini verir:\n\n// 1) \u0130lk input \u00f6\u011fesinden words dizisini al\u0131n\nconst words = $input.first().json.words || [];\n\n/* \n * words dizisinden c\u00fcmleleri start/end timestamp ile olu\u015fturur.\n * @param {Array} words - [{ text, start, end, type, \u2026 }, \u2026]\n * @returns {Array} sentences - [{ text, start, end }, \u2026]\n */\nfunction reconstructSentences(words) {\n  const sentences = [];\n  let currentText = '';\n  let sentenceStart = null;\n\n  for (const { text, start, end, type } of words) {\n    if (type === 'word' || type === 'spacing') {\n      if (sentenceStart === null && type === 'word') {\n        sentenceStart = start;\n      }\n      currentText += text;\n      if (text.includes('.')) {\n        sentences.push({ text: currentText.trim(), start: sentenceStart, end });\n        currentText = '';\n        sentenceStart = null;\n      }\n    }\n  }\n\n  // Nokta ile bitmeyen son c\u00fcmle varsa ekle\n  if (currentText.trim()) {\n    sentences.push({\n      text: currentText.trim(),\n      start: sentenceStart,\n      end: words[words.length - 1].end,\n    });\n  }\n\n  return sentences;\n}\n\n// 2) C\u00fcmleleri hesapla\nconst sentences = reconstructSentences(words);\n\n// 3) Tek bir string olu\u015ftur: \"[[start-end]]: sentence\"\nconst result = sentences\n  .map(s => `[[${s.start.toFixed(3)}-${s.end.toFixed(3)}]]: ${s.text}`)\n  .join('\\n');\n\n// 4) Ses s\u00fcresini hesapla\n// Son c\u00fcmlenin veya son kelimenin 'end' de\u011feri\nconst lastEnd = sentences.length\n  ? sentences[sentences.length - 1].end\n  : (words.length ? words[words.length - 1].end : 0);\nconst audioDuration = Math.ceil(lastEnd + 1);\n\n// 5) KonuId'yi do\u011frudan input'tan al\nconst KonuId = $('\u0130\u00e7erik \u00dcretimi1').first().json.output.KonuId ?? null;\n\n// 6) Sonucu tek bir alan olarak d\u00f6nd\u00fcr\nreturn [\n  {\n    json: {\n      result,\n      audioDuration,\n      KonuId\n    },\n  },\n];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3072,
        752
      ],
      "id": "14bb1512-1f0e-4608-a4e3-ba799fdaebf6",
      "name": "Code"
    },
    {
      "parameters": {
        "content": "# Slide \u00dcretme\n",
        "height": 368,
        "width": 736,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        3264,
        640
      ],
      "id": "f2e6e7a5-6fca-4aad-a416-c99f19f83636",
      "name": "Sticky Note4",
      "disabled": true
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Transcript:  {{ $json.result }}\nAudioDuration: {{ $json.audioDuration }}\nKonuId: {{ $json.KonuId }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=You are an AI Agent in n8n. Your input is:\n  \u2022 A transcript with embedded timestamps (format [[start-end]])\n  \u2022 The total audio duration in seconds\n\nYour output must be a single JSON object with:\n{\n  \"KonuId\": \"{{ $json.KonuId }}\",\n  \"slides\": [\n    {\n      \"id\": \"Slide1\",\n      \"start_time\": 0.099,\n      \"end_time\": 19.499,\n      \"type\": \"headline\",\n      \"content\": \"Riskli co\u011frafi konumumuz nedeniyle haz\u0131rl\u0131kl\u0131 olmak hayati \u00f6neme sahiptir.\"\n    },\n    {\n      \"id\": \"Slide2\",\n      \"start_time\": 20.000,\n      \"end_time\": 30.039,\n      \"type\": \"bullet\",\n      \"content\": \"Deprem \u00e7antas\u0131nda olmas\u0131 gerekenler:`n`n- Fener ve yedek piller\\n- Ta\u015f\u0131nabilir radyo\\n- Temel ilk yard\u0131m kiti\\n- Su ve dayan\u0131kl\u0131 at\u0131\u015ft\u0131rmal\u0131klar\"\n    }\n  ],\n  \"totalSlides\": 2\n}\n\n\nSlide Type Determination:\n  \u2022 \u201cheadline\u201d: for a single, standalone, high-impact statement that sets the tone  \n  \u2022 \u201cbullet\u201d: for a list of related items or steps. *Begin with a concise explanatory heading ending with a colon, then list each item on its own line, separated by \u201c\\n\\n\u201d\n\nFormatting and Rules:\n  1. Generate **new*, supportive slide text\u2014do not copy the transcript verbatim.  \n  2. Cover all meaningful segments using as few slides as necessary.  \n  3. Align each slide\u2019s start_time and end_time exactly with the transcript timestamps.  \n  4. Ensure each slide\u2019s end_time is strictly less than the next slide\u2019s start_time.  \n  5. Respect the speaker\u2019s intent and emotional emphasis; paraphrase to support the narrative.  \n  6. Output valid JSON only, with no additional prose outside the object.\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.1,
      "position": [
        3296,
        720
      ],
      "id": "bad1dbc0-1cde-4843-bec6-eaca061dfefa",
      "name": "Slide \u00dcretme"
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"KonuId\": \"{{ $json.KonuId }}\",\n  \"slides\": [\n    {\n      \"id\": \"Slide1\",\n      \"start_time\": 0.099,\n      \"end_time\": 19.499,\n      \"type\": \"headline\",\n      \"content\": \"Riskli co\u011frafi konumumuz nedeniyle haz\u0131rl\u0131kl\u0131 olmak hayati \u00f6neme sahiptir.\"\n    },\n    {\n      \"id\": \"Slide2\",\n      \"start_time\": 20.000,\n      \"end_time\": 30.039,\n      \"type\": \"bullet\",\n      \"content\": \"Deprem \u00e7antas\u0131nda olmas\u0131 gerekenler:`n`n- Fener ve yedek piller\\n- Ta\u015f\u0131nabilir radyo\\n- Temel ilk yard\u0131m kiti\\n- Su ve dayan\u0131kl\u0131 at\u0131\u015ft\u0131rmal\u0131klar\"\n    }\n  ],\n  \"totalSlides\": 2\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        3504,
        896
      ],
      "id": "e4c23d40-b47b-4d76-a16b-03a52386b441",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "content": "# Ses dosyas\u0131 & Transcript \u00dcretimi\nNe zaman",
        "height": 240,
        "width": 800,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2400,
        640
      ],
      "id": "530919ae-238f-4b96-aacf-432ef34c413d",
      "name": "Sticky Note3",
      "disabled": true
    },
    {
      "parameters": {
        "options": {
          "reset": "={{ false }}"
        }
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        1744,
        432
      ],
      "id": "3ca27bdf-76e4-44f4-b059-ee087547ad8c",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"Icerik\": \"<insert the incoming Icerik variable exactly as received>\",\n  \"Script_SesFormat\": \"<combine the content with the generated script, enriched with the required ElevenLabs syntax, ready for narration>\",\n  \"KonuId\": \"<{{ $json['B\u00f6l\u00fcmler'].konular[0].konu_id }}>\"\n}\n",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        2064,
        960
      ],
      "id": "7f3e0ac6-c7f9-46b5-bb74-05d748acb5c3",
      "name": "Structured Output Parser3"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=\u2022 Icerik                \u2192 {{ $json['[\\'B\u00f6l\u00fcmler\\'].konular'].icerik }}\n\u2022 Amac                  \u2192 {{ $json['[\\'B\u00f6l\u00fcmler\\'].konular'].amac }}\n\u2022 Anahtar_Kelimeler     \u2192 {{ $json['[\\'B\u00f6l\u00fcmler\\'].konular'].anahtar_kelimeler }}\n\u2022 HedefKitleSeviyesi    \u2192  {{ $json.IcerikKitleSeviyesi }}\n\u2022 VideoUzunlugu    \u2192 {{ $json.IcerikUzunluk }}\n\u2022 KonuId           \u2192 {{ $json['[\\'B\u00f6l\u00fcmler\\'].konular'].konu_id }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=Sen deneyimli bir video i\u00e7erik tasar\u0131mc\u0131s\u0131 ve metin yazar\u0131 olan bir AI agents\u0131n.\n\n\ud83d\udd39 Girdi Parametreleri\n\u2022 Icerik \u2192 Kullan\u0131c\u0131n\u0131n sa\u011flad\u0131\u011f\u0131 ana konu a\u00e7\u0131klamas\u0131 (string)\n\u2022 Amac \u2192 Bu Icerik'in izleyiciye kazand\u0131raca\u011f\u0131 hedef (string)\n\u2022 Anahtar_Kelimeler \u2192 [\"...\", \"...\", ...] bi\u00e7iminde tam anahtar kelime listesi\n\u2022 VideoUzunlugu \u2192 \"k\u0131sa\" veya \"uzun\"\n\u2022 HedefKitleSeviyesi \u2192 \"yeni ba\u015flayan\" veya \"deneyimli\"\n\n\ud83d\udd39 G\u00f6revler\n\nMetin Olu\u015fturma\nIcerik + Amac\u2019\u0131n b\u00fct\u00fcn\u00fcn\u00fc, Anahtar_Kelimeler\u2019i harfiyen i\u00e7inde ge\u00e7irerek tutarl\u0131 ve ak\u0131c\u0131 bir konu\u015fma metni (Script) yaz.\nUzunluk\n\u2022 VideoUzunlugu = \"k\u0131sa\" ise en az 5 c\u00fcmle,\n\u2022 VideoUzunlugu = \"uzun\" ise en az 10 c\u00fcmle \u00fcret.\n\u00dcst s\u0131n\u0131r serbest.\nHitap \u015eekli\nMetinde \u201cSiz\u201d hitab\u0131n\u0131 kullan. Sadece ve Sadece konu_id 1 ise \u201cMerhabalar\u201d gibi giri\u015f c\u00fcmlesi kullan ve konu_id 1'inde ba\u015flang\u0131c\u0131nda olsun kesinlikle orta k\u0131s\u0131mlar\u0131nda \u201cMerhabalar\u201d gibi giri\u015f c\u00fcmleleri olmas\u0131n. Konu_id 1 de\u011fil ise selamlama yapma; konu\u015fmana devam ediyormu\u015f gibi yaz.\nHedef Kitleye Uygunluk\n\u2022 \u201cyeni ba\u015flayan\u201d i\u00e7in: 10 ya\u015f\u0131ndaki bir \u00e7ocu\u011fun da kavrayaca\u011f\u0131 sade anlat\u0131m ve d\u00fc\u015f\u00fck teknik terim.\n\u2022 \u201cdeneyimli\u201d i\u00e7in: Yo\u011fun terminoloji ve profesyonel dil.\nMetin B\u00fct\u00fcnl\u00fc\u011f\u00fc\nOrijinal anlam\u0131 bozma; gereksiz tekrar ve dolgu ifadelerden ka\u00e7\u0131n. Anahtar_Kelimeler\u2019i de\u011fi\u015ftirme; ba\u011flama uygun \u015fekilde do\u011fal ak\u0131\u015fta kullan.\nDinamik Ak\u0131\u015f\nGiri\u015fte merak uyand\u0131r; geli\u015fmede \u00f6\u011fretici ve enerjik ol; sonu\u00e7ta g\u00fcven ver. B\u00f6l\u00fcmler aras\u0131 ge\u00e7i\u015fleri tutarl\u0131 kur.\n\ud83d\udd39 \u00c7\u0131kt\u0131 Format\u0131 (Zorunlu)\nAI \u00e7\u0131kt\u0131s\u0131 kesinlikle yaln\u0131zca a\u015fa\u011f\u0131daki JSON yap\u0131s\u0131nda olmal\u0131d\u0131r \u2014 ba\u015fka hi\u00e7bir anahtar, yorum veya metin eklenmeyecektir:\n\n{\n  \"Icerik\": \"<gelen Icerik de\u011fi\u015fkenini aynen koy>\",\n  \"Script_SesFormat\": \"<Icerik ve olu\u015fturdu\u011fun Script\u2019i birle\u015ftir; tek blok h\u00e2linde sun; TTS veya etiket kullanma>\"\n  \"KonuId\": \"<{{ $json['[\\'B\u00f6l\u00fcmler\\'].konular'].konu_id }}>\"\"\n}"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.1,
      "position": [
        1984,
        768
      ],
      "id": "a585a22f-21c0-4da7-92e1-9aaf128b3c87",
      "name": "\u0130\u00e7erik \u00dcretimi1"
    },
    {
      "parameters": {
        "content": "# Script \u00dcretimi\n## LLM: Script \u00dcret",
        "height": 512,
        "width": 496,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1824,
        640
      ],
      "id": "5c9ce9cb-0603-4824-9ac8-2eb0d476ef3d",
      "name": "Sticky Note2",
      "disabled": true
    },
    {
      "parameters": {
        "content": "# LOOP",
        "height": 784,
        "width": 2640,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1696,
        560
      ],
      "id": "4c292817-5d85-4a16-94c8-2643d3939bae",
      "name": "Sticky Note",
      "disabled": true
    },
    {
      "parameters": {
        "content": "# Video Birle\u015ftirme\n",
        "height": 256,
        "width": 496,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        256
      ],
      "typeVersion": 1,
      "id": "3223feee-3848-4ede-944f-ceb388421dc4",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "resource": "speech",
        "voice": {
          "__rl": true,
          "value": "SOYHLrjzK2X1ezoPC6cr",
          "mode": "list",
          "cachedResultName": "Harry - Fierce Warrior"
        },
        "text": "={{ $('\u0130\u00e7erik \u00dcretimi1').item.json.output.Script_SesFormat }}",
        "additionalOptions": {
          "model": {
            "__rl": true,
            "value": "eleven_monolingual_v1",
            "mode": "list",
            "cachedResultName": "Eleven English v1"
          },
          "languageCode": "tr"
        },
        "requestOptions": {}
      },
      "type": "@elevenlabs/n8n-nodes-elevenlabs.elevenLabs",
      "typeVersion": 1,
      "position": [
        2464,
        752
      ],
      "id": "3236e416-65c1-400e-a545-9c359ee598b5",
      "name": "Convert text to speech1",
      "credentials": {
        "elevenLabsApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "speech",
        "operation": "speechToText",
        "additionalOptions": {},
        "requestOptions": {}
      },
      "type": "@elevenlabs/n8n-nodes-elevenlabs.elevenLabs",
      "typeVersion": 1,
      "position": [
        2960,
        752
      ],
      "id": "1633f4d4-f960-4067-b9ea-34fefeb73437",
      "name": "Transcribe audio or video",
      "credentials": {
        "elevenLabsApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        496,
        640
      ],
      "id": "8b03aadd-abba-47ea-8e7e-eff7b648d1e6",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "formTitle": "form",
        "formDescription": "i\u00e7erik",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Proje Ad\u0131",
              "placeholder": "Proje Ad\u0131",
              "requiredField": true
            },
            {
              "fieldLabel": "File",
              "fieldType": "file",
              "acceptFileTypes": ".pdf, .docx",
              "requiredField": true
            },
            {
              "fieldLabel": "Prompt gir",
              "requiredField": true
            },
            {
              "fieldLabel": "uzunluk",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "uzun"
                  },
                  {
                    "option": "k\u0131sa"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Seviye",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "yeni ba\u015flayan"
                  },
                  {
                    "option": "deneyimli"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        },
        "options": {
          "buttonLabel": "G\u00f6nder",
          "respondWithOptions": {
            "values": {
              "formSubmittedText": "G\u00f6nderildi"
            }
          }
        }
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        416,
        48
      ],
      "id": "699daea8-90cb-4c62-9cda-b8f26bd3685b",
      "name": "On form submission1"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        1872,
        1008
      ],
      "id": "69533060-a0b9-429c-8123-957b2e610787",
      "name": "Google Gemini Chat Model1",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://127.0.0.1:8000/folders/{{ $('veri standartizasyonu1').item.json['D\u00f6k\u00fcman'] }}",
        "options": {
          "allowUnauthorizedCerts": true
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        912,
        432
      ],
      "id": "f66767ed-c7ad-4c2b-bce4-92ae6039523e",
      "name": "Klas\u00f6r olu\u015ftur"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://127.0.0.1:8000/files/{{ $('veri standartizasyonu3').item.json['D\u00f6k\u00fcman'] }}",
        "sendBody": true,
        "contentType": "binaryData",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        2704,
        752
      ],
      "id": "def4b076-b968-4c1d-8521-a00ba07a443d",
      "name": "HTTP Request",
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        3296,
        928
      ],
      "id": "dffa8852-18ab-428c-a4e8-37bfac5b63b5",
      "name": "Google Gemini Chat Model2",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "1HEyhiAHm_tvydq_rmEQk",
          "mode": "list",
          "cachedResultUrl": "/workflow/1HEyhiAHm_tvydq_rmEQk",
          "cachedResultName": "TEST_Child"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "mode": "each",
        "options": {
          "waitForSubWorkflow": true
        }
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.2,
      "position": [
        4096,
        720
      ],
      "id": "490cfbdd-ff8f-4eb7-883a-9b052e06787a",
      "name": "Call 'TEST_Child'"
    }
  ],
  "connections": {
    "dosya i\u015fleme1": {
      "main": [
        [
          {
            "node": "veri standartizasyonu1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "veri standartizasyonu1": {
      "main": [
        [
          {
            "node": "konu tasla\u011f\u0131 \u00fcretimi1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "konu tasla\u011f\u0131 \u00fcretimi1": {
      "main": [
        [
          {
            "node": "Klas\u00f6r olu\u015ftur",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "veri standartizasyonu3": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "konu tasla\u011f\u0131 \u00fcretimi1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Call 'TEST_Child'",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Slide \u00dcretme",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slide \u00dcretme": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Slide \u00dcretme",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u0130\u00e7erik \u00dcretimi1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser3": {
      "ai_outputParser": [
        [
          {
            "node": "\u0130\u00e7erik \u00dcretimi1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "\u0130\u00e7erik \u00dcretimi1": {
      "main": [
        [
          {
            "node": "Convert text to speech1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe audio or video": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "konu tasla\u011f\u0131 \u00fcretimi1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "On form submission1": {
      "main": [
        [
          {
            "node": "dosya i\u015fleme1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "\u0130\u00e7erik \u00dcretimi1",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output Parser3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Convert text to speech1": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Klas\u00f6r olu\u015ftur": {
      "main": [
        [
          {
            "node": "veri standartizasyonu3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Transcribe audio or video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Slide \u00dcretme",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Call 'TEST_Child'": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "33c9fcc5-bd4e-48b7-bc9b-4f533e1240ca",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "97PmRf6cvjBJtWmPbQNL0",
  "tags": [
    {
      "updatedAt": "2026-05-24T13:08:43.173Z",
      "createdAt": "2026-05-24T13:08:43.173Z",
      "id": "cJgNlY3X1jV7aeEd",
      "name": "main"
    }
  ]
}