{
  "name": "ModelRush Wan 3 video with polling",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "Run workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.modelrush.ai/v1/videos/generations",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"model\": \"modelrush/wan3-spicy\",\n  \"prompt\": \"A premium product film with one slow dolly move, warm studio light, and stable composition\",\n  \"duration\": 5,\n  \"resolution\": \"720P\",\n  \"ratio\": \"16:9\",\n  \"audio\": true\n}",
        "options": {}
      },
      "id": "submit-video",
      "name": "Submit Wan 3 video",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [240, 0]
    },
    {
      "parameters": {
        "amount": 20,
        "unit": "seconds"
      },
      "id": "wait-before-poll",
      "name": "Wait before polling",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [480, 0]
    },
    {
      "parameters": {
        "url": "={{ 'https://api.modelrush.ai' + $('Submit Wan 3 video').item.json.poll_url }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "id": "poll-video",
      "name": "Poll generation",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [720, 0]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "terminal-status",
              "leftValue": "={{ ['succeeded', 'failed', 'cancelled'].includes($json.status) }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "terminal-check",
      "name": "Finished?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [960, 0]
    }
  ],
  "pinData": {},
  "connections": {
    "Run workflow": {
      "main": [[{ "node": "Submit Wan 3 video", "type": "main", "index": 0 }]]
    },
    "Submit Wan 3 video": {
      "main": [[{ "node": "Wait before polling", "type": "main", "index": 0 }]]
    },
    "Wait before polling": {
      "main": [[{ "node": "Poll generation", "type": "main", "index": 0 }]]
    },
    "Poll generation": {
      "main": [[{ "node": "Finished?", "type": "main", "index": 0 }]]
    },
    "Finished?": {
      "main": [[], [{ "node": "Wait before polling", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4b37e803-c202-4d2c-9f5d-4fef56cbd7bf",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
