{
  "name": "Kie Motion Control Full Auto Workflow",
  "nodes": [
    {
      "parameters": {},
      "id": "1",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        200,
        300
      ]
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": "YOUR_IMAGE_FILE_ID"
      },
      "id": "2",
      "name": "Download Image (Drive)",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        450,
        200
      ],
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": "YOUR_VIDEO_FILE_ID"
      },
      "id": "3",
      "name": "Download Video (Drive)",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        450,
        400
      ],
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.kie.ai/v1/files/upload",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        },
        "sendBinaryData": true,
        "binaryPropertyName": "data"
      },
      "id": "4",
      "name": "Upload Image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        700,
        200
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.kie.ai/v1/files/upload",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        },
        "sendBinaryData": true,
        "binaryPropertyName": "data"
      },
      "id": "5",
      "name": "Upload Video",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        700,
        400
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.kie.ai/v1/kling/motion-control",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "jsonParameters": true,
        "sendBody": true,
        "bodyParametersJson": "{\n  \"input_urls\": [\"{{$node[\"Upload Image\"].json[\"url\"]}}\"],\n  \"video_urls\": [\"{{$node[\"Upload Video\"].json[\"url\"]}}\"],\n  \"prompt\": \"realistic cinematic motion, natural facial expression\"\n}"
      },
      "id": "6",
      "name": "Create Motion Task",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        950,
        300
      ]
    },
    {
      "parameters": {
        "amount": 20,
        "unit": "seconds"
      },
      "id": "7",
      "name": "Wait 20 Seconds",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        1150,
        300
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://api.kie.ai/v1/tasks/{{$node[\"Create Motion Task\"].json[\"task_id\"]}}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        }
      },
      "id": "8",
      "name": "Check Status",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1350,
        300
      ]
    },
    {
      "parameters": {
        "url": "={{$node[\"Check Status\"].json[\"output_url\"]}}",
        "responseFormat": "file"
      },
      "id": "9",
      "name": "Download Final Video",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1550,
        300
      ]
    },
    {
      "parameters": {
        "operation": "upload",
        "fileName": "Kie_Output.mp4",
        "binaryData": true,
        "binaryPropertyName": "data",
        "parents": [
          "YOUR_OUTPUT_FOLDER_ID"
        ]
      },
      "id": "10",
      "name": "Upload Final to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1750,
        300
      ],
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Download Image (Drive)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Download Video (Drive)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image (Drive)": {
      "main": [
        [
          {
            "node": "Upload Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video (Drive)": {
      "main": [
        [
          {
            "node": "Upload Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image": {
      "main": [
        [
          {
            "node": "Create Motion Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video": {
      "main": [
        [
          {
            "node": "Create Motion Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Motion Task": {
      "main": [
        [
          {
            "node": "Wait 20 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 20 Seconds": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Status": {
      "main": [
        [
          {
            "node": "Download Final Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Final Video": {
      "main": [
        [
          {
            "node": "Upload Final to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}