{
  "name": "Detect WooCommerce return surges in real-time with Slack alerts & Airtable logging",
  "nodes": [
    {
      "id": "fa1bf279-3572-473d-be40-cb188bc6dfe7",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2992,
        -240
      ]
    },
    {
      "id": "02cfb150-eb94-4184-9fb2-1079012e4c1f",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -1728,
        -304
      ]
    },
    {
      "id": "4542948e-6687-4eb7-9377-8513ccf0a34f",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1040,
        -320
      ]
    },
    {
      "id": "9af0266e-0136-4605-9c04-1b1974633b9a",
      "name": "Create a record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -528,
        -320
      ]
    },
    {
      "id": "0e2a51dd-9df1-4ec1-8fd4-00076b35ecb9",
      "name": "Orders_Fetch",
      "type": "n8n-nodes-base.code",
      "position": [
        -2128,
        -256
      ]
    },
    {
      "id": "22b0ae06-01a6-4ae9-b9eb-2c253b7bef54",
      "name": "Refund_details",
      "type": "n8n-nodes-base.code",
      "position": [
        -1984,
        -256
      ]
    },
    {
      "id": "748f44df-885d-498e-b355-ac5e2936a753",
      "name": "Time_window",
      "type": "n8n-nodes-base.code",
      "position": [
        -2672,
        -240
      ]
    },
    {
      "id": "ecbf350d-858c-4959-9e1a-77f59ad8772d",
      "name": "HTTP Orders",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2480,
        -368
      ]
    },
    {
      "id": "2e89c61b-d2b4-444c-8b91-36ecaefded9e",
      "name": "HTTP Refunds",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2288,
        -368
      ]
    },
    {
      "id": "805bd643-a0da-4bac-9767-a01201809d24",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1472,
        -320
      ]
    },
    {
      "id": "bfd46423-5da8-43f6-8224-8620810c15c7",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        -768,
        -320
      ]
    },
    {
      "id": "63504e6d-2fdd-4daf-9bc5-9583fbd6d902",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3520,
        -688
      ],
      "parameters": {
        "width": 416,
        "height": 880,
        "content": "## How it Works:\n\nThis workflow automatically monitors WooCommerce refund activity on a scheduled basis.\nOn each run, it fetches recent orders and refunds, maps refunds back to their parent orders, an"
      }
    },
    {
      "id": "401013de-e238-4e95-8fed-5bc98ec58657",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3088,
        -416
      ],
      "parameters": {
        "width": 288,
        "height": 320,
        "content": "\n###  This scheduled workflow monitors WooCommerce product returns to detect\n### unusual SKU-level spikes and automatically sends alerts with logged data.\n\n"
      }
    },
    {
      "id": "1504b6c4-6154-4ac5-b8fc-193784cd2f73",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2752,
        -656
      ],
      "parameters": {
        "width": 880,
        "height": 560,
        "content": "## Data Collection & Return Analysis:\n\n### • HTTP Orders – Fetches WooCommerce orders and line-item details.\n### • HTTP Refunds – Fetches refund records with reasons and timestamps.\n### • Orders_Fetch"
      }
    },
    {
      "id": "8979e15d-606a-4981-962c-3935e5114f4f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -592
      ],
      "parameters": {
        "width": 768,
        "height": 432,
        "content": "##  Alerts & Logging:\n\n### • Slack – Sends return surge alerts with SKU, counts, increase %, and reasons.\n### • Code in JavaScript – Normalizes Slack alert text into structured fields.\n### • Airtable "
      }
    },
    {
      "id": "5cecead3-eb18-49bd-aa00-1cb20d702026",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        -608
      ],
      "parameters": {
        "width": 592,
        "height": 496,
        "content": "## Surge Filter & Enrichment:\n\n###  • IF – Detects return surges based on thresholds\n  (≥100% increase OR ≥25 current returns).\n\n### • Set Fields – Adds alert metadata (status, run date, cooldown key)"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Orders": {
      "main": [
        [
          {
            "node": "HTTP Refunds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Time_window": {
      "main": [
        [
          {
            "node": "HTTP Orders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Refunds": {
      "main": [
        [
          {
            "node": "Orders_Fetch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Orders_Fetch": {
      "main": [
        [
          {
            "node": "Refund_details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refund_details": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a record": {
      "main": [
        []
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Time_window",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Create a record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}