{
  "id": "aaktvyaSrq2i9cyq",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Scrape & Import Products to Shopify from Any Site (with Variants & Images) (Optimized for shoes - NIKE-To-Shopify)",
  "tags": [],
  "nodes": [
    {
      "id": "cf968d6e-1777-4cb2-9d9e-ca21628363e2",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -208,
        -32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "622cd69f-3b1e-4b0b-affa-b1c3c7c8e238",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        80,
        -32
      ],
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "executeOnce": false,
      "typeVersion": 3
    },
    {
      "id": "5841f40a-d5af-4524-8cd0-b09890e16e87",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1072,
        -32
      ],
      "parameters": {
        "mode": "combineBySql",
        "query": "SELECT\n  input2.*,\n  input1.product.id\nFROM input2\nLEFT JOIN input1\n",
        "options": {}
      },
      "executeOnce": false,
      "typeVersion": 3.2
    },
    {
      "id": "3805d6d4-b3ca-49cd-b254-0d8e2780d848",
      "name": "Create a product",
      "type": "n8n-nodes-base.shopify",
      "position": [
        672,
        -128
      ],
      "parameters": {
        "title": "={{ $json.Title }}",
        "resource": "product",
        "authentication": "accessToken",
        "additionalFields": {
          "tags": "={{ $json.Category }}",
          "vendor": "NIKE",
          "body_html": "={{ $json.Description }}"
        }
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b250920b-4c3d-4b05-96fc-8077dd072b3b",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        1664,
        -16
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "2feda444-70c0-4907-8dff-8a36a3f1ddb5",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        240,
        -144
      ],
      "parameters": {
        "text": "The Products Updated",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09KLV9DJSX",
          "cachedResultName": "all-browseract-workflow-test"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 2.3
    },
    {
      "id": "ba92712b-f204-42e7-b59e-5698803b92fa",
      "name": "Sticky Note - Intro",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        192
      ],
      "parameters": {
        "width": 784,
        "height": 434,
        "content": "## Try It Out!\n### This advanced n8n template automates e-commerce operations by scraping product data from any URL and creating fully detailed products in your Shopify store, complete with variants and images.\n### How it works\n* The workflow reads a list of product page URLs from a **Google Sheet**.\n* It **loops** through each URL to process products one by one.\n* For each URL, a **BrowserAct** workflow scrapes all product details, including title, price, description, sizes, and image links.\n* A **Code** node transforms the raw scraped text into a structured format.\n* The workflow then creates a base product in **Shopify** with the main details.\n* It intelligently uses the Shopify API via **HTTP Request** nodes to add product options (like 'Size'), create a variant for each available size, and upload all associated product images.\n### Requirements\n* **BrowserAct** API account for web scraping.\n* **BrowserAct** n8n Community Node -> ([n8n Nodes BrowserAct](https://www.npmjs.com/package/n8n-nodes-browseract-workflows))\n* **Google Sheets** credentials for the input list.\n* **Shopify** credentials to create products.\n* **Slack** credentials (optional) for notifications.\n* A BrowserAct template named **\u201cBulk Product Scraping From (URLs) and uploading to Shopify (Optimised for shoe - NIKE -> Shopify)\u201d**.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/UpnCKd7GaU) or Visit Our [Blog](https://www.browseract.com/blog)!\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7c89f1fa-1f23-48d2-8e90-65e32ff4b9ee",
      "name": "Sticky Note - How to Use",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        192
      ],
      "parameters": {
        "width": 592,
        "height": 276,
        "content": "## How to use\n\n1.  **Set up Credentials:** Add your credentials for **BrowserAct**, **Google Sheets**, and **Shopify**.\n\n2.  **Set up BrowserAct Template:** Ensure you Use the **\u201cBulk Product Scraping From (URLs) and uploading to Shopify (Optimised for shoe - NIKE -> Shopify)\u201d** template in your BrowserAct account.\n\n3.  **Prepare Your Google Sheet:** In the 'Get row(s) in sheet' node, point it to your spreadsheet. This sheet must have a column named `Product Link` containing the URLs to scrape.\n\n4.  **Configure Shopify:** Ensure your Shopify API credentials have the necessary permissions to write products, variants, and images.\n\n5.  **Activate Workflow:** Manually trigger the workflow to run. You can replace the trigger with a `Schedule Trigger` to run it automatically."
      },
      "typeVersion": 1
    },
    {
      "id": "ffe26ba6-3166-4f7a-bf8a-e73b646c34d3",
      "name": "Sticky Note - Need Help",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        480
      ],
      "parameters": {
        "width": 592,
        "height": 152,
        "content": "### Need Help?\n* #### [How to Find Your BrowseAct API Key & Workflow ID](https://www.youtube.com/watch?v=pDjoZWEsZlE)\n* #### [How to Connect n8n to Browseract](https://www.youtube.com/watch?v=RoYMdJaRdcQ)\n* #### [How to Use & Customize BrowserAct Templates](https://www.youtube.com/watch?v=CPZHFUASncY)\n* #### [How to Use the BrowserAct N8N Community Node](https://youtu.be/j0Nlba2pRLU)\n* #### [Automate Shoe Scraping to Shopify Using n8n, BrowserAct & Google Sheets](https://youtu.be/HPPJNlcMB3I)"
      },
      "typeVersion": 1
    },
    {
      "id": "6cb54cb6-4c54-4aff-8bcf-f1acba28e86d",
      "name": "Sticky Note - Scrape & Transform",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -384
      ],
      "parameters": {
        "color": 5,
        "width": 704,
        "height": 220,
        "content": "### \ud83e\udd16 1. Scrape & Transform\n\nThis section runs for each product URL from your Google Sheet.\n\n* **Loop Over Items:** Processes one product at a time.\n\n* **BrowserAct Nodes:** These execute the scraping task on the product URL.\n\n* **Code Node:** This is a critical step. It takes the raw text output from the scraper (where sizes and images might be in a single line) and transforms it into structured data with clean lists for `sizes` and `images`, making it ready for Shopify.\n\n* **Slack Node:** Sends Alert to Slack Channel"
      },
      "typeVersion": 1
    },
    {
      "id": "64f3bc6b-b1f5-4720-bc5c-08d6b8af14e9",
      "name": "Sticky Note - Create Base Product",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -384
      ],
      "parameters": {
        "color": 4,
        "width": 400,
        "height": 220,
        "content": "### \ud83d\udecd\ufe0f 2. Create Base Product & Options\n\nThis section builds the foundation of the product in Shopify.\n\n* **Create a product:** This Shopify node creates the main product entry using the title, description, and tags from the scraped data.\n\n* **Edit Fields & HTTP Request2:** This is a clever two-step process to add product options. The `Edit Fields` node defines the option name (e.g., 'Shoe Size'), and the `HTTP Request` node sends a PUT request to the Shopify API to update the product with this new option."
      },
      "typeVersion": 1
    },
    {
      "id": "6dc4c499-38aa-47c9-aa52-2d880a7d616f",
      "name": "Sticky Note - Add Variants & Images",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        -384
      ],
      "parameters": {
        "color": 3,
        "width": 512,
        "height": 224,
        "content": "### \ud83c\udfa8 3. Add Variants & Images\n\nThis is where the product is fully fleshed out.\n\n* **Merge & Split Out:** The workflow first merges the newly created `product->id` with the scraped data. Then, the `Split Out` nodes create individual items for each size and each image URL.\n\n* **HTTP Request Nodes:** The workflow now loops through these individual items, making separate API calls to:\n    1.  Create a unique **variant** for each size.\n    2.  Upload each **image** to the product."
      },
      "typeVersion": 1
    },
    {
      "id": "fe34c840-d68a-4bb9-9ccd-aac88d2670c5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -144
      ],
      "parameters": {
        "color": 5,
        "width": 704,
        "height": 320,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8e7eb6ac-cd8c-4cee-9d0e-2363a18e6d47",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -144
      ],
      "parameters": {
        "color": 4,
        "width": 400,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d58e493c-90fe-40ed-8ddd-a3ba751fd814",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        -144
      ],
      "parameters": {
        "color": 3,
        "width": 512,
        "height": 304,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "34f31749-7631-4a8b-922b-c4ba5e6e4b7b",
      "name": "Add Option",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        928,
        -128
      ],
      "parameters": {
        "url": "=https://browseract-2.myshopify.com/admin/api/2025-01/products/{{ $('Create a product').item.json.id }}.json",
        "method": "PUT",
        "options": {},
        "jsonBody": "={ \n  \"product\":\n    {\n       \"id\": \"{{ $('Create a product').item.json.id }}\",\n       \"options\": [{ \"name\": \"{{ $json.Option }}\" }]\n    }\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyAccessTokenApi"
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1b0412b7-5a09-4080-8c9f-06347565a59d",
      "name": "Set Option",
      "type": "n8n-nodes-base.set",
      "position": [
        800,
        -128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bb1db819-3fe9-452b-99b7-5b53f63d1337",
              "name": "Option",
              "type": "string",
              "value": "Shoe Size"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "7cbc6b3c-344d-49bb-a051-14bda23b7b0d",
      "name": "Split Shoe Size",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1248,
        -128
      ],
      "parameters": {
        "include": "selectedOtherFields",
        "options": {},
        "fieldToSplitOut": "sizes",
        "fieldsToInclude": "input1.product->id"
      },
      "typeVersion": 1
    },
    {
      "id": "20ffa8de-a08d-4675-9c8e-3fdcef74267e",
      "name": "Parse Data",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        -16
      ],
      "parameters": {
        "jsCode": "// 1. Get the JSON string from the specific input path you provided.\nconst jsonString = $input.first().json.output.string;\n\n// 2. Parse that string into a real JavaScript array.\nconst productArray = JSON.parse(jsonString);\n\n// 3. Map over the parsed array to transform each product.\nreturn productArray.map(product => {\n  \n  // Split the \"Size\" string into an array of objects.\n  const sizesList = product.Size.split(',').map(size => {\n    return { \"Size\": size.trim().replace(\" \", \"-\") };\n  });\n\n  // Split the \"Images\" string into an array of objects.\n  const imagesList = product.Images.split('||').map(url => {\n    return { \"Image\": url.trim() };\n  });\n\n  // Create the final, structured JSON object.\n  const outputData = {\n    \"Title\": product.Title,\n    \"Price\": product.Price,\n    \"Description\": product.Description,\n    \"Category\": product.Category,\n    \"sizes\": sizesList,\n    \"images\": imagesList\n  };\n  \n  // Return the data in the standard n8n format for the next node.\n  return { json: outputData };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "c4d22786-b5e1-4d26-9915-f5f0f5d5be3d",
      "name": "Split Images",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1248,
        32
      ],
      "parameters": {
        "include": "selectedOtherFields",
        "options": {},
        "fieldToSplitOut": "images",
        "fieldsToInclude": "input1.product->id"
      },
      "typeVersion": 1
    },
    {
      "id": "53f6d29d-9885-4f11-adf3-96db68c88506",
      "name": "Add Images",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1424,
        32
      ],
      "parameters": {
        "url": "=https://browseract-2.myshopify.com/admin/api/2025-01/products/{{ $json[\"input1.product->id\"] }}/images.json",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"image\": {\n    \"src\": \"{{ $json.images.Image }}\"\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyAccessTokenApi"
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "8b8de02b-15ed-490c-ad29-78f0ba1a99db",
      "name": "Add Variant",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        1424,
        -128
      ],
      "parameters": {
        "url": "=https://browseract-2.myshopify.com/admin/api/2025-01/products/{{ $json[\"input1.product->id\"] }}/variants.json",
        "method": "POST",
        "options": {},
        "jsonBody": "= {\n    \"variant\": {\n      \"option1\": \"{{ $json.sizes.Size }}\",\n      \"price\": \"{{ $('Merge').item.json.Price }}\",\n      \"sku\": \"{{ $json['input1.product->id'] }}-SKU-{{$json.sizes.Size.replace(\".\",\"-\").replace(/\\\\s+/g, '-') }}\"\n    }\n  }\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyAccessTokenApi"
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "29e84c2a-d479-4bfa-8eea-976cc17d7334",
      "name": "Get List",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -64,
        -32
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/136xfoE9dbi3Oe29REjwCvRBl9K1zYZQA6Wt5twPVhkQ/edit#gid=0",
          "cachedResultName": "Product Links"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "136xfoE9dbi3Oe29REjwCvRBl9K1zYZQA6Wt5twPVhkQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/136xfoE9dbi3Oe29REjwCvRBl9K1zYZQA6Wt5twPVhkQ/edit?usp=drivesdk",
          "cachedResultName": "Product List Links To add"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "27f2cc15-f5e8-4ab8-9fca-aa3761b76595",
      "name": "Get workflow Data",
      "type": "n8n-nodes-browseract-workflows.browserAct",
      "position": [
        384,
        -16
      ],
      "parameters": {
        "taskId": "={{ $json.id }}",
        "operation": "getTask",
        "maxWaitTime": 900,
        "waitForFinish": true
      },
      "credentials": {
        "browserActApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dbd9504a-14ed-4d4f-9290-43c7558a24e5",
      "name": "Run a workflow",
      "type": "n8n-nodes-browseract-workflows.browserAct",
      "position": [
        240,
        -16
      ],
      "parameters": {
        "workflowId": "57519762985270138",
        "inputParameters": {
          "parameters": [
            {
              "name": "Target_Product_Url",
              "value": "={{ $json[\"Product Link\"] }}"
            }
          ]
        },
        "additionalFields": {
          "saveBrowserData": false
        }
      },
      "credentials": {
        "browserActApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "449baa6e-31c4-4eb5-9b64-364fd83cb783",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Split Shoe Size",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get List": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Images": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Add Option": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Data": {
      "main": [
        [
          {
            "node": "Create a product",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Set Option": {
      "main": [
        [
          {
            "node": "Add Option",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Variant": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Images": {
      "main": [
        [
          {
            "node": "Add Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run a workflow": {
      "main": [
        [
          {
            "node": "Get workflow Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run a workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Shoe Size": {
      "main": [
        [
          {
            "node": "Add Variant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a product": {
      "main": [
        [
          {
            "node": "Set Option",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get workflow Data": {
      "main": [
        [
          {
            "node": "Parse Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}