{
  "name": "AI-Powered Product Creation & Shopify Publishing Engine with Human Review Loop",
  "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": "f6311d63-001a-4ad2-bb8d-93fbf037fa91",
      "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": "e0bff46f-5ac7-4f66-8a03-2781e97a51f4",
      "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": "87766397-5e19-4f35-a9e4-d535e4198608",
      "name": "Generate Product Data",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        -1152,
        288
      ],
      "credentials": {
        "openAiApi": {
          "id": "Q2LUfj2OH7sTdqGa",
          "name": "heet - 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": "f7b8f334-0328-4aa2-9ee4-c789ebb52828",
      "name": "Generate Image Prompts",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        -576,
        288
      ],
      "credentials": {
        "openAiApi": {
          "id": "Q2LUfj2OH7sTdqGa",
          "name": "heet - OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "model": "gpt-image-1",
        "prompt": "={{ $json.image_prompts.main }}",
        "options": {}
      },
      "id": "03b1201c-869a-4a69-9813-d113b30e0f8d",
      "name": "Generate Main Image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        160,
        0
      ],
      "credentials": {
        "openAiApi": {
          "id": "Q2LUfj2OH7sTdqGa",
          "name": "heet - OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "model": "gpt-image-1",
        "prompt": "={{ $json.image_prompts.sub1 }}",
        "options": {}
      },
      "id": "c868cd46-f6a6-4fc7-b0a4-2f841e3d7205",
      "name": "Generate Sub Image 1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        160,
        192
      ],
      "credentials": {
        "openAiApi": {
          "id": "Q2LUfj2OH7sTdqGa",
          "name": "heet - OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "model": "gpt-image-1",
        "prompt": "={{ $json.image_prompts.sub2 }}",
        "options": {}
      },
      "id": "dcc14875-e8ea-479a-877c-47638ab5df5d",
      "name": "Generate Sub Image 2",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        160,
        384
      ],
      "credentials": {
        "openAiApi": {
          "id": "Q2LUfj2OH7sTdqGa",
          "name": "heet - OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "resource": "image",
        "model": "gpt-image-1",
        "prompt": "={{ $json.image_prompts.sub3 }}",
        "options": {}
      },
      "id": "1d30da0c-b2a8-4d61-bbd8-7d8c1ea93eea",
      "name": "Generate Sub Image 3",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        160,
        576
      ],
      "credentials": {
        "openAiApi": {
          "id": "Q2LUfj2OH7sTdqGa",
          "name": "heet - OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "product",
        "operation": "update",
        "productId": "={{ $(\"Create Product in Shopify\").item.json.id }}",
        "updateFields": {
          "published_at": "={{ $now.toISO() }}"
        }
      },
      "id": "e6362a10-0e71-4d8b-afd6-c09a390fe621",
      "name": "Publish Product",
      "type": "n8n-nodes-base.shopify",
      "typeVersion": 1,
      "position": [
        -16,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "zhRRVhgWwdwSMavx",
          "name": "heet - Shopify Access Token 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": "fe00b3e4-580c-427b-86b6-2121f662a357",
      "name": "Product Input Form",
      "webhookId": "675ec6cd-6486-43d3-8aca-6fec989b945a"
    },
    {
      "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": "3779133e-01cd-4f56-b1e6-5b868dea976d",
      "name": "Analyze Product Image (AI Vision)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        -1600,
        288
      ],
      "credentials": {
        "openAiApi": {
          "id": "Q2LUfj2OH7sTdqGa",
          "name": "heet - 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": "3df19334-60ae-4cae-8094-9b0548efd854",
      "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": "5e27fabb-97a7-42b2-9036-b765303e01fc",
      "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": "486ea2e5-ec23-45c6-894b-76f4be1a4da7",
      "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": "99dd3ea7-41ad-4266-af67-7323a47ad8cf",
      "name": "Merge All Generated Images"
    },
    {
      "parameters": {
        "jsCode": "// ✅ ONLY ONCE declare karo\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": "e22d1829-f923-47ac-8a48-6928e3a7230a",
      "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",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno/edit#gid=0"
        },
        "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": "02aa7245-adeb-437c-813d-704eb41d52ce",
      "name": "Save Product to Review Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1264,
        288
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wQXWIxCRV7ybbbNL",
          "name": "heet - Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "hit.infyom@gmail.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": "bb80b479-f02d-49c2-934b-7c8042e6febc",
      "name": "Send Review Email Notification",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        1472,
        288
      ],
      "webhookId": "5de32e84-d0f2-4cee-9fac-808a6dff7b10",
      "credentials": {
        "gmailOAuth2": {
          "id": "cHKYN6EkFUBueYYw",
          "name": "Heet - Gmail"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "id": "aedf19f4-a28c-4f0a-a5f5-42aefb844436",
      "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": "37ecdc72-6579-486c-b4ce-42c0edf3e454",
      "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": "f8cc22c8-e433-4be4-b9b8-480fe71de708",
      "name": "Create Product in Shopify",
      "type": "n8n-nodes-base.shopify",
      "typeVersion": 1,
      "position": [
        -1472,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "zhRRVhgWwdwSMavx",
          "name": "heet - Shopify Access Token account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://n8n-demo-2027.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": "5bbaa5d7-4806-4545-af39-6288b4516276",
      "name": "Add Product Images (Shopify)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -864,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "zhRRVhgWwdwSMavx",
          "name": "heet - Shopify Access Token account"
        }
      }
    },
    {
      "parameters": {
        "method": "PUT",
        "url": "=https://n8n-demo-2027.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": "716d4bb6-6f89-4a36-870d-3b56e5ccfff4",
      "name": "Update Variant (Price & SKU)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -656,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "zhRRVhgWwdwSMavx",
          "name": "heet - Shopify Access Token account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://n8n-demo-2027.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": "382f0441-dcac-4da4-a900-50dded2e000e",
      "name": "Set Inventory Quantity",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -240,
        864
      ],
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "zhRRVhgWwdwSMavx",
          "name": "heet - Shopify Access Token account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno",
          "mode": "list",
          "cachedResultName": "AI Product Review",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno/edit#gid=0"
        },
        "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": "765800c3-b8f9-489a-9980-2c7daf5776fc",
      "name": "Mark as Published (Google Sheet)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        176,
        864
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wQXWIxCRV7ybbbNL",
          "name": "heet - Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "hit.infyom@gmail.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": "30a54cde-fc73-4b2f-b581-14ce75cb873e",
      "name": "Send Product Published Email",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        384,
        864
      ],
      "webhookId": "5de32e84-d0f2-4cee-9fac-808a6dff7b10",
      "credentials": {
        "gmailOAuth2": {
          "id": "cHKYN6EkFUBueYYw",
          "name": "Heet - Gmail"
        }
      }
    },
    {
      "parameters": {
        "content": "## Google Sheet\nhttps://docs.google.com/spreadsheets/d/1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno/edit?gid=0#gid=0",
        "height": 144,
        "width": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2592,
        48
      ],
      "id": "61c8d1ed-6617-43df-9545-d867c62cb27b",
      "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": "b33e3753-0ae2-4fde-8e4e-6e49cbf5adaf",
      "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": "cc7b5c45-4d57-417c-83eb-143a5c180340",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno",
          "mode": "list",
          "cachedResultName": "AI Product Review",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1daefTH5-96VzQiH_Utq_CYUAfVQJo2k2QnLgr8bGvno/edit#gid=0"
        },
        "options": {}
      },
      "id": "f877d60d-3200-4b66-b722-63b06dcbdd11",
      "name": "Fetch Pending Products (Google Sheets)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1968,
        880
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wQXWIxCRV7ybbbNL",
          "name": "heet - Google Sheets"
        }
      }
    },
    {
      "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": "844e0321-3a50-4887-8dcc-a32688dae798",
      "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": "54468441-809b-4a32-a0c4-0b99c68b8c01",
      "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": "056c2089-ae82-4099-8694-87b332ebd879",
      "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": "396198f0-ba21-4813-aa79-55229d2c59bc",
      "name": "Upload Sub Image 3 to cloudinary"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1056,
        864
      ],
      "id": "a0f8ab02-f01c-4542-b9df-c04605f12652",
      "name": "Wait",
      "webhookId": "40fc8e79-d30c-4e04-bcc1-789ca7c64773"
    },
    {
      "parameters": {
        "url": "https://n8n-demo-2027.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": "8dc770cd-71f1-49a7-bcda-b9a3d5a7d1ed",
      "name": "Get Locations",
      "credentials": {
        "shopifyOAuth2Api": {
          "id": "zhRRVhgWwdwSMavx",
          "name": "heet - Shopify Access Token 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": "901821fa-2b8d-444d-8a21-8ad82a6bc2d8",
      "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": "b6f32ed9-31ed-4d62-a2b0-ab035622865e",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "9272721148ea09184b6bbb7ce6219dab088562dd450e2df8280d57c2e34c7d84"
  },
  "id": "0ZCzckwBsEDvIAsN",
  "tags": []
}