{
  "name": "Wan 2.7 i2v product-shot pipeline",
  "nodes": [
    {
      "parameters": {
        "sheetId": "YOUR_SHEET_ID",
        "range": "Sheet1!A:C",
        "options": {
          "valueRenderMode": "UNFORMATTED_VALUE"
        }
      },
      "name": "Sheets: rows in",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        240,
        300
      ],
      "typeVersion": 4
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.atlascloud.ai/api/v1/model/generateImage",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"model\": \"alibaba/wan-2.7/image-to-video\",\n  \"prompt\": \"{{$json.prompt}}\",\n  \"first_frame_image\": \"{{$json.image_url}}\",\n  \"duration\": 6,\n  \"resolution\": \"1080P\",\n  \"ratio\": \"16:9\",\n  \"seed\": -1\n}",
        "options": {
          "timeout": 60000
        }
      },
      "name": "HTTP: submit i2v",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        460,
        300
      ],
      "typeVersion": 4.2,
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "amount": 10,
        "unit": "seconds"
      },
      "name": "Wait 10s",
      "type": "n8n-nodes-base.wait",
      "position": [
        680,
        300
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://api.atlascloud.ai/api/v1/model/prediction/{{$node[\"HTTP: submit i2v\"].json.data.id}}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "name": "HTTP: poll",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        900,
        300
      ],
      "typeVersion": 4.2,
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json.data.status}}",
              "operation": "notEqual",
              "value2": "completed"
            }
          ]
        }
      },
      "name": "If not done",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        300
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "url": "={{$json.data.outputs[0]}}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "name": "HTTP: download mp4",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1340,
        200
      ],
      "typeVersion": 4.2
    },
    {
      "parameters": {
        "operation": "upload",
        "parents": [
          "YOUR_DRIVE_FOLDER_ID"
        ],
        "name": "={{$now.format('yyyyMMdd_HHmmss')}}_wan27_i2v.mp4"
      },
      "name": "Drive: upload",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1560,
        200
      ],
      "typeVersion": 3
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "sheetId": "YOUR_SHEET_ID",
        "range": "Sheet1!A:E"
      },
      "name": "Sheets: writeback",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1780,
        200
      ],
      "typeVersion": 4
    }
  ],
  "connections": {
    "Sheets: rows in": {
      "main": [
        [
          {
            "node": "HTTP: submit i2v",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: submit i2v": {
      "main": [
        [
          {
            "node": "Wait 10s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 10s": {
      "main": [
        [
          {
            "node": "HTTP: poll",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: poll": {
      "main": [
        [
          {
            "node": "If not done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If not done": {
      "main": [
        [
          {
            "node": "Wait 10s",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP: download mp4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: download mp4": {
      "main": [
        [
          {
            "node": "Drive: upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Drive: upload": {
      "main": [
        [
          {
            "node": "Sheets: writeback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}