{
  "id": "EXwFOQFcJ9xeYQWwpOebR",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI Video Generator with Seedance",
  "tags": [],
  "nodes": [
    {
      "id": "f867ac67-cc89-4bca-9573-3858568f89cb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        3488
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 304,
        "content": "## Request and initiate video\n\nReceives video request and initiates task in Seedance API."
      },
      "typeVersion": 1
    },
    {
      "id": "47abf69c-095c-420c-8e08-aa831aff562a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        3440
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 352,
        "content": "## Monitor video status\n\nWaits and checks video task status from Seedance."
      },
      "typeVersion": 1
    },
    {
      "id": "3379f22a-f511-42af-a327-7b93ea4e7d46",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        3456
      ],
      "parameters": {
        "color": 7,
        "height": 384,
        "content": "## Notify video completion\n\nSends email notification with video link once ready."
      },
      "typeVersion": 1
    },
    {
      "id": "5b50f46e-8e59-4275-9adc-5bc5c0b183fb",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        3440
      ],
      "parameters": {
        "width": 480,
        "height": 608,
        "content": "## AI Video Generator with Seedance\n\n### How it works\n\n1. Receives a video creation request.\n2. Creates a Seedance video task ID.\n3. Waits before checking the video status.\n4. Checks if the video is ready.\n5. Sends an email with the video link if the video is ready.\n6. Repeats status checking until the video is ready.\n\n### Setup steps\n\n- [ ] Configure form trigger node to receive video requests.\n- [ ] Set up API credentials for Seedance video creation.\n- [ ] Configure Gmail node with appropriate credentials.\n\n### Customization\n\nModify the wait time as needed for status checking intervals."
      },
      "typeVersion": 1
    },
    {
      "id": "62509642-a196-4b7a-9a18-4eb63e02919e",
      "name": "Receive Video Request1",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        672,
        3616
      ],
      "parameters": {
        "options": {},
        "formTitle": "Video generator",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Prompt"
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Video Duration",
              "fieldOptions": {
                "values": [
                  {
                    "option": "10"
                  },
                  {
                    "option": "11"
                  },
                  {
                    "option": "12"
                  },
                  {
                    "option": "13"
                  },
                  {
                    "option": "14"
                  },
                  {
                    "option": "15"
                  }
                ]
              }
            },
            {
              "fieldLabel": "Reference Image URL",
              "placeholder": "https://example.com/image.jpg"
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Resolution",
              "fieldOptions": {
                "values": [
                  {
                    "option": "480p"
                  },
                  {
                    "option": "720p"
                  }
                ]
              }
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Aspect Ratio",
              "fieldOptions": {
                "values": [
                  {
                    "option": "16:9"
                  },
                  {
                    "option": "4:3"
                  },
                  {
                    "option": "1:1"
                  },
                  {
                    "option": "3:4"
                  },
                  {
                    "option": "9:16"
                  },
                  {
                    "option": "21:9"
                  }
                ]
              }
            }
          ]
        },
        "formDescription": "Please fill in according to what you want."
      },
      "typeVersion": 2.5
    },
    {
      "id": "49100110-6984-4dac-a8c9-0841355e1003",
      "name": "Create Seedance Video Task ID1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        976,
        3616
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/jobs/createTask",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={\n  \"model\": \"bytedance/seedance-2\",\n  \"input\": {\n    \"prompt\": \"{{ $json['Prompt'] }}\",\n    \"reference_image_urls\": [\n      \"{{ $json['Reference Image URL'] }}\"\n    ],\n    \"return_last_frame\": false,\n    \"generate_audio\": true,\n    \"resolution\": \"{{ $json['Resolution'] }}\",\n    \"aspect_ratio\": \"{{ $json['Aspect Ratio'] }}\",\n    \"duration\": {{ Number($json['Video Duration']) }},\n    \"web_search\": false\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer (Your token here)"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "c65811ec-2e48-4a95-b03d-546166c33c56",
      "name": "Wait Before Status Check1",
      "type": "n8n-nodes-base.wait",
      "position": [
        1216,
        3632
      ],
      "parameters": {
        "amount": 100
      },
      "typeVersion": 1.1
    },
    {
      "id": "fa4529ee-923a-44d3-be7a-c2bb3f7608a8",
      "name": "Check Video Status1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1440,
        3552
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/jobs/recordInfo",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "taskId",
              "value": "={{ $('Create Seedance Video Task ID1').item.json.data.taskId }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer (Your token)"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "d12e995b-f47d-469e-9047-7f3a5579c74a",
      "name": "Video Ready?1",
      "type": "n8n-nodes-base.if",
      "position": [
        1664,
        3632
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c8c2e50b-2d05-486c-a01e-304ff1da2d5b",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{$json.data.state}}",
              "rightValue": "success"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "6923ad28-b013-4d4f-8e86-86d8539549d8",
      "name": "Email with the Video Link1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1888,
        3632
      ],
      "parameters": {
        "sendTo": "(Enter Email here)",
        "message": "video link:  {{ $json.data.resultJson }}",
        "options": {},
        "subject": "=AI Video Link"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "0e474b79-8b91-4357-9981-a40ac694ff79",
  "connections": {
    "Video Ready?1": {
      "main": [
        [
          {
            "node": "Email with the Video Link1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Status Check1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Video Status1": {
      "main": [
        [
          {
            "node": "Video Ready?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Video Request1": {
      "main": [
        [
          {
            "node": "Create Seedance Video Task ID1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Status Check1": {
      "main": [
        [
          {
            "node": "Check Video Status1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Seedance Video Task ID1": {
      "main": [
        [
          {
            "node": "Wait Before Status Check1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}