{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "be0afc63-a202-4f65-9e80-9b49fb956583",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1860,
        60
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "d3077eb3-e4e6-4d94-a398-0ea5f7bed59e",
      "name": "Create Sisif Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1020,
        60
      ],
      "parameters": {
        "url": "https://sisif.ai/api/videos/generate/",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.output.idea }}"
            },
            {
              "name": "duration",
              "value": "5"
            },
            {
              "name": "resolution",
              "value": "540x960"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        },
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "51c39595-9cbd-4bb9-b0de-ec641a013478",
      "name": "Wait 10s",
      "type": "n8n-nodes-base.wait",
      "position": [
        -740,
        60
      ],
      "parameters": {
        "unit": "seconds",
        "amount": 10
      },
      "typeVersion": 1
    },
    {
      "id": "ed68fc5a-4db7-4397-996f-938c5cb987d5",
      "name": "Check Video Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -540,
        60
      ],
      "parameters": {
        "url": "=https://sisif.ai/api/videos/{{ $json.id }}/",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        },
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "a82e05a5-eeec-4d09-b92f-93e95defb217",
      "name": "Video Ready?",
      "type": "n8n-nodes-base.if",
      "position": [
        -300,
        60
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.status }}",
              "value2": "READY"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8463e988-f99e-4c06-9d87-1a58d42f5b3d",
      "name": "Prepare Final Data",
      "type": "n8n-nodes-base.function",
      "position": [
        160,
        40
      ],
      "parameters": {
        "functionCode": "// Extract the final video data\nconst videoData = items[0].json;\n\n// Create a summary of the completed video\nreturn [{\n  json: {\n    prompt: videoData.prompt,\n    duration: videoData.duration,\n    resolution: videoData.resolution,\n    sisif_id: videoData.sisif_id,\n    video_url: videoData.video_url,\n    status: videoData.status,\n    watch_url: `https://sisif.ai/app/watch/${videoData.sisif_id}/`,\n    completed_at: new Date().toISOString()\n  }\n}];"
      },
      "typeVersion": 1
    },
    {
      "id": "feaaa368-2c77-4f1d-8062-ab7e654dc075",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1380,
        260
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"idea\": \"Generate video ...\"\n}\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "352ed650-1591-4679-b154-6a61a2e2d94e",
      "name": "Idea creator",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1560,
        60
      ],
      "parameters": {
        "text": "=You are a creative video content strategist for TikTok and social media. Generate engaging video ideas that are simple to understand, short, and contain low number of words. Should contain: beach, sexy, holiday, honeymoon, chill. Should be sexy, young, white girl, beautiful.\n            \n\nJSON output format:\n\n{\n  \"idea\": \"Generate video about [...]\",\n}",
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "76a0b24a-663e-4675-a811-d783fea70aec",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1560,
        280
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3f7a67f0-65de-430f-a396-08fa1c342254",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -140
      ],
      "parameters": {
        "color": 4,
        "width": 1100,
        "height": 500,
        "content": "# Sisif.ai\n\n## Generate new video based on idea creator"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Wait 10s": {
      "main": [
        [
          {
            "node": "Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Idea creator": {
      "main": [
        [
          {
            "node": "Create Sisif Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video Ready?": {
      "main": [
        [
          {
            "node": "Prepare Final Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 10s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Idea creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Idea creator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check Video Status": {
      "main": [
        [
          {
            "node": "Video Ready?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Sisif Video": {
      "main": [
        [
          {
            "node": "Wait 10s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Idea creator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}