{
  "id": "4XmDwwrViXRNKxBY",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Facebook Page Negative Review Watchdog \u2192 Slack Escalation + Supabase Ticket",
  "tags": [],
  "nodes": [
    {
      "id": "f3c71ec3-e349-4b1f-86c8-6e834ae0cc74",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -16
      ],
      "parameters": {
        "width": 520,
        "height": 540,
        "content": "## Facebook Page Negative Review Watchdog\n\n### How it works\nThis workflow receives Facebook Page reviews through a webhook and normalizes the incoming payload to extract key fields such as rating, review text, reviewer name and page name.\n\nIt then checks the review rating and continues only when the rating is 2 stars or below. For negative reviews, a Slack alert is sent to the support team, followed by an attempt to create a support record in Supabase for tracking and follow-up.\n\n\n### Setup steps\n1. Configure the **Webhook** node and connect it to your Facebook Page review source or webhook provider.\n2. Review the **Global Configuration** node and adjust field mappings if your incoming payload structure differs.\n3. Connect your **Slack** credentials and select the channel where alerts should be delivered.\n4. Connect your **Supabase** credentials and configure the table where support records should be stored.\n5. Activate the workflow to begin monitoring Facebook Page reviews automatically.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "8a17909d-50e7-4025-8769-f13c0a81d26d",
      "name": "Trigger & Filter",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 548,
        "height": 408,
        "content": "## 1. Review Intake & Configuration\n\nReceives Facebook Page review data through a webhook and prepares the incoming payload by mapping and standardizing required fields.\n\nThis step acts as the central configuration point for adapting the workflow to different payload structures.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0edeec79-ec85-4b0a-9a31-9087b755b544",
      "name": "Alert & Storage",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 596,
        "height": 408,
        "content": "## 2. Negative Review Detection & Alert\n\nChecks the review rating and continues only when the rating is 2 stars or below.\n\nFor negative reviews, an immediate Slack alert is sent to notify the support team.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4dd9a219-65b2-4253-a541-02a2c6a48036",
      "name": "Error Handling",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 724,
        "height": 408,
        "content": "## 3. Case Creation & Error Handling\n\nCreates a support record in Supabase for negative reviews.\n\nIf case creation fails, a fallback Slack alert is sent with review details to ensure visibility.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2d549d47-4fe0-4b32-8bf1-4490eb0f5b12",
      "name": "Facebook Page Review Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        368,
        304
      ],
      "parameters": {
        "path": "facebook-reviews",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "2a127b69-3dfe-49f1-b4ea-9ae4aad2e5d9",
      "name": "Check Negative Review (\u2264 2 Stars)",
      "type": "n8n-nodes-base.if",
      "position": [
        1008,
        304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "92d6145e-a92b-4765-ba54-39ba38b3c29f",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json.rating }}",
              "rightValue": 2
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "1d3f7fa5-a3af-496c-bdb2-6902c8d7e144",
      "name": "Slack \u2013 New Negative Review Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        1248,
        288
      ],
      "parameters": {
        "text": "=\ud83d\udea8 *Negative Facebook Review Detected*\n\n\ud83d\udcc4 Page: {{ $json.page_name }}\n\ud83d\udc64 Reviewer: {{ $json.reviewer_name }}\n\u2b50 Rating: {{ $json.rating }}\n\ud83d\udcdd Review: {{ $json.review_text }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": ""
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "03817e9d-9764-4281-b866-f26bc57cab9e",
      "name": "Create Support Case (Supabase)",
      "type": "n8n-nodes-base.supabase",
      "onError": "continueRegularOutput",
      "position": [
        1552,
        288
      ],
      "parameters": {
        "tableId": "cases",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "rating",
              "fieldValue": "={{ $('Global Configuration').item.json.rating }}"
            },
            {
              "fieldId": "review_text",
              "fieldValue": "={{ $('Global Configuration').item.json.review_text }}"
            },
            {
              "fieldId": "reviewer_name",
              "fieldValue": "={{ $('Global Configuration').item.json.reviewer_name }}"
            },
            {
              "fieldId": "page_name",
              "fieldValue": "={{ $('Global Configuration').item.json.page_name }}"
            }
          ]
        }
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "9e952bd6-e364-4bed-9e45-1de5da095125",
      "name": "Check Case Creation Failure",
      "type": "n8n-nodes-base.if",
      "position": [
        1776,
        288
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "8e3ec097-b132-4a79-a67e-b31f754b078c",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              },
              "leftValue": "={{ $json.error }}"
            },
            {
              "id": "89195a28-2840-43e9-b662-bde03fbe7d02",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.rating }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "39eb3b9d-b888-479f-82c6-f3477cbf14b5",
      "name": "Slack \u2013 Case Creation Failed Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        2032,
        272
      ],
      "parameters": {
        "text": "=\u274c *Supabase Case Creation Failed*\n\n\ud83d\udcc4 Page: {{ $json.page_name }}\n\ud83d\udc64 Reviewer: {{ $json.reviewer_name }}\n\u2b50 Rating: {{ $json.rating }}\n\ud83d\udcdd Review: {{ $json.review_text }}\n\n\ud83e\uddfe Error: {{ $json.error }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": ""
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "07173ffe-7992-429c-af22-cfc7b0875994",
      "name": "Global Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        304
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "reviewer_name",
              "stringValue": "={{ $json.body.reviewer_name }}"
            },
            {
              "name": "rating",
              "type": "numberValue",
              "numberValue": "={{ $json.body.rating }}"
            },
            {
              "name": "review_text",
              "stringValue": "={{ $json.body.review_text }}"
            },
            {
              "name": "page_name",
              "stringValue": "={{ $json.body.page_name }}"
            }
          ]
        },
        "include": "none",
        "options": {}
      },
      "typeVersion": 3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "022d58a0-638f-4797-a40d-d1fd24baf7b2",
  "connections": {
    "Global Configuration": {
      "main": [
        [
          {
            "node": "Check Negative Review (\u2264 2 Stars)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Case Creation Failure": {
      "main": [
        [
          {
            "node": "Slack \u2013 Case Creation Failed Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Facebook Page Review Trigger": {
      "main": [
        [
          {
            "node": "Global Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Support Case (Supabase)": {
      "main": [
        [
          {
            "node": "Check Case Creation Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Negative Review (\u2264 2 Stars)": {
      "main": [
        [
          {
            "node": "Slack \u2013 New Negative Review Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack \u2013 New Negative Review Alert": {
      "main": [
        [
          {
            "node": "Create Support Case (Supabase)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}