{
  "name": "InnoIT:Generatevideo",
  "nodes": [
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/videos",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "input_reference",
              "inputDataFieldName": "=data"
            },
            {
              "name": "prompt",
              "value": "={{ $json.prompt }}"
            },
            {
              "name": "model",
              "value": "sora-2"
            },
            {
              "name": "size",
              "value": "1280x720"
            },
            {
              "name": "seconds",
              "value": "8"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        896,
        80
      ],
      "id": "baa3c678-a03b-46b2-acc5-19820946a3bb",
      "name": "HTTP Request",
      "credentials": {
        "openAiApi": {
          "id": "r5FEJ6lXc0AaNF6n",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "operation": "crop",
        "width": 1280,
        "height": 720,
        "positionY": 300,
        "options": {}
      },
      "type": "n8n-nodes-base.editImage",
      "typeVersion": 1,
      "position": [
        352,
        176
      ],
      "id": "86a7eecb-7424-4acb-a412-ff8653c491f1",
      "name": "Edit Image"
    },
    {
      "parameters": {
        "operation": "resize",
        "width": 1250,
        "height": 1300,
        "resizeOption": "minimumArea",
        "options": {}
      },
      "type": "n8n-nodes-base.editImage",
      "typeVersion": 1,
      "position": [
        128,
        64
      ],
      "id": "447fd325-090e-4887-b77c-750f4aa5d21d",
      "name": "Edit Image1"
    },
    {
      "parameters": {
        "url": "=https://api.openai.com/v1/videos/{{ $json.id }}",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1344,
        80
      ],
      "id": "509e8bd1-f774-4d8f-8117-5adeb3e98695",
      "name": "HTTP Request1",
      "credentials": {
        "openAiApi": {
          "id": "r5FEJ6lXc0AaNF6n",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "de4b5dde-51de-4d1f-ad50-a8720947e560",
              "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": [
        1584,
        80
      ],
      "id": "227f0536-d828-4b39-9b05-0c07734a0dcf",
      "name": "If"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1120,
        80
      ],
      "id": "cb7d252d-55d0-436e-9925-5711b77d191e",
      "name": "Wait1",
      "webhookId": "58f0d900-6d9b-4578-bc92-c76703f77823"
    },
    {
      "parameters": {
        "url": "=https://api.openai.com/v1/videos/{{ $json.id }}/content",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1856,
        64
      ],
      "id": "c9874b5a-1657-4a00-901d-445bc95532a3",
      "name": "HTTP Request2",
      "credentials": {
        "openAiApi": {
          "id": "r5FEJ6lXc0AaNF6n",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "operation": "upload",
        "bucketName": "aviatordev-n8n-files",
        "fileName": "=sora/{{ $json.id }}.png",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.awsS3",
      "typeVersion": 2,
      "position": [
        2160,
        64
      ],
      "id": "2b616df3-40b1-4a09-87f7-af63456e2ede",
      "name": "Upload a file1",
      "credentials": {
        "aws": {
          "id": "GQUjP2b5r1OF1oVI",
          "name": "AWS account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "233fa1a9-9715-44df-9810-54bc087a6e2c",
              "name": "prompt",
              "value": "Los asistentes, empiezan a poner caras de preocupación y a mirar a izquierda y derecha.. Un par de zombies realistas irrumpen desde el fondo, pasando entre los asistentes y mordiendo a uno. Otro zombie va directo a por la camara y en el ultimo instante la camara cae al suelo.",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        368,
        -48
      ],
      "id": "a55a3c5b-c770-4b7e-ab40-e0b7139638b4",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        624,
        80
      ],
      "id": "842b0833-e563-4ac0-bf86-cc5351e926b9",
      "name": "Merge"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1kBPIl6rqfUFskCjwiD56LIKd7b3ba_Grp-4J9BEDOwk",
          "mode": "list",
          "cachedResultName": "Videos Sora",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1kBPIl6rqfUFskCjwiD56LIKd7b3ba_Grp-4J9BEDOwk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1kBPIl6rqfUFskCjwiD56LIKd7b3ba_Grp-4J9BEDOwk/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ID": "= https://aviatordev-n8n-files.s3.eu-west-3.amazonaws.com/sora/{{ $('HTTP Request').item.json.id }}.png"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "desc",
              "displayName": "desc",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2448,
        64
      ],
      "id": "a5a5b29e-5c64-40da-bb66-97f90fb92b80",
      "name": "Append row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "frSqKV3eztk8uUPR",
          "name": "Google Sheets marc@marcbenito.com"
        }
      }
    },
    {
      "parameters": {
        "url": "=https://api.telegram.org/file/bot8475687482:AAGwruNrA-p3v0ZDdCaII_t_XVWFOAv4WJI/{{ $json.result.file_path }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -128,
        64
      ],
      "id": "ae23d83e-74f3-43aa-93bb-8f60ce78e2e0",
      "name": "Get The path"
    },
    {
      "parameters": {
        "url": "=https://api.telegram.org/bot8475687482:AAGwruNrA-p3v0ZDdCaII_t_XVWFOAv4WJI/getFile?file_id={{ $('telegram_message').item.json.message.photo[3].file_id }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -368,
        64
      ],
      "id": "29c47bd4-b066-47e5-bf6c-e99be8871745",
      "name": "HTTP Request4"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "0e8e85a5-ce3b-4832-a7a2-68132ef09c83",
              "leftValue": "={{ $json.message.photo }}",
              "rightValue": "",
              "operator": {
                "type": "array",
                "operation": "exists",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -608,
        80
      ],
      "id": "a2df98b3-3f68-47ec-a291-7787354bf2c3",
      "name": "If1"
    },
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -832,
        80
      ],
      "id": "1ffa5401-0f5b-46e9-b6a1-9ba85c34b5ec",
      "name": "telegram_message",
      "webhookId": "a2e30295-2cc0-4fea-a556-3bf3844091db",
      "credentials": {
        "telegramApi": {
          "id": "Amys6RkyAWWzF3P1",
          "name": "Telegram account 2"
        }
      }
    },
    {
      "parameters": {
        "content": "## Proceso OpnAI",
        "height": 576,
        "width": 1216
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        -144
      ],
      "typeVersion": 1,
      "id": "3dafa532-7670-47dd-9142-30c47612a8e4",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## CoserImagn",
        "height": 576,
        "width": 912,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -144
      ],
      "typeVersion": 1,
      "id": "5646c8c7-4175-451f-824e-bafb57c6bb7e",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Preparaion de los datos",
        "height": 576,
        "width": 672,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -144
      ],
      "typeVersion": 1,
      "id": "853954f3-a4b6-49a6-b224-59524995d13e",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## Guardar imagen",
        "height": 576,
        "width": 672,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2096,
        -144
      ],
      "typeVersion": 1,
      "id": "93327e2a-ef23-4277-8b67-699e5c9e7ba1",
      "name": "Sticky Note3"
    }
  ],
  "pinData": {},
  "connections": {
    "Edit Image": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Edit Image1": {
      "main": [
        [
          {
            "node": "Edit Image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request2": {
      "main": [
        [
          {
            "node": "Upload a file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload a file1": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request4": {
      "main": [
        [
          {
            "node": "Get The path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "HTTP Request4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "telegram_message": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get The path": {
      "main": [
        [
          {
            "node": "Edit Image1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ff35f8e3-3369-454c-8413-2a50ec73d53a",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "edf65107f4e74e1fc40836f00996d676566a5287b4feb81d57380eb9da83ec7e"
  },
  "id": "rFEZ2iu5gZYOE91n",
  "tags": [
    {
      "createdAt": "2025-10-17T20:29:05.379Z",
      "updatedAt": "2025-10-17T20:29:05.379Z",
      "id": "R02q32gn6O27XAZN",
      "name": "InnoIT"
    }
  ]
}