{
  "name": "Cinematic Video Generator (B\u0130TMED\u0130)",
  "nodes": [
    {
      "parameters": {
        "formTitle": "Cinematic Video Generator",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Prompt",
              "requiredField": true
            },
            {
              "fieldLabel": "Sonu\u00e7 hangi mail adresine g\u00f6nderilsin?",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -340,
        -200
      ],
      "id": "9483254f-46fe-427e-8c41-eddc64d11e2f",
      "name": "On form submission"
    },
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -680,
        640
      ],
      "id": "4ef04a39-3be2-416e-8cce-0241f2a5f304",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "=\u0130\u015fte Sonucunuz: {{ $json.video_url }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        2080,
        600
      ],
      "id": "151d28ce-8e77-46c2-9cf3-d6552df07a97",
      "name": "Telegram",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $('On form submission').item.json['Sonu\u00e7 hangi mail adresine g\u00f6nderilsin?'] }}",
        "subject": "Sonucunuz",
        "message": "=Sinematik video urlniz: {{ $json.video_url }}",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        2000,
        -220
      ],
      "id": "a931b935-23c4-4990-86e7-20d48a7855a6",
      "name": "Gmail",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "be15b1fb-2370-4bb2-a7d1-eecc506e98ea",
              "name": "api",
              "value": "",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        680,
        -200
      ],
      "id": "e225be29-c5fb-4364-ba2b-02df6f3daf14",
      "name": "Prototipal Api Key1"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.prototipal.com/functions/v1/predict",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $json.api }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "type",
              "value": "coremagnet-cinematic-video-generator"
            },
            {
              "name": "prompt",
              "value": "={{ $('Code1').item.json.Prompt }}"
            },
            {
              "name": "sahne1",
              "value": "={{ $('Code1').item.json['Sahne 1'] }}"
            },
            {
              "name": "sahne2",
              "value": "={{ $('Code1').item.json['Sahne 2'] }}"
            },
            {
              "name": "sahne3",
              "value": "={{ $('Code1').item.json['Sahne 3'] }}"
            },
            {
              "name": "sahne4",
              "value": "={{ $('Code1').item.json['Sahne 4'] }}"
            },
            {
              "name": "sahne5",
              "value": "={{ $('Code1').item.json['Sahne 5'] }}"
            },
            {
              "name": "sahne6",
              "value": "={{ $('Code1').item.json['Sahne 6'] }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1020,
        -200
      ],
      "id": "7e767bd6-a915-43c0-9957-49d8e1c84620",
      "name": "\u00dcretim \u0130ste\u011fi1"
    },
    {
      "parameters": {
        "url": "=https://api.prototipal.com/functions/v1/request-tracker/status/{{ $json.external_request_id }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $('Prototipal Api Key1').item.json.api }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1240,
        -200
      ],
      "id": "834f9d16-cfca-4b35-9215-a5ef783598ed",
      "name": "Durum Kontrol1"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "2dc06c60-eae5-4880-93e2-068c6e3a3d6e",
              "leftValue": "={{ $json.status }}",
              "rightValue": "COMPLETED",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1460,
        -200
      ],
      "id": "e7d000f3-01a3-4061-a845-dc2ddf204f6b",
      "name": "If1"
    },
    {
      "parameters": {
        "amount": 30
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1720,
        -20
      ],
      "id": "a4e653af-a0f3-4349-823a-6cbdaf6bdaa7",
      "name": "Wait1"
    },
    {
      "parameters": {
        "url": "=https://api.prototipal.com/functions/v1/request-tracker/response/{{ $json.external_request_id }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $('Prototipal Api Key1').item.json.api }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1740,
        -220
      ],
      "id": "86e774a2-3c2e-417e-bb96-ecf34795fe2d",
      "name": "Sonucu Al1"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "GPT-4O"
        },
        "messages": {
          "values": [
            {
              "content": "={{ $json.Prompt }}"
            },
            {
              "content": "Sen yard\u0131msever bir asistans\u0131n. Sana 1 prompt verilecek ve sen de bu prompta uygun 6 tane sahne promptu yazacaks\u0131n. Her prompt bir \u00f6ncekinin devam\u0131 niteli\u011finde olacak ve ana prompta ba\u011fl\u0131 kalacak.\n\nAna promptu da geli\u015ftire ve \u00e7\u0131kt\u0131ya koy. Ayr\u0131ca bu bir sinematik video \u00fcreten model i\u00e7in promptlar. G\u00f6rselli\u011fi etkilemeyecek detaylar vermekten ka\u00e7\u0131n.\n\nA\u015fa\u011f\u0131daki formatta \u00e7\u0131kt\u0131 ver. Bunlar\u0131n haricinde hi\u00e7bir a\u00e7\u0131klama yapma yorum ekleme. \u00c7\u0131kt\u0131lar ingilizce olacak.\n\n{\n\"Prompt\": \"\",\n\"Sahne 1\": \"\",\n\"Sahne 2\": \"\",\n\"Sahne 3\": \"\",\n\"Sahne 4\": \"\",\n\"Sahne 5\": \"\",\n\"Sahne 6\": \"\",\n}\n\nT\u0131rnak i\u015faretleri i\u00e7inde promptlar olacak.",
              "role": "system"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        -60,
        -200
      ],
      "id": "8dc00820-b8d1-41ba-b131-044737510dd4",
      "name": "OpenAI",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nconst result = items.map((item) => {\n  const lines = item.json.message.content.split(\"\\n\");\n  const output = {};\n\n  lines.forEach((line) => {\n    const [keyRaw, valueRaw] = line.split(\": \");\n    if (keyRaw && valueRaw) {\n      const key = keyRaw.replace(/\"/g, '').trim();\n\n      // Ba\u015ftaki ve sondaki \u00e7ift t\u0131rnaklar\u0131 temizle\n      const value = valueRaw\n        .replace(/^\"+/, '')   // ba\u015fta 1 veya daha fazla \"\n        .replace(/\"+,?$/, '') // sonda 1 veya daha fazla \" ve opsiyonel ,\n        .trim();\n\n      output[key] = value;\n    }\n  });\n\n  return { json: output };\n});\nreturn result;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        400,
        -200
      ],
      "id": "d1b890b8-d669-4087-a5e9-e89552301d52",
      "name": "Code1"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "be15b1fb-2370-4bb2-a7d1-eecc506e98ea",
              "name": "api",
              "value": "",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        780,
        620
      ],
      "id": "d1dbacfe-0617-4ed4-9647-9ff15f9972fc",
      "name": "Prototipal Api Key"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.prototipal.com/functions/v1/predict",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "=asdf{{ $json.api }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "type",
              "value": "coremagnet-cinematic-video-generator"
            },
            {
              "name": "prompt",
              "value": "={{ $('Code').item.json.Prompt }}"
            },
            {
              "name": "sahne1",
              "value": "={{ $('Code').item.json['Sahne 1'] }}"
            },
            {
              "name": "sahne2",
              "value": "={{ $('Code').item.json['Sahne 2'] }}"
            },
            {
              "name": "sahne3",
              "value": "={{ $('Code').item.json['Sahne 3'] }}"
            },
            {
              "name": "sahne4",
              "value": "={{ $('Code').item.json['Sahne 4'] }}"
            },
            {
              "name": "sahne5",
              "value": "={{ $('Code').item.json['Sahne 5'] }}"
            },
            {
              "name": "sahne6",
              "value": "={{ $('Code').item.json['Sahne 6'] }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1080,
        620
      ],
      "id": "2d1afe71-7e8e-4f95-94d2-d50bfd4ae6e4",
      "name": "\u00dcretim \u0130ste\u011fi"
    },
    {
      "parameters": {
        "url": "=https://api.prototipal.com/functions/v1/request-tracker/status/{{ $json.external_request_id }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $('Prototipal Api Key').item.json.api }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1300,
        620
      ],
      "id": "56a3c428-3481-4f21-884d-ee8fd66c108e",
      "name": "Durum Kontrol"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "2dc06c60-eae5-4880-93e2-068c6e3a3d6e",
              "leftValue": "={{ $json.status }}",
              "rightValue": "COMPLETED",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1520,
        620
      ],
      "id": "1b954a95-68bb-4fe2-8e2f-0f2a60be2d11",
      "name": "If"
    },
    {
      "parameters": {
        "amount": 30
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1780,
        800
      ],
      "id": "7440dc89-046e-41c9-b205-9436c178e01e",
      "name": "Wait"
    },
    {
      "parameters": {
        "url": "=https://api.prototipal.com/functions/v1/request-tracker/response/{{ $json.external_request_id }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $('Prototipal Api Key').item.json.api }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1800,
        600
      ],
      "id": "d886f2a7-2564-4dbd-8d88-d5797495b4ab",
      "name": "Sonucu Al"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "GPT-4O"
        },
        "messages": {
          "values": [
            {
              "content": "={{ $('Telegram Trigger').item.json.message.text }}"
            },
            {
              "content": "Sen yard\u0131msever bir asistans\u0131n. Sana 1 prompt verilecek ve sen de bu prompta uygun 6 tane sahne promptu yazacaks\u0131n. Her prompt bir \u00f6ncekinin devam\u0131 niteli\u011finde olacak ve ana prompta ba\u011fl\u0131 kalacak.\n\nAna promptu da geli\u015ftire ve \u00e7\u0131kt\u0131ya koy. Ayr\u0131ca bu bir sinematik video \u00fcreten model i\u00e7in promptlar. G\u00f6rselli\u011fi etkilemeyecek detaylar vermekten ka\u00e7\u0131n.\n\nA\u015fa\u011f\u0131daki formatta \u00e7\u0131kt\u0131 ver. Bunlar\u0131n haricinde hi\u00e7bir a\u00e7\u0131klama yapma yorum ekleme. \u00c7\u0131kt\u0131lar ingilizce olacak.\n\n{\n\"Prompt\": \"\",\n\"Sahne 1\": \"\",\n\"Sahne 2\": \"\",\n\"Sahne 3\": \"\",\n\"Sahne 4\": \"\",\n\"Sahne 5\": \"\",\n\"Sahne 6\": \"\",\n}\n\nT\u0131rnak i\u015faretleri i\u00e7inde promptlar olacak.",
              "role": "system"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        40,
        620
      ],
      "id": "3b67cb6a-e14a-4a02-bbc3-64157c6a6b46",
      "name": "OpenAI1",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nconst result = items.map((item) => {\n  const lines = item.json.message.content.split(\"\\n\");\n  const output = {};\n\n  lines.forEach((line) => {\n    const [keyRaw, valueRaw] = line.split(\": \");\n    if (keyRaw && valueRaw) {\n      const key = keyRaw.replace(/\"/g, '').trim();\n\n      // Ba\u015ftaki ve sondaki \u00e7ift t\u0131rnaklar\u0131 temizle\n      const value = valueRaw\n        .replace(/^\"+/, '')   // ba\u015fta 1 veya daha fazla \"\n        .replace(/\"+,?$/, '') // sonda 1 veya daha fazla \" ve opsiyonel ,\n        .trim();\n\n      output[key] = value;\n    }\n  });\n\n  return { json: output };\n});\nreturn result;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        520,
        620
      ],
      "id": "9caa9aa0-b1e9-483b-982a-3ef8bebc915b",
      "name": "Code"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "9f5fd987-0901-486a-867f-561c9c44699a",
              "leftValue": "={{ $json.message.text }}",
              "rightValue": "!sinematik",
              "operator": {
                "type": "string",
                "operation": "startsWith"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -360,
        640
      ],
      "id": "5b175eb1-51da-472b-b151-b824e2f49db8",
      "name": "If2"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        -280,
        880
      ],
      "id": "0e929203-16ce-45ac-a2c1-43aca4207294",
      "name": "No Operation, do nothing"
    },
    {
      "parameters": {
        "content": "## Telegram Tetikleyici\n\nOtomasyonu tetikleme i\u00e7in telegram botuna \"!sinematik\" yaz\u0131p bir alt sat\u0131ra promptunuzu yaz\u0131n\u0131z.",
        "width": 300
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        640
      ],
      "typeVersion": 1,
      "id": "33a8cf3a-5478-4fe7-954c-2cccfe13bb5f",
      "name": "Sticky Note"
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram": {
      "main": [
        []
      ]
    },
    "Prototipal Api Key1": {
      "main": [
        [
          {
            "node": "\u00dcretim \u0130ste\u011fi1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u00dcretim \u0130ste\u011fi1": {
      "main": [
        [
          {
            "node": "Durum Kontrol1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Durum Kontrol1": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Sonucu Al1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Durum Kontrol1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sonucu Al1": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Prototipal Api Key1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prototipal Api Key": {
      "main": [
        [
          {
            "node": "\u00dcretim \u0130ste\u011fi",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u00dcretim \u0130ste\u011fi": {
      "main": [
        [
          {
            "node": "Durum Kontrol",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Durum Kontrol": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Sonucu Al",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Durum Kontrol",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI1": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Prototipal Api Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "OpenAI1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sonucu Al": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "91f8e84d-dff5-4b45-969e-7ccc278af1a3",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "KYujMHO2VnTU002R",
  "tags": []
}