{
  "name": "Product Image to 3D Video Generator",
  "nodes": [
    {
      "parameters": {
        "resource": "folder",
        "name": "={{ $json.slug }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "root",
          "mode": "list",
          "cachedResultName": "/ (Root folder)"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -640,
        80
      ],
      "id": "42f97292-d198-41c5-b82b-938b506e8746",
      "name": "Create folder",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "5yPxE8Lj8mNumXC9",
          "name": "Google Drive account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const title = $json[\"Product Title\"] || \"default\";\nconst slug = title.toLowerCase().replace(/\\s+/g, '-') + '-' + Math.random().toString(36).substring(2, 8);\nreturn { slug };\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -860,
        80
      ],
      "id": "7f563ac6-d4eb-4b37-89dc-e5fe81f37cb6",
      "name": "Create Slug"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "8ada0859-b74f-4d48-ae95-30c34340e39f",
              "leftValue": "={{ $json.status }}",
              "rightValue": "IN_PROGRESS",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1560,
        180
      ],
      "id": "e3db52ef-fd31-4e93-8310-3bd129a40da1",
      "name": "If"
    },
    {
      "parameters": {
        "amount": 40
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1120,
        180
      ],
      "id": "96169174-5316-4040-8702-888b4661d000",
      "name": "Wait",
      "webhookId": "e5222e53-6dd0-49b8-b128-d1d59c66618d"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.remove.bg/v1.0/removebg",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-Key",
              "value": "api_key"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "size",
              "value": "auto"
            },
            {
              "parameterType": "formBinaryData",
              "name": "image_file",
              "inputDataFieldName": "=data"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "no-bg.png"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        20,
        80
      ],
      "id": "273b5da1-2901-4b42-9863-2c9f41733f79",
      "name": "Bg remove from image",
      "executeOnce": false
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://queue.fal.run/fal-ai/kling-video/v1/standard/image-to-video",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Key api_key"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "A product placed on a reflective surface slowly rotates 360 degrees with dramatic studio lighting, soft shadows, and a smooth camera pan. The background is clean, minimal, and cinematic, highlighting the product’s details and elegance"
            },
            {
              "name": "image_url",
              "value": "=https://drive.usercontent.google.com/download?id={{ $json.fileId }}&export=view&authuser=0"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        900,
        180
      ],
      "id": "193b6e48-8b0b-487a-a507-cafc2e7fabe0",
      "name": "Create video"
    },
    {
      "parameters": {
        "url": "={{ $json.status_url }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Key api_key"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1340,
        105
      ],
      "id": "52c59167-b920-4525-ac93-c6140f3c719e",
      "name": "Check video status"
    },
    {
      "parameters": {
        "formTitle": "Go 2 Market",
        "formDescription": "Give us a product photo, title, and description, and we'll get back to you with professional marketing materials. ",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Product Photo",
              "fieldType": "file",
              "multipleFiles": false,
              "requiredField": true
            },
            {
              "fieldLabel": "Product Title",
              "placeholder": "Product Title",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -1080,
        80
      ],
      "id": "d8859634-ffa4-470d-b4fa-35f83cc394ae",
      "name": "On Form Submission",
      "webhookId": "23a85269-4c16-4508-8085-c9ec9ec1e0f8"
    },
    {
      "parameters": {
        "url": "={{ $json.response_url }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Key api_key"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1780,
        180
      ],
      "id": "9d2d62b0-0608-42a3-a6a0-174bdc277aa8",
      "name": "Get video link"
    },
    {
      "parameters": {
        "url": "={{ $json.video.url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "Video-file"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2000,
        180
      ],
      "id": "34e8c9cf-ef2d-44d5-858c-84800bb7eb65",
      "name": "Convert video link to binary file"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "18k1Gq2X2J3_cbwJ9XyJoysVuhIpWhgc1cmlTKBnB3Yw",
          "mode": "list",
          "cachedResultName": "3D "
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "original image": "={{ $json.webViewLink }}",
            "product-title": "={{ $('On Form Submission').item.json['Product Title'] }}",
            "slug": "={{ $json.name }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "original image",
              "displayName": "original image",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "bg remove image",
              "displayName": "bg remove image",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "product-title",
              "displayName": "product-title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Video link",
              "displayName": "Video link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "slug",
              "displayName": "slug",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        460,
        -20
      ],
      "id": "10a9748e-8068-45ef-add4-9fc3ed4469ed",
      "name": "Upload original image in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ttF4TWNqcrZ3QwUB",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "content": "## 3D Product Video\n\nSample Google Sheet\nCreate your own spreadsheet with these tabs/columns, then select it in the Google Sheets nodes:\n- **3D  → Sheet1**: `original image`, `product-title`, `slug`, `bg remove image`, `Video link`",
        "height": 140,
        "width": 880
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1080,
        -160
      ],
      "typeVersion": 1,
      "id": "afb11f6b-2e5c-49c3-a14e-11d9181915da",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "operation": "share",
        "fileId": {
          "__rl": true,
          "value": "={{ $('Create folder').item.json.id }}",
          "mode": "id"
        },
        "permissionsUi": {
          "permissionsValues": {
            "role": "reader",
            "type": "anyone"
          }
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -420,
        80
      ],
      "id": "49f9ada3-f142-4678-b27c-f995479936a1",
      "name": "Give Access to folder",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "5yPxE8Lj8mNumXC9",
          "name": "Google Drive account"
        }
      }
    },
    {
      "parameters": {
        "name": "={{ $('Create folder').item.json.name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('Create folder').item.json.id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        240,
        -20
      ],
      "id": "350080f1-37e7-4cd7-9560-46031ef14394",
      "name": "Upload original image",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "5yPxE8Lj8mNumXC9",
          "name": "Google Drive account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "let results = [];\nconst items = $(\"On Form Submission\").all()\n\nfor (item of items) {\n    for (key of Object.keys(item.binary)) {\n        results.push({\n            json: {\n                fileName: item.binary[key].fileName\n            },\n            binary: {\n                data: item.binary[key],\n            }\n        });\n    }\n}\n\nreturn results;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -200,
        80
      ],
      "id": "7a87e4d4-0eb2-4d09-974b-f05da0326cbf",
      "name": "Get Image File",
      "executeOnce": true,
      "retryOnFail": true,
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "18k1Gq2X2J3_cbwJ9XyJoysVuhIpWhgc1cmlTKBnB3Yw",
          "mode": "list",
          "cachedResultName": "3D "
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "slug": "={{ $('Create folder').item.json.name }}",
            "bg remove image": "={{ $json.webViewLink }}"
          },
          "matchingColumns": [
            "slug"
          ],
          "schema": [
            {
              "id": "original image",
              "displayName": "original image",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "bg remove image",
              "displayName": "bg remove image",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "product-title",
              "displayName": "product-title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Video link",
              "displayName": "Video link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "slug",
              "displayName": "slug",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        460,
        180
      ],
      "id": "bacc10ef-161f-4986-a500-48689697d32d",
      "name": "Upload Remove BG image in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ttF4TWNqcrZ3QwUB",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "inputDataFieldName": "=no-bg.png",
        "name": "=(no-bg){{ $('Create folder').item.json.name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('Create folder').item.json.id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        240,
        180
      ],
      "id": "441eabcb-c465-4c9b-99cb-83b8760f0b25",
      "name": "Upload Remove BG image",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "5yPxE8Lj8mNumXC9",
          "name": "Google Drive account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const url = $input.first().json['bg remove image'];\n\n// Extract the ID using a regular expression\nconst match = url.match(/\\/d\\/([^/]+)/);\n\nreturn {\n  json: {\n    fileId: match ? match[1] : null,\n  },\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        680,
        180
      ],
      "id": "0fa425ad-4990-4693-905a-795d14c14691",
      "name": "Extract Image ID from URL"
    },
    {
      "parameters": {
        "inputDataFieldName": "Video-file",
        "name": "=Video-file",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('Create folder').item.json.id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2220,
        180
      ],
      "id": "ef778eb0-c9da-4efd-b302-39d5ec2b1cb4",
      "name": "Upload Video",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "5yPxE8Lj8mNumXC9",
          "name": "Google Drive account"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "18k1Gq2X2J3_cbwJ9XyJoysVuhIpWhgc1cmlTKBnB3Yw",
          "mode": "list",
          "cachedResultName": "3D "
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "slug": "={{ $('Create folder').item.json.name }}",
            "Video link": "={{ $('Get video link').item.json.video.url }}"
          },
          "matchingColumns": [
            "slug"
          ],
          "schema": [
            {
              "id": "original image",
              "displayName": "original image",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "bg remove image",
              "displayName": "bg remove image",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "product-title",
              "displayName": "product-title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Video link",
              "displayName": "Video link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "slug",
              "displayName": "slug",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        2440,
        180
      ],
      "id": "0fd1ef15-5b79-4f81-88c5-aed8d7bf56a2",
      "name": "Upload Video Link in Sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ttF4TWNqcrZ3QwUB",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "example@gmail.com",
        "subject": "Product Video",
        "message": "=<p>Hi there! 👋</p>\n\n<p><b>We’re excited to share our latest product video with you! 🎉<b></p>\n\n<p>Watch it here to see the product video you’ll love:<br>\n<a href=\"{{ $('Get video link').item.json.video.url }}\">{{ $('Get video link').item.json.video.url }}</a></p>\n\n<p>Don’t miss out-this could be just what you’ve been looking for! ✨</p>\n\n<p><b>Thanks for being part of our community! 🙌<b></p>\n",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        2660,
        180
      ],
      "id": "38c2ae05-6cc4-416b-a2e1-42f8bfb893e0",
      "name": "Send Mail",
      "webhookId": "28453059-4124-4320-9e2e-06fab6deeeec",
      "credentials": {
        "gmailOAuth2": {
          "id": "psOvjVik3AlwgBZY",
          "name": "Gmail account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Create folder": {
      "main": [
        [
          {
            "node": "Give Access to folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Slug": {
      "main": [
        [
          {
            "node": "Create folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get video link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Check video status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bg remove from image": {
      "main": [
        [
          {
            "node": "Upload original image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload Remove BG image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create video": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check video status": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On Form Submission": {
      "main": [
        [
          {
            "node": "Create Slug",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get video link": {
      "main": [
        [
          {
            "node": "Convert video link to binary file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert video link to binary file": {
      "main": [
        [
          {
            "node": "Upload Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload original image in sheet": {
      "main": [
        []
      ]
    },
    "Upload original image": {
      "main": [
        [
          {
            "node": "Upload original image in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image File": {
      "main": [
        [
          {
            "node": "Bg remove from image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Remove BG image in sheet": {
      "main": [
        [
          {
            "node": "Extract Image ID from URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Remove BG image": {
      "main": [
        [
          {
            "node": "Upload Remove BG image in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Image ID from URL": {
      "main": [
        [
          {
            "node": "Create video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video": {
      "main": [
        [
          {
            "node": "Upload Video Link in Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video Link in Sheet": {
      "main": [
        [
          {
            "node": "Send Mail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Give Access to folder": {
      "main": [
        [
          {
            "node": "Get Image File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3ff891c4-5e9a-4569-829b-e09cd3c4b934",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "f1c26778ec36097a9722a22c47c5e9c01f00b8862dadd0121ec118026a370fa6"
  },
  "id": "rimvhjuwUQIWMtNU",
  "tags": []
}