{
  "id": "wpRuoA7f_fYVTlSnrIPCK",
  "name": "E-commerce Product Visual Generator",
  "tags": [],
  "nodes": [
    {
      "id": "0184e2f3-233f-4a7d-bca1-7b5affb97dde",
      "name": "Sticky Note - Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -752
      ],
      "parameters": {
        "width": 652,
        "height": 700,
        "content": "## Try It Out!\n### Automatically generate professional product images when new products are added to your Shopify store.\n\nThis workflow uses AI to create optimized image generation prompts and produces both styled hero images and transparent PNGs for your product catalog.\n\n### How it works\n1. **Shopify Trigger** detects new product creation\n2. **Edit Fields** extracts category and tags for context\n3. **AI Agent** analyzes product data and uses the deAPI Prompt Booster tool to create an optimized image prompt\n4. **deAPI Generate** creates a professional product image\n5. **deAPI Remove Background** produces a transparent PNG version\n6. **Shopify Update** uploads both images to the product\n\n### Requirements\n- [deAPI](https://deapi.ai) account for image generation\n- Required Shopify scopes: `read_products`, `write_products`, `write_files`\n- Shopify webhook URL must be **HTTPS**\n- Anthropic account for AI Agent\n\n### Need Help?\nJoin the [n8n Discord](https://discord.gg/n8n) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Automating!"
      },
      "typeVersion": 1
    },
    {
      "id": "e5bee131-f22f-4633-a059-210a8829d4db",
      "name": "Sticky Note - Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 316,
        "height": 428,
        "content": "## 1. Shopify Product Trigger\n[Read more about Shopify Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.shopifytrigger)\n\nListens for `products/create` webhook events from your Shopify store. When a new product is added, the workflow automatically starts processing."
      },
      "typeVersion": 1
    },
    {
      "id": "d5fb4878-052a-4d7d-b028-7ebeadc7b03c",
      "name": "Sticky Note - Edit Fields",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 308,
        "height": 428,
        "content": "## 2. Extract Product Data\nPrepares product information for the AI Agent:\n\n- **category**: From `category.name` (e.g., \"Duffel Bags\")\n- **tags**: Product attributes (e.g., \"leather, premium, handmade\")\n\nThese provide visual context for image generation."
      },
      "typeVersion": 1
    },
    {
      "id": "64eccbaa-22fe-4360-81ed-626db881262b",
      "name": "Sticky Note - AI Agent",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 464,
        "height": 732,
        "content": "## 3. AI-Powered Prompt Generation\n[Read more about AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent)\n\nThe AI Agent analyzes product data and uses the **deAPI Image Prompt Booster** tool to create optimized prompts for professional product photography.\n\nThe **Structured Output Parser** ensures consistent JSON output."
      },
      "typeVersion": 1
    },
    {
      "id": "9c3b7065-398e-49b5-92ab-0a878fd8dfee",
      "name": "Sticky Note - Generate",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1648,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 364,
        "height": 444,
        "content": "## 4. Generate Product Image\n[deAPI Documentation](https://docs.deapi.ai)\n\nGenerates a professional product image using the AI-boosted prompt.\n\nOutput includes binary image data ready for the next step."
      },
      "typeVersion": 1
    },
    {
      "id": "f7ed1eb6-18ba-475a-88a4-8cbe7105cd7c",
      "name": "Sticky Note - Remove BG",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 348,
        "height": 460,
        "content": "## 5. Remove Background\nCreates a transparent PNG version of the product image.\n\nIdeal for:\n- Product catalogs\n- Custom backgrounds\n- Marketing materials"
      },
      "typeVersion": 1
    },
    {
      "id": "ef4a2b60-b941-4093-94fa-061f042e8dde",
      "name": "Sticky Note - Update",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2480,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 328,
        "height": 460,
        "content": "## 6. Update Product Images\n[Read more about Shopify node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.shopify)\n\nUploads both images to Shopify:\n- **Position 1** (main): Styled hero image\n- **Position 2** (alt): Transparent PNG"
      },
      "typeVersion": 1
    },
    {
      "id": "ee142ea1-4f15-4a35-bb63-fbfe05126f2c",
      "name": "Shopify Trigger",
      "type": "n8n-nodes-base.shopifyTrigger",
      "position": [
        496,
        272
      ],
      "parameters": {
        "topic": "products/create",
        "authentication": "accessToken"
      },
      "typeVersion": 1
    },
    {
      "id": "11daa621-e991-4ed5-a644-91e5828fc4b0",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1248,
        272
      ],
      "parameters": {
        "text": "=Create a product image prompt for:\n\nTitle: {{ $json.title }}\nDescription: {{ $json.body_html }}\n{{ $json.category }}: {{ $json.tags }}",
        "options": {
          "systemMessage": "=You are a product photography expert. Create a prompt for generating a professional e-commerce product image.\n\nProduct\n  Title: {{ $json.title }}\nDescription: {{ $json.body_html }}\n{{ $json.category }}: {{ $json.tags }}\n\nUse the imagePromptBooster tool to enhance your prompt. Return only the boosted prompt."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "78fa1d80-a21e-42f5-bba3-3a3e5178a9c9",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1456,
        528
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"boosted_prompt\": \"professional product photo of...\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "4d0e8a45-1041-4b3d-a920-fc4b65fe57e1",
      "name": "deAPI Generate Image",
      "type": "n8n-nodes-deapi.deapi",
      "position": [
        1776,
        272
      ],
      "parameters": {
        "prompt": "={{ $json.output.boosted_prompt }}",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "8e801317-0731-4b88-9665-7cad613a5ab2",
      "name": "deAPI Remove Background",
      "type": "n8n-nodes-deapi.deapi",
      "position": [
        2192,
        272
      ],
      "parameters": {
        "options": {},
        "operation": "removeBackground"
      },
      "typeVersion": 1
    },
    {
      "id": "f68283e1-7cee-4172-ad3a-6169c8fdc874",
      "name": "Shopify Update Product",
      "type": "n8n-nodes-base.shopify",
      "position": [
        2592,
        272
      ],
      "parameters": {
        "resource": "product",
        "operation": "update",
        "productId": "={{ $('Shopify Trigger').item.json.id }}",
        "updateFields": {
          "images": [
            {
              "src": "={{ $('deAPI Generate Image').item.json.result_url }}"
            },
            {
              "src": "={{ $json.result_url }}"
            }
          ]
        },
        "authentication": "accessToken"
      },
      "typeVersion": 1
    },
    {
      "id": "2eb2a543-5c34-47ff-99c7-0a21d2ebb694",
      "name": "Image prompt booster in deAPI",
      "type": "n8n-nodes-deapi.deapiTool",
      "position": [
        1328,
        528
      ],
      "parameters": {
        "prompt": "={{ $fromAI('Prompt', ``, 'string') }}",
        "options": {},
        "resource": "prompt"
      },
      "typeVersion": 1
    },
    {
      "id": "5fb5d091-9be6-4c11-8350-3d300de3eea6",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1184,
        528
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "272a1203-51fe-4535-b4ac-2b0e5cb8e3a4",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        848,
        272
      ],
      "parameters": {
        "include": "selected",
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "789000bb-0352-462d-8935-682c52a5f6fa",
              "name": "category",
              "type": "string",
              "value": "={{ $json.category.name }}"
            },
            {
              "id": "217357ac-55a7-4884-890e-be2b58f01651",
              "name": "tags",
              "type": "string",
              "value": "={{ $json.tags }}"
            }
          ]
        },
        "includeFields": "title, body_html",
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "00627403-b83a-4321-b87d-11e02ac5b888",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2864,
        -16
      ],
      "parameters": {
        "width": 480,
        "height": 524,
        "content": "## Styled hero image\n![](https://res.cloudinary.com/dsmonpqk2/image/upload/f_auto,q_auto/v1772018279/SXwV7aOwQRgLoV48OyOKdEDmqTUnR7fANRXzd7DN_kdypx0.png#full-width)"
      },
      "typeVersion": 1
    },
    {
      "id": "f6f3c4e9-8c95-4091-9bcc-b23b52116e1b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2864,
        544
      ],
      "parameters": {
        "width": 480,
        "height": 524,
        "content": "## Transparent PNG\n![](https://res.cloudinary.com/dsmonpqk2/image/upload/f_auto,q_auto/v1772018280/xY5qVwrMQhjQtWKbKdvv6B1ySK8RKBUVHukDVVgL_dlpdzr.png#full-width)"
      },
      "typeVersion": 1
    },
    {
      "id": "22921d2e-b717-4866-a3c8-1a9902052c19",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        16
      ],
      "parameters": {
        "width": 480,
        "height": 524,
        "content": "## Example product details from Shopify\n- **Title:** Classic Leather Weekend Bag\n- **Description:** Handcrafted from premium full-grain leather, this weekend bag combines timeless style with modern functionality. Features include a spacious main compartment, padded laptop sleeve, and brass hardware. Perfect for short trips or daily commutes.\n    - **Dimensions:** 20\\\" x 12\\\" x 10\\\"\n    - **Material:** Full-grain vegetable-tanned leather\n    - **Interior:** Cotton twill lining\n- **Category:** Duffel Bags\n- **Tags:** handmade, leather, premium, travel, weekend"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "bd100148-0eaa-4515-8757-b66b015145a2",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "deAPI Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shopify Trigger": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "deAPI Generate Image": {
      "main": [
        [
          {
            "node": "deAPI Remove Background",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "deAPI Remove Background": {
      "main": [
        [
          {
            "node": "Shopify Update Product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Image prompt booster in deAPI": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}