{
  "id": "LLJ61uFwcfJT8TpF",
  "name": "SUBMISSION COPY - Slack Notify on Asset Publish",
  "tags": [],
  "nodes": [
    {
      "id": "ea762b03-32d7-4f73-9e66-0b257a8feb1f",
      "name": "Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -288
      ],
      "parameters": {
        "width": 640,
        "height": 787,
        "content": "## Notify your team in Slack with render previews when VNTANA assets publish\n\n**Who's it for**\n3D production and ecommerce teams who want visibility into their asset pipeline without checking the VNTANA platform.\n\n**How it works**\nWhen an asset is published in VNTANA, the workflow fetches the full product details, downloads the first platform render, and posts a rich Slack message containing the asset name, a direct link to the product in VNTANA, AI-generated tags (if present), and the polygon count from the asset metadata. The render image is then uploaded as a reply in the same thread, so the channel gets a visual preview.\n\n**How to set up**\n1. Install the VNTANA community node and create a VNTANA API credential, then set your Workspace UUID in both VNTANA nodes.\n2. Connect your Slack credential and pick the target channel.\n3. Set your organization slug and workspace slug in the Build Notification code node (used to build the direct link).\n4. Register a VNTANA webhook for asset publish events.\n\n**Requirements**\nA VNTANA account, the VNTANA community node, and a Slack workspace where you can install apps.\n\n**How to customize**\nEdit the Build Notification code node to change the message blocks or surface different metadata fields."
      },
      "typeVersion": 1
    },
    {
      "id": "2b00c48f-678b-4080-bfb7-13eda3117640",
      "name": "Note: Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -160
      ],
      "parameters": {
        "color": 7,
        "height": 300,
        "content": "**Step 1 \u2014 Trigger**\nVNTANA fires this webhook when an asset is published.\n\nCopy the production URL \u2192 VNTANA \u2192 Manage Organization \u2192 Webhooks.\n\nSubscribe to: `asset.published`"
      },
      "typeVersion": 1
    },
    {
      "id": "4a6e1023-022b-4d11-ae79-b2627d211256",
      "name": "Note: Get Product",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        96
      ],
      "parameters": {
        "color": 7,
        "height": 262,
        "content": "**Step 2 \u2014 Get Asset Details**\nFetches full asset data including tags, description, and metadata.\n\nSet **Workspace UUID** to your VNTANA workspace UUID."
      },
      "typeVersion": 1
    },
    {
      "id": "0e2ef636-7cc1-4c66-9640-4d77b8a03f03",
      "name": "Note: Download",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        96
      ],
      "parameters": {
        "color": 7,
        "height": 238,
        "content": "**Step 3 \u2014 Download Render**\nDownloads all renders and limits to the first one for the Slack preview.\n\nSet **Workspace UUID** to match Step 2."
      },
      "typeVersion": 1
    },
    {
      "id": "04c3d3e8-b09b-43fc-b12d-64c8327a515b",
      "name": "Note: Build Notification",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 280,
        "height": 381,
        "content": "**Step 4 \u2014 Build Notification**\nEdit this code node to set:\n- `ORG_SLUG` \u2014 your VNTANA organization slug\n- `WORKSPACE_SLUG` \u2014 your workspace slug\n\nThese are used to build the direct link to the asset in VNTANA.\n\nTags and polygon count are pulled automatically from the asset data if present."
      },
      "typeVersion": 1
    },
    {
      "id": "7ecc3f76-fee4-4984-bb91-9f03a682e38d",
      "name": "Note: Slack",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 280,
        "height": 324,
        "content": "**Step 5 \u2014 Post to Slack**\nPosts the notification as a rich message with the asset name, tags, polygon count, and a link button.\n\nSet **Channel** to your desired Slack channel (e.g. `#3d-launches`).\n\nThe render image is uploaded as a reply in the same thread."
      },
      "typeVersion": 1
    },
    {
      "id": "cc52cc93-a045-4460-9cf3-d7e74a0232a7",
      "name": "VNTANA \u2014 Asset Published",
      "type": "n8n-nodes-base.webhook",
      "position": [
        544,
        384
      ],
      "parameters": {
        "path": "vntana-asset-published",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "4e769b76-9062-46ec-9796-19a70194d42f",
      "name": "Get Product Details",
      "type": "n8n-nodes-vntana.vntana",
      "position": [
        752,
        384
      ],
      "parameters": {
        "filters": {},
        "clientUuid": "YOUR_WORKSPACE_UUID"
      },
      "typeVersion": 1
    },
    {
      "id": "a6e9a549-f94f-4bfe-bb98-cb079520b201",
      "name": "Download Renders",
      "type": "n8n-nodes-vntana.vntana",
      "position": [
        992,
        384
      ],
      "parameters": {
        "resource": "render",
        "clientUuid": "YOUR_WORKSPACE_UUID",
        "downloadAll": true,
        "productUuid": "={{ $('VNTANA \u2014 Asset Published').first().json.body.product.uuid }}"
      },
      "typeVersion": 1
    },
    {
      "id": "a9ec8019-591a-4a24-84e1-8276c0b47ce8",
      "name": "First Render Only",
      "type": "n8n-nodes-base.limit",
      "position": [
        1232,
        384
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fc573065-6cbf-425d-b8a3-e1b9fb97085f",
      "name": "Build Notification",
      "type": "n8n-nodes-base.code",
      "position": [
        1472,
        384
      ],
      "parameters": {
        "jsCode": "// \u2500\u2500 CONFIGURE THESE TWO VALUES \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconst ORG_SLUG       = 'YOUR_ORG_SLUG';        // e.g. 'AcmeCorp'\nconst WORKSPACE_SLUG = 'YOUR_WORKSPACE_SLUG';  // e.g. 'product-team'\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst webhook = $('VNTANA \u2014 Asset Published').first().json.body;\nconst product = $('Get Product Details').first().json;\n\nconst uuid = webhook.product.uuid;\nconst name = product.name || webhook.product.name || 'Unnamed Asset';\n\n// Build tag list (Title Case, comma-separated)\nconst tags = (product.tags || [])\n  .map(t => t.name)\n  .filter(Boolean)\n  .join(', ') || '_No tags yet_';\n\n// Polygon count \u2014 location varies by asset type; adjust path if needed\nconst polygons = (\n  product.modelOpsParameters?.polygonCount ||\n  product.metadata?.polygonCount ||\n  product.asset?.polygonCount ||\n  null\n);\nconst polygonText = polygons\n  ? Number(polygons).toLocaleString()\n  : '_Not available_';\n\nconst vntanaUrl = `https://platform.vntana.com/${ORG_SLUG}/${WORKSPACE_SLUG}/products/details/${uuid}`;\n\nreturn [{\n  json: {\n    assetName: name,\n    tags: tags,\n    polygons: polygonText,\n    vntanaUrl: vntanaUrl,\n    uuid: uuid\n  },\n  binary: $input.first().binary  // pass render binary through\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "2ffc37c8-0659-4e39-8376-0b9184fbdf01",
      "name": "Post to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1712,
        384
      ],
      "parameters": {
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "97cc6374-a4e6-42b8-943d-568bb2ad41c1",
      "name": "Upload Render to Thread",
      "type": "n8n-nodes-base.slack",
      "position": [
        1952,
        384
      ],
      "parameters": {
        "options": {},
        "resource": "file"
      },
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "066df5b3-2107-4673-99da-76da389bebdc",
  "nodeGroups": [],
  "connections": {
    "Post to Slack": {
      "main": [
        [
          {
            "node": "Upload Render to Thread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Renders": {
      "main": [
        [
          {
            "node": "First Render Only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "First Render Only": {
      "main": [
        [
          {
            "node": "Build Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Notification": {
      "main": [
        [
          {
            "node": "Post to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "VNTANA \u2014 Asset Published": {
      "main": [
        [
          {
            "node": "Get Product Details",
            "type": "main",
            "index": 0
          },
          {
            "node": "Download Renders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}