{
  "name": "Analyze Delighted Feedback With AI and Route It to Airtable",
  "nodes": [
    {
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "parameters": {
        "httpMethod": "POST",
        "path": "delighted-feedback",
        "responseMode": "onReceived",
        "options": {}
      },
      "notes": "Copy this node's webhook URL into the source tool as the POST endpoint.",
      "position": [
        260,
        300
      ]
    },
    {
      "name": "Analyse Feedback",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "parameters": {
        "resource": "text",
        "operation": "message",
        "modelId": "gpt-4o-mini",
        "messages": {
          "values": [
            {
              "role": "user",
              "content": "Return JSON {sentiment, theme, summary} for this feedback: {{ $json.body.answer }}"
            }
          ]
        }
      },
      "notes": "Swap in Anthropic or any LLM node if you prefer.",
      "position": [
        500,
        300
      ]
    },
    {
      "name": "Detractor?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "parameters": {
        "conditions": {
          "conditions": [
            {
              "leftValue": "={{ $json.sentiment }}",
              "rightValue": "negative",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "notes": "Escalate strongly negative feedback.",
      "position": [
        740,
        300
      ]
    },
    {
      "name": "Airtable — Append Row",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "parameters": {
        "operation": "append"
      },
      "notes": "Appends one row per event for an auditable history.",
      "position": [
        980,
        300
      ]
    },
    {
      "name": "Respond / Finish",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "parameters": {},
      "notes": "End of flow — extend with extra steps as needed.",
      "position": [
        1220,
        300
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Analyse Feedback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyse Feedback": {
      "main": [
        [
          {
            "node": "Detractor?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detractor?": {
      "main": [
        [
          {
            "node": "Airtable — Append Row",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Airtable — Append Row": {
      "main": [
        [
          {
            "node": "Respond / Finish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
