{
  "name": "PixelVault — Shopify product images to variant URLs",
  "nodes": [
    {
      "id": "ac311ef3-bbff-473a-b321-9027c5f86303",
      "name": "Shopify product created",
      "type": "n8n-nodes-base.shopifyTrigger",
      "typeVersion": 1,
      "position": [
        0,
        300
      ],
      "parameters": {
        "topic": "products/create"
      }
    },
    {
      "id": "a8f6fa20-1c8c-4abc-b88d-ccd45f9208db",
      "name": "One item per image",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        240,
        300
      ],
      "parameters": {
        "fieldToSplitOut": "images",
        "options": {}
      }
    },
    {
      "id": "199fc3f2-7076-47ad-ad1f-62cbdad0e9ff",
      "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(($('Shopify product created').item.json.variants?.[0]?.sku || 'product-' + $('Shopify product created').item.json.id)).replace(/[^A-Za-z0-9_-]/g, '-').slice(0, 64), dedupe: true } }}",
        "options": {
          "timeout": 60000
        }
      }
    },
    {
      "id": "a8ad1de7-979b-4ce6-bbb8-1cc81bbbfe3c",
      "name": "Variant URLs",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        300
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "b1a0248a-1eda-4d72-8169-1fbe3340e272",
              "name": "master_url",
              "value": "={{ $json.data.url }}",
              "type": "string"
            },
            {
              "id": "326fc3bf-3c55-4568-af2a-2c78e9713326",
              "name": "marketplace_2000_white",
              "value": "={{ $json.data.url }}?segment=foreground&background=white&w=2000&h=2000&fit=pad",
              "type": "string"
            },
            {
              "id": "3375ef9a-4e95-4ae2-b2df-c099b02d3ac1",
              "name": "listing_640",
              "value": "={{ $json.data.url }}?w=640&h=640&fit=cover&fmt=auto",
              "type": "string"
            },
            {
              "id": "2327d8d7-07e4-478d-b7fe-040fa1a5710c",
              "name": "product_page_1200",
              "value": "={{ $json.data.url }}?w=1200&fmt=auto",
              "type": "string"
            },
            {
              "id": "7eaa3fe6-20a7-4afe-8962-c5cff41379aa",
              "name": "thumb_200",
              "value": "={{ $json.data.url }}?w=200&h=200&fit=cover&gravity=auto",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "4eaff187-7107-44d9-ae79-ed52aec3bd73",
      "name": "Setup instructions",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -120
      ],
      "parameters": {
        "content": "## Shopify product images to PixelVault\n1. Select your Shopify 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": {
    "Shopify 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": []
}
