{
  "name": "VideoGenAPI generate + poll",
  "nodes": [
    {
      "parameters": {
        "method": "POST",
        "url": "https://videogenapi.com/api/v1/generate",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={ \"model\": \"kling-3\", \"prompt\": \"{{$json.prompt}}\", \"duration\": 5 }",
        "options": {}
      },
      "id": "generate",
      "name": "Generate video",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [240, 300]
    },
    {
      "parameters": {
        "amount": 5
      },
      "id": "wait",
      "name": "Wait 5s",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [460, 300]
    },
    {
      "parameters": {
        "url": "=https://videogenapi.com/api/v1/status/{{$('Generate video').item.json.generation_id || $('Generate video').item.json.id}}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "id": "status",
      "name": "Poll status",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [680, 300]
    }
  ],
  "connections": {
    "Generate video": { "main": [[{ "node": "Wait 5s", "type": "main", "index": 0 }]] },
    "Wait 5s": { "main": [[{ "node": "Poll status", "type": "main", "index": 0 }]] }
  },
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "videogenapi-docs"
  },
  "pinData": {}
}
