{
  "nodes": [
    {
      "id": "ea1aaf76-ead9-4177-af76-c0a0161eb393",
      "name": "manual-workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -272,
        208
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d6947759-3177-4dfc-a069-858b6bbebd41",
      "name": "create-image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        208,
        208
      ],
      "parameters": {
        "url": "https://queue.fal.run/fal-ai/bytedance/seedream/v4/text-to-image",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json[\"prompt-teks-image\"] }}"
            },
            {
              "name": "image_size",
              "value": "portrait_16_9"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "fff51c32-2466-43a2-9d77-bc7f4829c8ba",
      "name": "wait-10s",
      "type": "n8n-nodes-base.wait",
      "position": [
        432,
        208
      ],
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "c3c36c3d-3a65-462a-ba02-64e69f4323ba",
      "name": "get-status-image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        656,
        208
      ],
      "parameters": {
        "url": "={{ $json.status_url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "072a4c43-dc03-41cd-aa5a-be35a4e91b37",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        96
      ],
      "parameters": {
        "color": 5,
        "width": 1216,
        "height": 368,
        "content": "## create image "
      },
      "typeVersion": 1
    },
    {
      "id": "bc689889-07c0-40d4-ba8f-39adeea36e16",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        96
      ],
      "parameters": {
        "color": 4,
        "width": 464,
        "height": 304,
        "content": "## starter "
      },
      "typeVersion": 1
    },
    {
      "id": "8f0d8ea7-4972-44a9-8b1e-1d83f064d4ad",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        496
      ],
      "parameters": {
        "color": 3,
        "width": 1472,
        "height": 336,
        "content": "## create video"
      },
      "typeVersion": 1
    },
    {
      "id": "cbf76962-1f0e-4fca-8ede-a1825d56903b",
      "name": "is-image-complete",
      "type": "n8n-nodes-base.if",
      "position": [
        864,
        208
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "2961ea56-cb92-440a-bb71-f22292992b02",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "=COMPLETED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2f593c89-8f8c-4a05-bece-25a948eb433b",
      "name": "create-video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -272,
        624
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/bytedance/seedance/v1/pro/image-to-video",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $('prompt').item.json['prompt-image-video'] }}"
            },
            {
              "name": "=image_url",
              "value": "={{ $json.images[0].url }}"
            },
            {
              "name": "aspect_ratio",
              "value": "9:16"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b4b17416-0470-4654-a90a-cd7d1a180fac",
      "name": "wait-30s",
      "type": "n8n-nodes-base.wait",
      "position": [
        -48,
        624
      ],
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "542dd649-d375-459c-87eb-f5aeaa6215d0",
      "name": "get-status-video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        176,
        624
      ],
      "parameters": {
        "url": "={{ $json.status_url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "64e48d64-e9e6-4f0a-a38b-c07239f2bb00",
      "name": "is-video-complete",
      "type": "n8n-nodes-base.if",
      "position": [
        400,
        624
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "2961ea56-cb92-440a-bb71-f22292992b02",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "=COMPLETED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "adbdd764-a51a-497c-9533-8515b384338e",
      "name": "link-video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        656,
        608
      ],
      "parameters": {
        "url": "={{ $json.response_url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6e35939c-2a65-4765-9c01-91914e986cbe",
      "name": "prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        -48,
        208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a41dcc7f-3766-46b6-92d0-ceb2a7f77334",
              "name": "prompt-teks-image",
              "type": "string",
              "value": "=Static camera shot: A dense, dark forest during a heavy thunderstorm. Torrential rain pours down relentlessly, creating visible sheets of water cascading through the thick canopy. Lightning strikes illuminate the entire forest in brilliant white flashes, revealing the intricate details of gnarled trees and dense foliage for split seconds before plunging back into darkness. Thunder rumbles ominously in the distance. The forest floor is soaked and muddy, with small streams forming from the heavy downpour. Branches sway violently in the storm wind. Shot with a fixed, wide-angle camera position that captures the full scope of the tempest, dramatic chiaroscuro lighting from lightning strikes, deep shadows contrasted with intense white light, cinematic composition with rich blacks and stark highlights, moody atmosphere of nature's raw power and fury."
            },
            {
              "id": "f5e50a1f-b630-480f-9764-b0374a8db675",
              "name": "prompt-image-video",
              "type": "string",
              "value": "animate this"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5ee32048-ed82-424d-91fe-ca4a6ac84f26",
      "name": "download-video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        880,
        608
      ],
      "parameters": {
        "url": "={{ $json.video.url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "33b44ac0-e757-4877-a0ef-effcc992a37d",
      "name": "link-image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1136,
        192
      ],
      "parameters": {
        "url": "={{ $json.response_url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ece9754c-dece-4a30-96c7-d02035dba244",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        96
      ],
      "parameters": {
        "color": 6,
        "width": 256,
        "height": 112,
        "content": "## requirements key\n\n- api key [fal.ai](https://fal.ai/dashboard/keys)   \n"
      },
      "typeVersion": 1
    },
    {
      "id": "353b1343-bb30-48ea-a136-7c293a94acdb",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        240
      ],
      "parameters": {
        "color": 6,
        "width": 688,
        "height": 400,
        "content": "## setup step-by-step \n\n1. create a credential fal by using the auth header.\n   - name: \"Authorization\"\n   - value: \"key your-api-key\"\n   - set this credential on all http nodes that make requests to fal.\n2. set prompt in the \"prompt\" node\n   - set the prompt for text-to-image on the prompt node\n   - example: \u201cA futuristic cityscape at sunset, highly detailed, ultra-realistic.\u201d\n3. model default\n   - text-to-image using: seedream v4\n   - image-to-video using: seedance v1 pro\n4. run workflow\n   - run it by clicking the manual-workflow node\n   - process runs automatically until the video is finished and the download link is available.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "bd15ef23-54cd-45fd-9f93-58a437a46e68",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        96
      ],
      "parameters": {
        "color": 6,
        "width": 544,
        "height": 544,
        "content": "## automated visual: from prompt to video\n\nthis workflow streamlines the creation of videos from text prompts by chaining image and video generation steps.\n\nit begins with a prompt that triggers text-to-image generation. once the image is ready, the workflow proceeds to image-to-video conversion. each step includes a built-in waiting time check, ensuring reliability even during longer processing delays.\n\n### future enhancements\n- auto-post results to social media (e.g. youtube, twitter)\n- log image and video urls to google sheets or datatable for tracking\n- send notifications (email or telegram) when processing is complete\n\n### workflow steps\n- input prompt \u2794 request to fal text-to-image\n- wait for image to finish\n- request to fal image-to-video\n- wait for video to finish\n- retrieve image & video urls for download"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "prompt": {
      "main": [
        [
          {
            "node": "create-image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "wait-10s": {
      "main": [
        [
          {
            "node": "get-status-image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "wait-30s": {
      "main": [
        [
          {
            "node": "get-status-video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "link-image": {
      "main": [
        [
          {
            "node": "create-video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "link-video": {
      "main": [
        [
          {
            "node": "download-video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create-image": {
      "main": [
        [
          {
            "node": "wait-10s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create-video": {
      "main": [
        [
          {
            "node": "wait-30s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "manual-workflow": {
      "main": [
        [
          {
            "node": "prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get-status-image": {
      "main": [
        [
          {
            "node": "is-image-complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get-status-video": {
      "main": [
        [
          {
            "node": "is-video-complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "is-image-complete": {
      "main": [
        [
          {
            "node": "link-image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "wait-10s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "is-video-complete": {
      "main": [
        [
          {
            "node": "link-video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "wait-30s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}