{
  "id": "Tf5WXvTtXGlugu6f",
  "name": "BrowserAct Product Image to AI Video Automation",
  "tags": [],
  "nodes": [
    {
      "id": "bab21957-2460-4d61-be9f-365703ac5ee5",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        112,
        -128
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a6b5b7fd-fe58-44ce-ab6b-c2ed4acc912f",
      "name": "Run a workflow",
      "type": "n8n-nodes-browseract.browserAct",
      "position": [
        320,
        -128
      ],
      "parameters": {
        "type": "WORKFLOW",
        "workflowId": "73948758645931553",
        "workflowConfig": {
          "value": {},
          "schema": [
            {
              "id": "input-Target_URL",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "description": "If left blank, the default value defined in BrowserAct will be used.",
              "displayName": "Target_URL",
              "defaultMatch": true
            },
            {
              "id": "input-Search_Keyword",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "description": "If left blank, the default value defined in BrowserAct will be used.",
              "displayName": "Search_Keyword",
              "defaultMatch": true
            },
            {
              "id": "input-Data_Limit",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "description": "If left blank, the default value defined in BrowserAct will be used.",
              "displayName": "Data_Limit",
              "defaultMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "input-Target_URL",
            "input-Search_Keyword",
            "input-Data_Limit"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "credentials": {
        "browserActApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "adaba9ad-f0c5-44a8-8d76-852a868e7bcb",
      "name": "limit_products",
      "type": "n8n-nodes-base.limit",
      "position": [
        736,
        -128
      ],
      "parameters": {
        "maxItems": 2
      },
      "typeVersion": 1
    },
    {
      "id": "4385e759-a72e-491a-ae2e-2a989347367b",
      "name": "fetch_image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        352,
        144
      ],
      "parameters": {
        "url": "={{ $json.image_url }}",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "9551dca5-8348-44ce-9d93-340608cd6a6b",
      "name": "iterate_products",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        112,
        128
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "b6b2366b-a97e-4392-8235-94396d6369de",
      "name": "set_prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        1136,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8fcbcd5d-70c8-49ba-a819-6332efaf089d",
              "name": "prompt",
              "type": "string",
              "value": "=Generate a professional 8-second e-commerce showcase video for this fashion/furniture item. The camera should perform a slow, elegant 360-degree pan in a bright studio to show texture and design details."
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0e515cf1-27ed-4145-beda-c87a5912ff6e",
      "name": "check_response",
      "type": "n8n-nodes-base.if",
      "position": [
        720,
        384
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "006f9cc1-e58b-4d90-ab44-1bef744115f3",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $json.done }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "511608c0-ae60-4971-8173-65ebf4edcfb2",
      "name": "download_video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        928,
        400
      ],
      "parameters": {
        "url": "={{ $node[\"Check video generation status\"].json.response.generateVideoResponse.generatedSamples[0].video.uri }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "7da2a9d2-7622-44a0-830a-0e1e7b6feaa6",
      "name": "upload_output_video",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1136,
        400
      ],
      "parameters": {
        "name": "={{ $(\"iterate_products\").item.json.title }}.mp4",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1lRC0KN0DBl9lljHzPN1NyEVF60_xorMB",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1lRC0KN0DBl9lljHzPN1NyEVF60_xorMB",
          "cachedResultName": "n8n video"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d81aa256-735d-4954-b162-6c9691c36075",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -64
      ],
      "parameters": {
        "width": 368,
        "height": 752,
        "content": "How it works\nThis workflow uses BrowserAct to run an AI-powered browser automation that collects structured product data, including image URLs and related metadata.\n\nThe workflow then:\n\nParses the BrowserAct output into individual product items\nIterates through each product entry\nDownloads the product image and converts it into Base64 format\nSends the image together with a predefined prompt to an AI video generation API\nPolls the generation status until the video is ready\nDownloads the generated short video file\nUploads both the original product image and the generated video to Google Drive\nEach product is processed independently, making the workflow suitable for batch-based and scalable automation scenarios.\n\nSet up steps\nConnect your BrowserAct account to enable the browser-based data extraction workflow\nConnect a Google Drive account where source images and generated videos will be stored\nReview the input parameters provided by the BrowserAct node, such as target URL, search keyword, or data limit\nAdjust the product processing limit or batch size if you want to control execution time\nRun the workflow manually once to verify the output before using it in regular automation\nAdditional explanations and configuration details are provided as sticky notes directly inside the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "552ee742-720c-4ee9-a2d4-25b717331a5e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -272
      ],
      "parameters": {
        "color": 4,
        "width": 832,
        "height": 320,
        "content": "Title\uff1aData collection\n\nText\uff1aRun a BrowserAct workflow to collect structured product items using real browser execution.\nThis step provides the initial data for the workflow and outputs product records containing image URLs and basic metadata for downstream processing."
      },
      "typeVersion": 1
    },
    {
      "id": "7b308b1e-a176-47e6-81a0-7e52fadd3dce",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        368
      ],
      "parameters": {
        "color": 4,
        "width": 800,
        "height": 320,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTitle\uff1aVideo generation\nText\uff1aSubmit a video generation request using the prepared image and prompt.\nThe workflow waits and repeatedly checks generation status until the video is ready.\nThis asynchronous pattern is required and the Wait step should not be removed."
      },
      "typeVersion": 1
    },
    {
      "id": "f6ce5d8d-4a72-426a-9a72-87dd453cfa50",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        48
      ],
      "parameters": {
        "color": 5,
        "width": 1216,
        "height": 320,
        "content": " Title\uff1aImage preparation\n Text\uff1aDownload each product image and prepare it for AI video generation.\n Images are fetched individually and converted into the required format so they can be safely passed to the video generation API."
      },
      "typeVersion": 1
    },
    {
      "id": "b54a89a3-a03c-4cad-a7dd-30cb014c3d81",
      "name": "Parse BrowserAct output",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        -128
      ],
      "parameters": {
        "jsCode": "// 1. Extract the JSON string returned by BrowserAct\nconst raw = $json.output.string;\n\n// 2. Parse it into a valid JavaScript object (array)\nlet products;\ntry {\n  products = JSON.parse(raw);\n} catch (e) {\n  throw new Error(\"JSON parse failed: \" + e.message);\n}\n\n// 3. Ensure the data is an array and convert it into n8n item format\nif (!Array.isArray(products)) {\n  throw new Error(\"Parsed data is not an array\");\n}\n\n// 4. Return the result as iterable n8n items\nreturn products.map(item => ({\n  json: item\n}));\n"
      },
      "typeVersion": 2
    },
    {
      "id": "9627fb5b-99a4-45b9-8c08-89e55a49e00b",
      "name": "Submit video generation request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        112,
        400
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"instances\": [\n    {\n      \"prompt\": \"{{ $json.prompt }}\",\n      \"image\": {\n        \"mimeType\": \"image/jpeg\",\n        \"bytesBase64Encoded\":\"{{ $node['Convert image to Base64'].json.data }}\"\n      }\n    }\n  ],\n  \"parameters\": {\n    \"durationSeconds\": 8,\n    \"aspectRatio\": \"9:16\"\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "6cad0918-2276-4fde-8f43-1444191ebc2b",
      "name": "Wait for video generation",
      "type": "n8n-nodes-base.wait",
      "position": [
        304,
        384
      ],
      "parameters": {
        "amount": 120
      },
      "typeVersion": 1.1
    },
    {
      "id": "80ccdb97-cdbd-4ebd-99bd-acd5a203c3cb",
      "name": "Check video generation status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        496,
        384
      ],
      "parameters": {
        "url": "=https://generativelanguage.googleapis.com/v1beta/{{ $json.name }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "ec0d61c2-3ef5-4374-a6eb-dce948412770",
      "name": "Prepare image for video generation",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        720,
        144
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "data"
      },
      "typeVersion": 1.1
    },
    {
      "id": "bc7b25cd-04e1-44e2-9ea2-90a56634ce69",
      "name": "Convert image to Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        528,
        144
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1.1
    },
    {
      "id": "e59e9729-c06e-49e3-a3e0-089efae8d4c8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        368
      ],
      "parameters": {
        "width": 416,
        "height": 320,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTitle\uff1aGoogle Drive sync\nText\uff1aUpload source images and generated videos to Google Drive."
      },
      "typeVersion": 1
    },
    {
      "id": "c3c7af01-2807-42b8-8efb-6cf41c0e20ce",
      "name": "upload_source_image",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        912,
        144
      ],
      "parameters": {
        "name": "={{ $(\"iterate_products\").item.json.title }}.jpg",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "224ee203-2602-41f4-a11f-269507e5ec3e",
  "connections": {
    "set_prompt": {
      "main": [
        [
          {
            "node": "Submit video generation request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fetch_image": {
      "main": [
        [
          {
            "node": "Convert image to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run a workflow": {
      "main": [
        [
          {
            "node": "Parse BrowserAct output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "check_response": {
      "main": [
        [
          {
            "node": "download_video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for video generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "download_video": {
      "main": [
        [
          {
            "node": "upload_output_video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "limit_products": {
      "main": [
        [
          {
            "node": "iterate_products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "iterate_products": {
      "main": [
        [],
        [
          {
            "node": "iterate_products",
            "type": "main",
            "index": 0
          },
          {
            "node": "fetch_image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "upload_output_video": {
      "main": [
        [
          {
            "node": "iterate_products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "upload_source_image": {
      "main": [
        [
          {
            "node": "set_prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert image to Base64": {
      "main": [
        [
          {
            "node": "Prepare image for video generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse BrowserAct output": {
      "main": [
        [
          {
            "node": "limit_products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for video generation": {
      "main": [
        [
          {
            "node": "Check video generation status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check video generation status": {
      "main": [
        [
          {
            "node": "check_response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Submit video generation request": {
      "main": [
        [
          {
            "node": "Wait for video generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare image for video generation": {
      "main": [
        [
          {
            "node": "upload_source_image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Run a workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}