AutomationFlowsData & Sheets › Collect AI Ratings via Webhook

Collect AI Ratings via Webhook

Original n8n title: AI Rating Collector

AI Rating Collector. Uses postgres, respondToWebhook. Webhook trigger; 3 nodes.

Webhook trigger★☆☆☆☆ complexity3 nodesPostgres
Data & Sheets Trigger: Webhook Nodes: 3 Complexity: ★☆☆☆☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "AI Rating Collector",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "save-rating",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-rating",
      "name": "Webhook - Rating",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "=INSERT INTO ai_ratings (session_id, chat_log_id, rating, feedback_comment)\nVALUES (\n  '{{ $json.body.sessionId }}',\n  {{ $json.body.chatLogId || 'NULL' }},\n  '{{ $json.body.rating }}',\n  '{{ ($json.body.feedbackComment || '').replace(/'/g, \"''\") }}'\n)\nRETURNING id;",
        "options": {}
      },
      "id": "save-rating",
      "name": "Save Rating",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.4,
      "position": [
        450,
        300
      ],
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { success: true, message: 'Rating saved. Thank you for your feedback!' } }}"
      },
      "id": "respond-to-webhook",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    }
  ],
  "connections": {
    "Webhook - Rating": {
      "main": [
        [
          {
            "node": "Save Rating",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Rating": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2025-01-12T00:00:00.000Z",
  "versionId": "1"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

AI Rating Collector. Uses postgres, respondToWebhook. Webhook trigger; 3 nodes.

Source: https://github.com/shazily/syntheticdatagen/blob/821a0a45e9851752555869c9d8cec0ec580287d5/n8n-workflows/rating-collector.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

Text-to-SQL: Check Status. Uses postgres. Webhook trigger; 5 nodes.

Postgres
Data & Sheets

Anadir_Cliente. Uses postgres. Webhook trigger; 4 nodes.

Postgres
Data & Sheets

Register Company Workflow. Uses start, postgres. Webhook trigger; 4 nodes.

Start, Postgres
Data & Sheets

Tool: Get Postgres Tables. Uses postgres. Webhook trigger; 4 nodes.

Postgres
Data & Sheets

Track Complaint Status. Uses postgres. Webhook trigger; 4 nodes.

Postgres