{
  "nodes": [
    {
      "name": "If URL has /product/",
      "type": "n8n-nodes-base.if",
      "position": [
        640,
        300
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"permalink\"]}}",
              "value2": "https://[add-your-url-here]/product/",
              "operation": "startsWith"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Send message to slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        920,
        260
      ],
      "parameters": {
        "text": ":new: A new product has been added! :new:",
        "channel": "newproducts",
        "blocksUi": {
          "blocksValues": []
        },
        "attachments": [
          {
            "color": "#66FF00",
            "fields": {
              "item": [
                {
                  "short": false,
                  "title": "Name",
                  "value": "={{$json[\"name\"]}}"
                },
                {
                  "short": true,
                  "title": "Price",
                  "value": "={{$json[\"regular_price\"]}}"
                },
                {
                  "short": true,
                  "title": "Sale Price",
                  "value": "={{$json[\"sale_price\"]}}"
                },
                {
                  "short": false,
                  "title": "Link",
                  "value": "={{$json[\"permalink\"]}}"
                }
              ]
            },
            "footer": "=Added: {{$json[\"date_created\"]}}"
          }
        ],
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "On product creation",
      "type": "n8n-nodes-base.wooCommerceTrigger",
      "position": [
        460,
        300
      ],
      "parameters": {
        "event": "product.created"
      },
      "credentials": {
        "wooCommerceApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "On product creation": {
      "main": [
        [
          {
            "node": "If URL has /product/",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If URL has /product/": {
      "main": [
        [
          {
            "node": "Send message to slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}