{
  "name": "Analyze WooCommerce category sales over time with Airtable and Slack",
  "nodes": [
    {
      "id": "f938bd6b-2b48-4b3c-9aeb-bda8b928fe0c",
      "name": "Category Map",
      "type": "n8n-nodes-base.code",
      "position": [
        -32,
        176
      ]
    },
    {
      "id": "885fb92a-a373-4630-a9be-6f4087f743bb",
      "name": "Run On Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1024,
        -16
      ]
    },
    {
      "id": "5a8176d7-9d22-4a76-8c93-b34f249c78f2",
      "name": "Report Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -768,
        -16
      ]
    },
    {
      "id": "f9885621-1e1c-45ed-8ac2-be22dc333199",
      "name": "Calculate Reporting Periods",
      "type": "n8n-nodes-base.code",
      "position": [
        -592,
        -16
      ]
    },
    {
      "id": "af7baea5-1e10-4396-8a29-97d6bc70086b",
      "name": "Fetch Orders — Current Period",
      "type": "n8n-nodes-base.wooCommerce",
      "position": [
        -256,
        -208
      ]
    },
    {
      "id": "a854efec-4411-4216-b153-68b02026a2fc",
      "name": "Fetch Orders — Previous Period",
      "type": "n8n-nodes-base.wooCommerce",
      "position": [
        -256,
        -16
      ]
    },
    {
      "id": "5cc43700-36c5-4ffd-8ae5-52f74d797c91",
      "name": "Fetch Products",
      "type": "n8n-nodes-base.wooCommerce",
      "position": [
        -256,
        176
      ]
    },
    {
      "id": "de3b6e71-edd1-437d-8fca-99541c2988f9",
      "name": "Normalize Order Items — Current",
      "type": "n8n-nodes-base.code",
      "position": [
        -32,
        -208
      ]
    },
    {
      "id": "865c0cc0-43a8-46bc-b729-bc17c8eeb05f",
      "name": "Normalize Order Items — Previous",
      "type": "n8n-nodes-base.code",
      "position": [
        -32,
        -16
      ]
    },
    {
      "id": "b79ad266-8618-40a7-b70f-ca86d27f04fd",
      "name": "Combine Orders & Products",
      "type": "n8n-nodes-base.merge",
      "position": [
        288,
        -32
      ]
    },
    {
      "id": "23d57db4-1d00-4cf8-bd67-c732d55f7458",
      "name": "Aggregate Sales by Category",
      "type": "n8n-nodes-base.code",
      "position": [
        544,
        -16
      ]
    },
    {
      "id": "8aedb373-070a-4188-886c-bf85e6071168",
      "name": "Classify Category Performance",
      "type": "n8n-nodes-base.code",
      "position": [
        736,
        -16
      ]
    },
    {
      "id": "fc6b5a47-97f3-4b45-a867-d2ba473833ca",
      "name": "Prepare Fields for Reporting",
      "type": "n8n-nodes-base.set",
      "position": [
        944,
        -16
      ]
    },
    {
      "id": "5151087f-6f04-4d13-955e-4f8fe67d8b8f",
      "name": "Save Results to Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1184,
        -16
      ]
    },
    {
      "id": "7735c6ef-f872-487b-8f38-f377452dd0ac",
      "name": "Build Slack Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        1424,
        -16
      ]
    },
    {
      "id": "2173ef7a-fbf2-4d79-afa2-c9b6ff4d975c",
      "name": "Send Report to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1664,
        -16
      ]
    },
    {
      "id": "3ccb02a4-6ad4-4765-94c9-bda0ba405603",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1088,
        -112
      ],
      "parameters": {
        "width": null,
        "height": 240,
        "content": "Starts the workflow automatically on a fixed schedule (daily / weekly)."
      }
    },
    {
      "id": "e7ef5742-3f3d-4a04-9529-e57addc8ed2b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -128
      ],
      "parameters": {
        "width": 368,
        "height": 272,
        "content": "Sets the report rules and automatically calculates current and previous date ranges for sales comparison."
      }
    },
    {
      "id": "01bd5059-3216-40d5-8edb-41dc1ac5dd90",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -432
      ],
      "parameters": {
        "width": 848,
        "height": 784,
        "content": "## Fetch & Normalize \n\n**Fetch Orders — Current Period:** Fetches completed WooCommerce orders from the current time period.\n**Fetch Orders — Previous Period:** Fetches completed WooCommerce orders fr"
      }
    },
    {
      "id": "22726a24-2718-4616-8324-382065a42298",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -288
      ],
      "parameters": {
        "width": 1376,
        "height": 496,
        "content": "## Category Performance Analysis & Reporting \n\n**Aggregate Sales by Category:** Calculates total revenue, units sold and orders per category.\n**Classify Category Performance:** Labels categories as To"
      }
    },
    {
      "id": "63bd8b58-2c0a-48f9-9b8a-e53837882118",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -864
      ],
      "parameters": {
        "width": 576,
        "height": 864,
        "content": "# How it Works\n\n### This workflow automatically analyzes sales data by product category and compares current performance with the previous period (weekly or monthly).\n### It pulls orders for two time "
      }
    }
  ],
  "connections": {
    "Category Map": {
      "main": [
        [
          {
            "node": "Combine Orders & Products",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Fetch Products": {
      "main": [
        [
          {
            "node": "Category Map",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run On Schedule": {
      "main": [
        [
          {
            "node": "Report Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Slack Summary": {
      "main": [
        [
          {
            "node": "Send Report to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Report Configuration": {
      "main": [
        [
          {
            "node": "Calculate Reporting Periods",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Results to Airtable": {
      "main": [
        [
          {
            "node": "Build Slack Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Orders & Products": {
      "main": [
        [
          {
            "node": "Aggregate Sales by Category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Sales by Category": {
      "main": [
        [
          {
            "node": "Classify Category Performance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Reporting Periods": {
      "main": [
        [
          {
            "node": "Fetch Orders — Previous Period",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Orders — Current Period",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Fields for Reporting": {
      "main": [
        [
          {
            "node": "Save Results to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Category Performance": {
      "main": [
        [
          {
            "node": "Prepare Fields for Reporting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Orders — Current Period": {
      "main": [
        [
          {
            "node": "Normalize Order Items — Current",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Orders — Previous Period": {
      "main": [
        [
          {
            "node": "Normalize Order Items — Previous",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Order Items — Current": {
      "main": [
        [
          {
            "node": "Combine Orders & Products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Order Items — Previous": {
      "main": [
        [
          {
            "node": "Combine Orders & Products",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}