{
  "name": "PixelVault — WooCommerce product images to variant URLs",
  "nodes": [
    {
      "id": "d51da945-9c8b-4b9f-b247-3e6aea69d3d9",
      "name": "WooCommerce product created",
      "type": "n8n-nodes-base.wooCommerceTrigger",
      "typeVersion": 1,
      "position": [
        0,
        300
      ],
      "parameters": {
        "event": "product.created"
      }
    },
    {
      "id": "53e25766-dfd7-439e-9d3e-529ded28bdfd",
      "name": "One item per image",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        240,
        300
      ],
      "parameters": {
        "fieldToSplitOut": "images",
        "options": {}
      }
    },
    {
      "id": "cd81fd06-e809-4d53-8297-2b6933cf9784",
      "name": "Import into PixelVault",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        300
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.pixelvault.dev/v1/images",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ { url: $json.src, folder: String(($('WooCommerce product created').item.json.sku || 'product-' + $('WooCommerce product created').item.json.id)).replace(/[^A-Za-z0-9_-]/g, '-').slice(0, 64), dedupe: true } }}",
        "options": {
          "timeout": 60000
        }
      }
    },
    {
      "id": "a2ac009f-d8c8-44f2-b380-bf18148bc8e8",
      "name": "Variant URLs",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        300
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "f6fa7ab6-7276-4327-aad5-7e13303e83f4",
              "name": "master_url",
              "value": "={{ $json.data.url }}",
              "type": "string"
            },
            {
              "id": "ddc4e9a3-f037-4abf-97e2-6d06da95522d",
              "name": "marketplace_2000_white",
              "value": "={{ $json.data.url }}?segment=foreground&background=white&w=2000&h=2000&fit=pad",
              "type": "string"
            },
            {
              "id": "1ec33823-827f-4c14-9626-773b1bf512cd",
              "name": "listing_640",
              "value": "={{ $json.data.url }}?w=640&h=640&fit=cover&fmt=auto",
              "type": "string"
            },
            {
              "id": "5ecb8bad-f9d3-4c56-8e16-67126fb59638",
              "name": "product_page_1200",
              "value": "={{ $json.data.url }}?w=1200&fmt=auto",
              "type": "string"
            },
            {
              "id": "d7bb5614-3182-4403-baad-f40d219b2f75",
              "name": "thumb_200",
              "value": "={{ $json.data.url }}?w=200&h=200&fit=cover&gravity=auto",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "952831e4-dce3-466e-a5de-e290ad79d5fc",
      "name": "Setup instructions",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -120
      ],
      "parameters": {
        "content": "## WooCommerce product images to PixelVault\n1. Select your WooCommerce credential on the trigger.\n2. In Import into PixelVault select a Header Auth credential: Name = Authorization; Value = Bearer YOUR_PIXELVAULT_API_KEY.\n3. Test with one product. Each image is imported into a folder named after the SKU (or product-<id>); dedupe skips identical files.\n4. The last node returns variant URLs. Add a node to write them back to your store, sheet or feed.\n\nThe marketplace variant uses the AI cut-out (keyed projects only). Check each marketplace's current rules.\n\nSetup guide: https://pixelvault.dev/integrations/online-store/",
        "height": 360,
        "width": 850
      }
    }
  ],
  "connections": {
    "WooCommerce product created": {
      "main": [
        [
          {
            "node": "One item per image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "One item per image": {
      "main": [
        [
          {
            "node": "Import into PixelVault",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Import into PixelVault": {
      "main": [
        [
          {
            "node": "Variant URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "tags": []
}
