{
  "name": "AI Shopify Product Builder with Review",
  "nodes": [
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "title",
              "value": "={{ $json.Title }}",
              "type": "string"
            },
            {
              "id": "2",
              "name": "price",
              "value": "={{ $json.Price }}",
              "type": "string"
            },
            {
              "id": "3",
              "name": "stock",
              "value": "={{ $json['Stock Quantity'] }}",
              "type": "number"
            },
            {
              "id": "4",
              "name": "brand",
              "value": "={{ $json['Brand Name'] }}",
              "type": "string"
            },
            {
              "id": "5",
              "name": "product_image",
              "value": "={{ $json['Product Image URL'] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "5156617d-3961-4263-9bef-8c92fd7e8b46",
      "name": "Normalize Product Data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2032,
        288
      ]
    },
    {
      "parameters": {
        "url": "={{ $json.product_image }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "product_image_binary"
            }
          }
        }
      },
      "id": "1d963547-b134-46d0-949a-23a653664f86",
      "name": "Download Product Image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -1824,
        288
      ]
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "responses": {
          "values": [
            {
              "content": "=Generate Shopify product data.\nTitle: {{ $('Normalize Product Data').item.json.title }}\nBrand: {{ $('Normalize Product Data').item.json.brand }}\nProduct Type: {{ $json.product_type }}\n\nReturn JSON:\n{\n  \"description\": \"SEO optimized description with brand\",\n  \"sku\": \"unique sku\",\n  \"vendor\": \"{{ $('Normalize Product Data').item.json.brand }}\",\n  \"product_type\": \"{{ $json.product_type }}\",\n  \"tags\": [\"tag1\", \"tag2\", \"tag3\"]\n}"
            }
          ]
        },
        "builtInTools": {},
        "options": {}
      },
      "id": "33b50bbe-d9ad-42d5-8074-f490737ca4fb",
      "name": "Generate Product Data",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        -1152,
        288
      ],
      "credentials": {
        "openAiApi": {
          "id": "cOpyY5BeKrO1NJ2j",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "responses": {
          "values": [
            {
              "content": "=Create 4 image prompts for product photography.\n\nProduct: {{ $('Normalize Product Data').item.json.title }}\nBrand: {{ $('Normalize Product Data').item.json.brand }}\nColor: {{ $json.color }}\nMaterial: {{ $json.material }}\n\nRules:\n- Use provided product image as base\n- Keep same product shape\n- Add brand name \"{{ $('Normalize Product Data').item.json.brand }}\" on product\n\nReturn JSON:\n{\n  \"main\": \"...white background...\",\n  \"sub1\": \"...lifestyle...\",\n  \"sub2\": \"...close-up...\",\n  \"sub3\": \"...usage...\"\n}"
            }
          ]
        },
        "builtInTools": {},
        "options": {}
      },
      "id": "43a715b1-278a-4033-9f36-ae59eff3061a",
      "name": "Generate Image Prompts",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        -576,
        288
      ],
      "credentials": {
        "openAiApi": {
          "id": "cOpyY5BeKrO1NJ2j",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "model": "gpt-image-1",
        "prompt": "={{ $json.image_prompts.main }}",
        "options": {}
      },
      "id": "e19ebfd3-e862-44b8-82d1-f5314dda235d",
      "name": "Generate Main Image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        160,
        0
      ],
      "credentials": {
        "openAiApi": {
          "id": "cOpyY5BeKrO1NJ2j",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "model": "gpt-image-1",
        "prompt": "={{ $json.image_prompts.sub1 }}",
        "options": {}
      },
      "id": "6dffe59e-a4b8-479f-bbab-f0f20c50654f",
      "name": "Generate Sub Image 1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        160,
        192
      ],
      "credentials": {
        "openAiApi": {
          "id": "cOpyY5BeKrO1NJ2j",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "model": "gpt-image-1",
        "prompt": "={{ $json.image_prompts.sub2 }}",
        "options": {}
      },
      "id": "dee6ba05-4bf7-4a1c-bbc7-5eac6b8ffdbb",
      "name": "Generate Sub Image 2",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        160,
        384
      ],
      "credentials": {
        "openAiApi": {
          "id": "cOpyY5BeKrO1NJ2j",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "model": "gpt-image-1",
        "prompt": "={{ $json.image_prompts.sub3 }}",
        "options": {}
      },
      "id": "271bca9a-6eba-4044-ab2b-c7b5a8eba242",
      "name": "Generate Sub Image 3",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        160,
        576
      ],
      "credentials": {
        "openAiApi": {
          "id": "cOpyY5BeKrO1NJ2j",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "product",
        "operation": "update",
        "productId": "={{ $(\"Create Product in Shopify\").item.json.id }}",
        "updateFields": {
          "published_at": "={{ $now.toISO() }}"
        }
      },
      "id": "6838f106-e2b6-4e5e-bc80-45f5fac5368b",
      "name": "Publish Product",
      "type": "n8n-nodes-base.shopify",
      "typeVersion": 1,
      "position": [
        -16,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "IOGXLoTM4H34KlLW",
          "name": "Shopify account"
        }
      }
    },
    {
      "parameters": {
        "formTitle": "AI Product Generator Form",
        "formDescription": "Enter product details to automatically generate AI product data, images, and Shopify listing.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Title",
              "placeholder": "Enter product name",
              "requiredField": true
            },
            {
              "fieldLabel": "Price",
              "fieldType": "number",
              "placeholder": "Enter price (e.g. 1999)",
              "requiredField": true
            },
            {
              "fieldLabel": "Stock Quantity",
              "fieldType": "number",
              "placeholder": "Enter stock quantity",
              "requiredField": true
            },
            {
              "fieldLabel": "Brand Name",
              "placeholder": "Enter brand (e.g. Boat, Sony)",
              "requiredField": true
            },
            {
              "fieldLabel": "Product Image URL",
              "placeholder": "Product image URL (https://...)",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.5,
      "position": [
        -2224,
        288
      ],
      "id": "39581d3d-ef67-43f0-ad66-5918eedb5d5a",
      "name": "Product Input Form",
      "webhookId": "3fb90cac-0798-45f3-a503-5d6d92a91de8"
    },
    {
      "parameters": {
        "resource": "image",
        "operation": "analyze",
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "text": "=Analyze this product image and return JSON:\n{\n  \"product_type\": \"\",\n  \"color\": \"\",\n  \"material\": \"\",\n  \"style\": \"\",\n  \"use_case\": \"\",\n  \"target_audience\": \"\"\n}",
        "imageUrls": "={{ $json.product_image }}",
        "options": {}
      },
      "id": "f41ca4e1-6e9c-4286-86cb-fb172056aa4b",
      "name": "Analyze Product Image (AI Vision)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        -1600,
        288
      ],
      "credentials": {
        "openAiApi": {
          "id": "cOpyY5BeKrO1NJ2j",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const raw = $input.first().json[0].content[0].text;\n\n// remove ```json and ```\nconst clean = raw.replace(/```json|```/g, '').trim();\n\n// convert to JSON\nconst parsed = JSON.parse(clean);\n\nreturn [parsed];"
      },
      "id": "60afdd82-5e25-4e8c-823d-32980ff7ff01",
      "name": "Extract Image Insights",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1376,
        288
      ]
    },
    {
      "parameters": {
        "jsCode": "const raw = $input.first().json.output[0].content[0].text;\n\n// extract JSON safely (first { to last })\nconst jsonMatch = raw.match(/\\{[\\s\\S]*\\}/);\n\nif (!jsonMatch) {\n  throw new Error(\"No valid JSON found in AI response\");\n}\n\nconst productInfo = JSON.parse(jsonMatch[0]);\n\nconst visionData = $('Extract Image Insights').first().json;\n\nreturn [{\n  json: {\n    ...visionData,\n    ...productInfo\n  }\n}];"
      },
      "id": "7e4045c0-c18a-4aff-88f1-a0ea3502849d",
      "name": "Extract Product Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -800,
        288
      ]
    },
    {
      "parameters": {
        "jsCode": "const raw = $input.first().json.output[0].content[0].text;\n\n// extract only JSON part (between first { and last })\nconst jsonStart = raw.indexOf('{');\nconst jsonEnd = raw.lastIndexOf('}') + 1;\n\nconst clean = raw.slice(jsonStart, jsonEnd);\n\n// parse JSON\nconst prompts = JSON.parse(clean);\n\nconst productData = $('Extract Product Data').first().json;\n\nreturn [{\n  json: {\n    ...productData,\n    image_prompts: prompts\n  }\n}];"
      },
      "id": "ab7b5ade-d8a8-46ea-9615-7bfb3df68ca3",
      "name": "Extract Image Prompts",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -224,
        288
      ]
    },
    {
      "parameters": {
        "numberInputs": 4
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        784,
        256
      ],
      "id": "795003e0-650f-4fc3-a7a7-68249968079e",
      "name": "Merge All Generated Images"
    },
    {
      "parameters": {
        "jsCode": "// ✅ Declare only once\nconst baseData = $('Normalize Product Data').first().json;\nconst productData = $('Extract Image Prompts').first().json;\n\nconst images = $input.all();\n\n// 🔥 Cloudinary URL extract\nconst getUrl = (item) => item.json?.secure_url || '';\n\n// Map images\nconst mainImage = getUrl(images[0]);\nconst sub1 = getUrl(images[1]);\nconst sub2 = getUrl(images[2]);\nconst sub3 = getUrl(images[3]);\n\nreturn [{\n  json: {\n    title: baseData.title,\n    brand: baseData.brand,\n    price: baseData.price,\n    stock: baseData.stock,\n\n    description: productData.description,\n    sku: productData.sku,\n    vendor: productData.vendor,\n    product_type: productData.product_type,\n    tags: Array.isArray(productData.tags) \n      ? productData.tags.join(', ') \n      : productData.tags,\n\n    // ✅ Cloudinary URLs\n    main_image: mainImage,\n    sub1: sub1,\n    sub2: sub2,\n    sub3: sub3,\n\n    status: 'review'\n  }\n}];"
      },
      "id": "9cf2616c-5aa0-4b9d-9a09-fb721293fbb4",
      "name": "Prepare Final Product Payload",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1024,
        288
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno",
          "mode": "list",
          "cachedResultName": "AI Product Review"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "title": "={{ $json.title }}",
            "brand": "={{ $json.brand }}",
            "price": "={{ $json.price }}",
            "stock": "={{ $json.stock }}",
            "description": "={{ $json.description }}",
            "sku": "={{ $json.sku }}",
            "vendor": "={{ $json.vendor }}",
            "product_type": "={{ $json.product_type }}",
            "tags": "={{ $json.tags }}",
            "main_image": "={{ $json.main_image }}",
            "sub1": "={{ $json.sub1 }}",
            "sub2": "={{ $json.sub2 }}",
            "sub3": "={{ $json.sub3 }}",
            "status": "={{ $json.status }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "brand",
              "displayName": "brand",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "price",
              "displayName": "price",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "stock",
              "displayName": "stock",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "displayName": "description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "sku",
              "displayName": "sku",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "vendor",
              "displayName": "vendor",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "product_type",
              "displayName": "product_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "tags",
              "displayName": "tags",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "main_image",
              "displayName": "main_image",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "sub1",
              "displayName": "sub1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "sub2",
              "displayName": "sub2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "sub3",
              "displayName": "sub3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "09c47ed5-b4f0-4169-af89-4e544bad980f",
      "name": "Save Product to Review Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1264,
        288
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Pkc8jJJZleMSmXoy",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "team@forgentsystems.com",
        "subject": "=New Product Ready for Review: {{ $json.title }}",
        "message": "=<h2>New Product Ready for Review</h2>\n<p><strong>Title:</strong> {{ $json.title }}</p>\n<p><strong>Brand:</strong> {{ $json.brand }}</p>\n<p><strong>SKU:</strong> {{ $json.sku }}</p>\n<p><strong>Price:</strong> ${{ $json.price }}</p>\n<p>Please review and approve in Google Sheets.</p>",
        "options": {}
      },
      "id": "d1e625b9-0af8-4799-91d3-1abadcf9409d",
      "name": "Send Review Email Notification",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        1472,
        288
      ],
      "webhookId": "ca730549-a5ea-4346-b8fa-6a3c268f7c64",
      "credentials": {
        "gmailOAuth2": {
          "id": "FCeaxdh3LikFMtgN",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "id": "74c1b20f-4ced-4179-af4c-7f5f46453cfe",
      "name": "Auto Trigger (Every 5 Minutes)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -2192,
        880
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "leftValue": "={{ $json.status }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "rightValue": "approved",
              "id": "2f335cf5-153a-4c17-a300-7e728aa18ada"
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "37216f35-8025-4ea6-9c86-d5948b601d48",
      "name": "Filter Approved Products",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -1744,
        880
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "product",
        "title": "={{ $json.title }}",
        "additionalFields": {
          "body_html": "=<strong>{{ $json.description }}</strong>",
          "images": [
            {}
          ],
          "product_type": "={{ $json.product_type }}",
          "tags": "={{ $json.tags }}",
          "vendor": "={{ $json.vendor }}"
        }
      },
      "id": "925ebcdc-069f-445b-826c-b74402465e51",
      "name": "Create Product in Shopify",
      "type": "n8n-nodes-base.shopify",
      "typeVersion": 1,
      "position": [
        -1472,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "IOGXLoTM4H34KlLW",
          "name": "Shopify account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://your-store.myshopify.com/admin/api/2024-01/products/{{ $('Create Product in Shopify').item.json.id }}/images.json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyOAuth2Api",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"image\": {\n    \"src\": \"{{ $json.image }}\"\n  }\n}",
        "options": {}
      },
      "id": "e3b926ea-46ec-40f2-8485-99627b086497",
      "name": "Add Product Images (Shopify)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -864,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "IOGXLoTM4H34KlLW",
          "name": "Shopify account"
        }
      }
    },
    {
      "parameters": {
        "method": "PUT",
        "url": "=https://your-store.myshopify.com/admin/api/2024-01/variants/{{ $(\"Create Product in Shopify\").item.json.variants[0].id }}.json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyOAuth2Api",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"variant\": {\n    \"id\": {{ $(\"Create Product in Shopify\").item.json.variants[0].id }},\n    \"price\": \"{{ $(\"Fetch Pending Products (Google Sheets)\").item.json.price }}\",\n    \"sku\": \"{{ $(\"Fetch Pending Products (Google Sheets)\").item.json.sku }}\",\n    \"inventory_management\": \"shopify\"\n  }\n}",
        "options": {}
      },
      "id": "72d78bf6-4b7e-4b4c-9843-b43f86bc1224",
      "name": "Update Variant (Price & SKU)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -656,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "IOGXLoTM4H34KlLW",
          "name": "Shopify account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://your-store.myshopify.com/admin/api/2024-01/inventory_levels/set.json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyOAuth2Api",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"location_id\": \"{{ $json.locations[0].id }}\",\n  \"inventory_item_id\": {{ $(\"Create Product in Shopify\").item.json.variants[0].inventory_item_id }},\n  \"available\": {{ $(\"Fetch Pending Products (Google Sheets)\").item.json.stock }}\n}",
        "options": {}
      },
      "id": "957158e5-6e7f-4da1-b583-f4e720d79f8d",
      "name": "Set Inventory Quantity",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -240,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "IOGXLoTM4H34KlLW",
          "name": "Shopify account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno",
          "mode": "list",
          "cachedResultName": "AI Product Review"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "published",
            "sku": "={{ $('Filter Approved Products').item.json.sku }}"
          },
          "matchingColumns": [
            "sku"
          ],
          "schema": [
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "brand",
              "displayName": "brand",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "price",
              "displayName": "price",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "stock",
              "displayName": "stock",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "description",
              "displayName": "description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "sku",
              "displayName": "sku",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "vendor",
              "displayName": "vendor",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "product_type",
              "displayName": "product_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "tags",
              "displayName": "tags",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "main_image",
              "displayName": "main_image",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "sub1",
              "displayName": "sub1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "sub2",
              "displayName": "sub2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "sub3",
              "displayName": "sub3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "bfc64b1a-659d-40f1-b848-c0973b0377e5",
      "name": "Mark as Published (Google Sheet)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        176,
        864
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Pkc8jJJZleMSmXoy",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "team@forgentsystems.com",
        "subject": "=Product Published: {{$json.title}}",
        "message": "=<h2>✅ Product Published Successfully</h2>\n\n<p><strong>Title:</strong> {{ $('Filter Approved Products').item.json.title }}</p>\n<p><strong>SKU:</strong> {{$json.sku}}</p>\n<p><strong>Price:</strong> ${{ $('Filter Approved Products').item.json.price }}</p>\n\n<p><strong>Status:</strong> Published on Shopify 🚀</p>\n\n<br>\n\n<img src=\"{{ $('Filter Approved Products').item.json.main_image }}\" width=\"200\"/>\n\n<br><br>\n\n<p>View in Shopify Admin</p>",
        "options": {}
      },
      "id": "5c6af897-005e-45f1-bbe2-26bfc3772198",
      "name": "Send Product Published Email",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        384,
        864
      ],
      "webhookId": "ca730549-a5ea-4346-b8fa-6a3c268f7c64",
      "credentials": {
        "gmailOAuth2": {
          "id": "FCeaxdh3LikFMtgN",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "content": "## Google Sheet\nCreate your own spreadsheet with these tabs/columns, then select it in the Google Sheets nodes:\n- **AI Product Review → Sheet1**: `title`, `brand`, `price`, `stock`, `description`, `sku`, `vendor`, `product_type`, `tags`, `main_image`, `sub1`, `sub2`, `sub3`, `status`",
        "height": 144,
        "width": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2592,
        48
      ],
      "id": "0441b915-e5d5-4c5a-8b7f-a2a24d7f5af9",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## AI Product Creation & Shopify Publishing On Demand",
        "height": 144,
        "width": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2592,
        288
      ],
      "id": "360f0412-f6ca-42ba-86be-e2f1514f68d8",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## AI Product Creation & Shopify Publishing Scheduled",
        "height": 144,
        "width": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2560,
        864
      ],
      "id": "513dd451-266a-42a0-91af-6019b0321998",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno",
          "mode": "list",
          "cachedResultName": "AI Product Review"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "options": {}
      },
      "id": "3cc92e29-d1b8-4cdf-bc23-1e39eacc1e9e",
      "name": "Fetch Pending Products (Google Sheets)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1968,
        880
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Pkc8jJJZleMSmXoy",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.cloudinary.com/v1_1/djglavbhr/image/upload",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "data"
            },
            {
              "name": "upload_preset",
              "value": "n8n_unsigned"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        368,
        0
      ],
      "id": "0ec02ad5-0580-407c-99a4-5b38a71bc30b",
      "name": "Upload Main Image to cloudinary"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.cloudinary.com/v1_1/djglavbhr/image/upload",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "data"
            },
            {
              "name": "upload_preset",
              "value": "n8n_unsigned"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        368,
        192
      ],
      "id": "d98fdfa1-a360-4eca-b414-9246bb0ff64d",
      "name": "Upload Sub Image 1 to cloudinary"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.cloudinary.com/v1_1/djglavbhr/image/upload",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "data"
            },
            {
              "name": "upload_preset",
              "value": "n8n_unsigned"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        368,
        384
      ],
      "id": "5a04ddd8-49fa-4ab4-a48c-88a11595e16e",
      "name": "Upload Sub Image 2 to cloudinary"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.cloudinary.com/v1_1/djglavbhr/image/upload",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "data"
            },
            {
              "name": "upload_preset",
              "value": "n8n_unsigned"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        368,
        576
      ],
      "id": "3cc53317-cbbe-4308-b4ab-567059db29de",
      "name": "Upload Sub Image 3 to cloudinary"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1056,
        864
      ],
      "id": "b36d09be-5ee5-41aa-add1-4eae1ffb757e",
      "name": "Wait",
      "webhookId": "d39f4b41-30bc-4806-9925-9056d0838f87"
    },
    {
      "parameters": {
        "url": "https://your-store.myshopify.com/admin/api/2024-01/locations.json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyOAuth2Api",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -448,
        864
      ],
      "id": "7dad6ac2-5f16-4e1e-8933-f9ad160bed35",
      "name": "Get Locations",
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "IOGXLoTM4H34KlLW",
          "name": "Shopify account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "return [\n  { json: { image: $('Filter Approved Products').first().json.main_image } },\n  { json: { image: $('Filter Approved Products').first().json.sub1 } },\n  { json: { image: $('Filter Approved Products').first().json.sub2 } },\n  { json: { image: $('Filter Approved Products').first().json.sub3 } }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1264,
        864
      ],
      "id": "5d811a72-8c8d-49a5-9021-988efbb56908",
      "name": "Prepare Product Images Payload"
    }
  ],
  "pinData": {},
  "connections": {
    "Normalize Product Data": {
      "main": [
        [
          {
            "node": "Download Product Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Product Image": {
      "main": [
        [
          {
            "node": "Analyze Product Image (AI Vision)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Product Data": {
      "main": [
        [
          {
            "node": "Extract Product Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image Prompts": {
      "main": [
        [
          {
            "node": "Extract Image Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Main Image": {
      "main": [
        [
          {
            "node": "Upload Main Image to cloudinary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Sub Image 1": {
      "main": [
        [
          {
            "node": "Upload Sub Image 1 to cloudinary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Sub Image 2": {
      "main": [
        [
          {
            "node": "Upload Sub Image 2 to cloudinary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Sub Image 3": {
      "main": [
        [
          {
            "node": "Upload Sub Image 3 to cloudinary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish Product": {
      "main": [
        [
          {
            "node": "Mark as Published (Google Sheet)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Product Input Form": {
      "main": [
        [
          {
            "node": "Normalize Product Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Product Image (AI Vision)": {
      "main": [
        [
          {
            "node": "Extract Image Insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Image Insights": {
      "main": [
        [
          {
            "node": "Generate Product Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Product Data": {
      "main": [
        [
          {
            "node": "Generate Image Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Image Prompts": {
      "main": [
        [
          {
            "node": "Generate Main Image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Sub Image 1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Sub Image 2",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Sub Image 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge All Generated Images": {
      "main": [
        [
          {
            "node": "Prepare Final Product Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Final Product Payload": {
      "main": [
        [
          {
            "node": "Save Product to Review Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Product to Review Sheet": {
      "main": [
        [
          {
            "node": "Send Review Email Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Auto Trigger (Every 5 Minutes)": {
      "main": [
        [
          {
            "node": "Fetch Pending Products (Google Sheets)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Approved Products": {
      "main": [
        [
          {
            "node": "Create Product in Shopify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Product in Shopify": {
      "main": [
        [
          {
            "node": "Prepare Product Images Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Product Images (Shopify)": {
      "main": [
        [
          {
            "node": "Update Variant (Price & SKU)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Variant (Price & SKU)": {
      "main": [
        [
          {
            "node": "Get Locations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Inventory Quantity": {
      "main": [
        [
          {
            "node": "Publish Product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark as Published (Google Sheet)": {
      "main": [
        [
          {
            "node": "Send Product Published Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Pending Products (Google Sheets)": {
      "main": [
        [
          {
            "node": "Filter Approved Products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Main Image to cloudinary": {
      "main": [
        [
          {
            "node": "Merge All Generated Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Sub Image 1 to cloudinary": {
      "main": [
        [
          {
            "node": "Merge All Generated Images",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Upload Sub Image 2 to cloudinary": {
      "main": [
        [
          {
            "node": "Merge All Generated Images",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Upload Sub Image 3 to cloudinary": {
      "main": [
        [
          {
            "node": "Merge All Generated Images",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Add Product Images (Shopify)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Locations": {
      "main": [
        [
          {
            "node": "Set Inventory Quantity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Product Images Payload": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "944d2ff6-5a15-4b28-b196-31ed5981f40c",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "f1c26778ec36097a9722a22c47c5e9c01f00b8862dadd0121ec118026a370fa6"
  },
  "id": "q98wwk8rdVrtdlUZ",
  "tags": []
}