{
  "id": "AjpGojOwPCarqONg",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Sync Shopify products to WooCommerce with Gemini, BrowserAct & Slack",
  "tags": [],
  "nodes": [
    {
      "id": "4433c6b2-f1a5-4dbc-84a2-d605dac83ac6",
      "name": "Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        896,
        368
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-pro"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "89fac286-b8db-4b8e-b915-317098c39be3",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        480,
        176
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "cb4ae8ec-3fbd-4857-a685-5084a55feb05",
      "name": "Analyze the Products",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        896,
        192
      ],
      "parameters": {
        "text": "={{ $json.title }} ",
        "options": {
          "systemMessage": "You are a strict Input Classification Engine. Your sole purpose is to analyze Products and output a valid JSON object.\n\nDO NOT generate conversational text, markdown formatting, or explanations. Output ONLY the raw JSON string.\n\n   a) Extract the \"Product\" mentioned.\n   b) Analyze the product type to determine the single \"BestSite\":\n      - IF Physical Product (Electronics, Clothes, Home Goods) -> Use \"Amazon\".\n      - IF General Service/Website (VPNs, Banks, Insurance) -> Use \"Trustpilot\".\n      - IF Business Software/SaaS (CRM, Marketing Tools) -> Use \"G2\".\n      - IF Video Game -> Use \"Steam\".\n\n   Output Schema: \n  {\n     \"Type\": \"GetData\", \n     \"Products\": \"Product\",\n     \"BestSite\": \"Name of the site\"\n   }\n\n### Output Constraints\n- Return valid JSON only.\n- Do not use Markdown code blocks.\n- \"BestSite\" must be a single string (e.g., \"Amazon\", \"Trustpilot\", \"G2\", or \"Steam\").\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3
    },
    {
      "id": "84944594-d095-4182-85f3-34d91dabd53b",
      "name": "Google Gemini1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1456,
        368
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-pro"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f88b5d95-6ae3-481a-829d-21c9b5ca512f",
      "name": "Check for Product availability",
      "type": "n8n-nodes-base.if",
      "position": [
        2288,
        304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "657542ba-f1ec-43ef-be60-9c3600b0dd99",
              "operator": {
                "type": "object",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json }}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "3e4ef9b7-9858-4bb9-8197-1de8ad06ecee",
      "name": "Structured Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1040,
        368
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "  {\n     \"Type\": \"Comparison\", \n     \"Products\": \"Product\",\n     \"BestSite\": \"Name of the site\"\n   }"
      },
      "typeVersion": 1.3
    },
    {
      "id": "e2f1bf7c-0376-4622-90fe-cf30cf56890e",
      "name": "Structured Output1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1600,
        368
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"title\": \"String (The exact product name)\",\n  \"sku\": \"String (Generated alphanumeric code)\",\n  \"price\": \"String (The currency and value)\",\n  \"html_body\": \"String (HTML formatted description)\",\n  \"image_list\": [\n    {\n      \"url\": \"String (Direct image link)\",\n      \"name\": \"String (Clean filename for the image)\",\n      \"alt\": \"String (SEO descriptive text)\"\n    }\n  ]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "8e1f20b1-64d6-4356-bc0a-dd19d23a786f",
      "name": "Send Error",
      "type": "n8n-nodes-base.slack",
      "position": [
        2752,
        320
      ],
      "parameters": {
        "text": "=Adding Product Step faces and error -  {{ $('Create Product Data').first().json.output.title }} - {{ $('Create Product Data').first().json.output.sku }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09KLV9DJSX",
          "cachedResultName": "all-browseract-workflow-test"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "078fc1b7-4bdd-4d08-8950-1730cde71ce6",
      "name": "Manual Execution",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        112,
        176
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7a155eb0-24ce-49aa-a6a3-cc9f956b6e73",
      "name": "Get Shopify Products",
      "type": "n8n-nodes-base.shopify",
      "position": [
        272,
        176
      ],
      "parameters": {
        "resource": "product",
        "operation": "getAll",
        "returnAll": true,
        "authentication": "accessToken",
        "additionalFields": {}
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9f06d604-5124-4244-98bf-58ba0106ec4a",
      "name": "Search for Product Info",
      "type": "n8n-nodes-browseract.browserAct",
      "position": [
        1232,
        192
      ],
      "parameters": {
        "type": "WORKFLOW",
        "timeout": 7200,
        "workflowId": "70444920944876283",
        "workflowConfig": {
          "value": {
            "input-Product": "={{ $json.output.Products }}",
            "input-Target_Site": "={{ $json.output.BestSite }}"
          },
          "schema": [
            {
              "id": "input-Google",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "description": "If left blank, the default value defined in BrowserAct will be used.",
              "displayName": "Google",
              "defaultMatch": true
            },
            {
              "id": "input-Product",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "description": "If left blank, the default value defined in BrowserAct will be used.",
              "displayName": "Product",
              "defaultMatch": true
            },
            {
              "id": "input-Target_Site",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "description": "If left blank, the default value defined in BrowserAct will be used.",
              "displayName": "Target_Site",
              "defaultMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "input-Target_Site"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "open_incognito_mode": false
      },
      "credentials": {
        "browserActApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f7d40cd1-9df2-41a6-9a5b-0f93d47ef022",
      "name": "Create Product Data",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1456,
        192
      ],
      "parameters": {
        "text": "={{ $json.output.string }}",
        "options": {
          "systemMessage": "You are an elite E-Commerce Data Architect and Senior Copywriter. Your objective is to transform raw, unstructured product data into a polished, frontend-ready JSON object.\n\n### INPUT DATA:\nYou will receive a JSON array containing product details, including raw specifications in \"Info\", a marketing blurb in \"Description\", \"Reviews\", \"Price\", and a pipe-separated string of \"Images\".\n\n### OUTPUT SCHEMA:\nYou must strictly return a SINGLE valid JSON object matching exactly this structure:\n\n{\n  \"title\": \"String (The exact product name)\",\n  \"sku\": \"String (Generated alphanumeric code)\",\n  \"price\": \"String (The currency and value)\",\n  \"html_body\": \"String (HTML formatted description)\",\n  \"image_list\": [\n    {\n      \"url\": \"String (Direct image link)\",\n      \"name\": \"String (Clean filename for the image)\",\n      \"alt\": \"String (SEO descriptive text)\"\n    }\n  ]\n}\n\n### DATA PROCESSING RULES:\n\n1.  **Title:**\n    - Use the \"Name\" field from the input.\n\n2.  **SKU (Stock Keeping Unit):**\n    - Since an SKU is not provided in the input, you must generate a professional, logical SKU based on the Brand, Model, and key specs (Storage/Color).\n    - Format example: BRAND-MODEL-SPEC-COLOR (e.g., SAM-S24U-256-TI-BLK).\n\n3.  **Price:**\n    - Extract the \"Price\" field exactly as is.\n\n4.  **HTML Body (Description):**\n    - **Goal:** Write a high-converting, \"related\" product description.\n    - **Source:** Synthesize information from \"Info\", \"Description\", and positive sentiments from \"Reviews\".\n    - **Formatting:** Return a raw string containing HTML tags. Use `<h2>` for section headers, `<p>` for paragraphs, and `<ul>`/`<li>` for specification lists.\n    - **Content:**\n        - Start with an engaging hook.\n        - Highlight unique features (e.g., AI capabilities, Camera zoom).\n        - Create a \"Specifications\" section formatted as a clean list.\n        - Ensure the tone is premium, enthusiastic, and error-free.\n\n5.  **Image List:**\n    - **Parsing:** The input \"Images\" field contains URLs separated by a double pipe symbol (`||`). You must split this string to process each image.\n    - **Object Construction:** For every URL found:\n        - `url`: The exact link.\n        - `name`: A short, clean identifier (e.g., \"front-view\", \"rear-camera-detail\").\n        - `alt`: A detailed, SEO-friendly alternative text description based on the product name and the likely content of the image (e.g., \"Samsung Galaxy S24 Ultra Titanium Black Front Display\").\n\n-\tAlways add two images. If only one is available, add it twice\n\n### FINAL CONSTRAINT:\nReturn ONLY the JSON object. Do not wrap the output in markdown code blocks (like ```json). Do not include introductory text.\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3
    },
    {
      "id": "41255956-fb3a-4c06-8df9-f4c4da6fe3cc",
      "name": "Get WooCommerce Products",
      "type": "n8n-nodes-base.wooCommerce",
      "position": [
        2016,
        192
      ],
      "parameters": {
        "options": {
          "sku": "={{ $json.output.sku }}"
        },
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "wooCommerceApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "e8267b9e-b52c-47cf-b01c-6bdd42f9eecd",
      "name": "Import Product to WooCommerce",
      "type": "n8n-nodes-base.wooCommerce",
      "onError": "continueErrorOutput",
      "position": [
        2512,
        336
      ],
      "parameters": {
        "name": "={{ $('Create Product Data').first().json.output.title }}",
        "imagesUi": {
          "imagesValues": [
            {
              "alt": "={{ $('Create Product Data').first().json.output.image_list[0].alt }}",
              "src": "={{ $('Create Product Data').first().json.output.image_list[0].url }}",
              "name": "={{ $('Create Product Data').first().json.output.image_list[0].name }}"
            },
            {
              "alt": "={{ $('Create Product Data').first().json.output.image_list[1].alt }}",
              "src": "={{ $('Create Product Data').first().json.output.image_list[1].url }}",
              "name": "={{ $('Create Product Data').first().json.output.image_list[1].name }}"
            }
          ]
        },
        "resource": "product",
        "operation": "create",
        "metadataUi": {},
        "dimensionsUi": {},
        "additionalFields": {
          "sku": "={{ $('Create Product Data').first().json.output.sku }}",
          "description": "={{ $('Create Product Data').first().json.output.html_body }}",
          "manageStock": true,
          "regularPrice": "={{ $('Create Product Data').first().json.output.price }}",
          "stockQuantity": "=0"
        }
      },
      "credentials": {
        "wooCommerceApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "84aa68b1-e108-4113-9e85-a4723d4d914a",
      "name": "Notify Slack Team of Completion",
      "type": "n8n-nodes-base.slack",
      "position": [
        944,
        48
      ],
      "parameters": {
        "text": "=Product sync from Shopify to WooCommerce is done.",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09KLV9DJSX",
          "cachedResultName": "all-browseract-workflow-test"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "82e5a767-23c2-4898-b6da-f8ec022082e7",
      "name": "Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        -368
      ],
      "parameters": {
        "width": 396,
        "height": 504,
        "content": "## \u26a1 Workflow Overview & Setup\n\n**Summary:** This automation synchronizes new products from a Shopify store to a WooCommerce store. It intelligently checks for existing products to prevent duplicates, uses AI to categorize and refine product data, and notifies the team via Slack upon completion or error.\n\n### Requirements\n* **Credentials:** Shopify, WooCommerce, BrowserAct, Google Gemini (PaLM), Slack.\n* **Mandatory:** BrowserAct API (Template: **Shopify to WooCommerce Multi-Store Sync** )\n\n### How to Use\n1.  **Credentials:** Connect your Shopify Admin, WooCommerce API, Slack, and AI accounts in n8n.\n2.  **BrowserAct Template:** Ensure you have the **Shopify to WooCommerce Multi-Store Sync** template saved if you plan to use the enrichment features.\n3.  **Trigger:** The workflow can be triggered manually or scheduled (needs a schedule node added) to fetch all products from Shopify.\n\n### Need Help?\n[How to Find Your BrowserAct API Key & Workflow ID](https://docs.browseract.com)\n[How to Connect n8n to BrowserAct](https://docs.browseract.com)\n[How to Use & Customize BrowserAct Templates](https://docs.browseract.com)"
      },
      "typeVersion": 1
    },
    {
      "id": "30ead505-6f59-4dc8-b3c7-b987c11d3abd",
      "name": "Step 1 Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 572,
        "height": 140,
        "content": "### \ud83d\udecd\ufe0f Step 1: Fetch & Iterate\n\nThe workflow starts by retrieving all products from the connected Shopify store. It then enters a loop to process each product individually."
      },
      "typeVersion": 1
    },
    {
      "id": "c82c55bd-7c04-455d-97e7-22a51c86bdab",
      "name": "Step 2 Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 1004,
        "height": 108,
        "content": "### \ud83e\udde0 Step 2: AI Classification & Enrichment\n\nFor each product, an AI agent analyzes the title to extract key product details and determine the best category or \"BestSite\" reference (e.g., Amazon, Steam). It can optionally trigger a BrowserAct scraper to fetch additional details if needed."
      },
      "typeVersion": 1
    },
    {
      "id": "d61237d9-ed13-4ca6-a5ad-a470c4910e08",
      "name": "Step 3 Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2016,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 876,
        "height": 128,
        "content": "### \ud83d\udd04 Step 3: Duplicate Check & Sync\n\nBefore creating a new listing, the system checks WooCommerce to see if a product with the same SKU already exists. \n* **If missing:** It creates a new product with the optimized title, description, price, and images.\n* **If found:** It skips creation (or updates, depending on configuration) to avoid duplicates."
      },
      "typeVersion": 1
    },
    {
      "id": "7c8fb4d1-fed3-4398-b152-5745bb238b62",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -368
      ],
      "parameters": {
        "color": 6,
        "width": 560,
        "height": 336,
        "content": "@[youtube](Ad-Wy9bNVGw)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "9a87540f-07ed-4717-aa6f-6c6c9d292fa4",
  "connections": {
    "Send Error": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze the Products",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini1": {
      "ai_languageModel": [
        [
          {
            "node": "Create Product Data",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Notify Slack Team of Completion",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Analyze the Products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Execution": {
      "main": [
        [
          {
            "node": "Get Shopify Products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output": {
      "ai_outputParser": [
        [
          {
            "node": "Analyze the Products",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output1": {
      "ai_outputParser": [
        [
          {
            "node": "Create Product Data",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Create Product Data": {
      "main": [
        [
          {
            "node": "Get WooCommerce Products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze the Products": {
      "main": [
        [
          {
            "node": "Search for Product Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Shopify Products": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search for Product Info": {
      "main": [
        [
          {
            "node": "Create Product Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get WooCommerce Products": {
      "main": [
        [
          {
            "node": "Check for Product availability",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Import Product to WooCommerce": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Product availability": {
      "main": [
        [
          {
            "node": "Import Product to WooCommerce",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}