{
  "name": "Recover a completed video with Magic Hour",
  "nodes": [
    {
      "id": "1",
      "name": "Run manually",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        300
      ],
      "parameters": {}
    },
    {
      "id": "2",
      "name": "Magic Hour",
      "type": "@gladiator1st/n8n-nodes-magichour.magicHour",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "parameters": {
        "resource": "video",
        "operation": "get",
        "videoProjectId": "REPLACE_WITH_EXISTING_PROJECT_ID"
      }
    },
    {
      "id": "3",
      "name": "Require complete",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        500,
        300
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "status-complete",
              "leftValue": "={{ $json.status }}",
              "rightValue": "complete",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "4",
      "name": "Download result",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        750,
        300
      ],
      "parameters": {
        "url": "={{ $json.downloads[0].url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "data"
            }
          }
        }
      }
    },
    {
      "id": "5",
      "name": "Stop incomplete job",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        750,
        500
      ],
      "parameters": {
        "errorMessage": "={{ \"Generation is \" + $json.status + \". Keep project ID \" + $json.id + \" and resume with Get Details. Do not create another generation to retrieve it.\" }}"
      }
    },
    {
      "id": "6",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        100,
        -60
      ],
      "parameters": {
        "content": "## Recover without creating another paid job\nSelect your API credential and set an existing project ID.\nFor an image, change Resource to Image, select Get Image Details, and fill Image ID.\nRun after the project completes. If it is still pending, this flow stops safely.\nDownload result returns binary `data`; save it with Drive/S3 or download from n8n.\n\nUse a self-hosted n8n instance that allows community nodes. Cloud eligibility is unverified. Tested with n8n 2.37.10 and @gladiator1st/n8n-nodes-magichour 1.0.3. Magic Hour AI source: MIT; see docs/Magic Hour workflow license.txt.",
        "height": 330,
        "width": 550
      }
    }
  ],
  "connections": {
    "Run manually": {
      "main": [
        [
          {
            "node": "Magic Hour",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Magic Hour": {
      "main": [
        [
          {
            "node": "Require complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Require complete": {
      "main": [
        [
          {
            "node": "Download result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Stop incomplete job",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false,
  "tags": [],
  "description": "Retrieve a completed video by its project ID without creating another paid generation; stop if unfinished."
}