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 →
{
"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.
postgres
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 →