Analyze customer feedback and alert negative sentiment with GPT-4o-mini and Telegram

Go to Workflow
0 views
Built by Khairul Muhtadin Khairul Muhtadin
Created on August 12, 2026

Description

Quick overview
This workflow receives customer feedback via a webhook, logs it to Google Sheets, uses OpenAI to classify sentiment and summarize the message, and sends a Telegram alert when the sentiment is negative.

How it works
Receives customer feedback in a POST request via a webhook endpoint.
Normalizes the incoming payload into consistent fields (name, email, rating, message, source) and adds a received timestamp.
Appends the normalized feedback as a new row in a Google Sheets “Feedback” worksheet.
Sends the feedback details to OpenAI (GPT-4o-mini) to return a JSON analysis with sentiment, category, summary, and suggested action.
Extracts the analysis fields from the OpenAI JSON response and combines them with the original feedback details.
If the sentiment is negative, sends a formatted alert message to a Telegram chat.

Setup
Create a webhook consumer (e.g. your website form or app) and configure it to POST feedback data to the workflow’s webhook URL.
Add a Google Sheets OAuth credential and set the target spreadsheet ID and worksheet name (currently document ID “1uw7UaNuorGIbgEtPSANNT8SdiS6qnnArvJVwbfrMpi4” and sheet “Feedback”).
Ensure the Google Sheet has columns for received_at, name, email, rating, source, message, sentiment, category, and summary.
Add an OpenAI API credential for the OpenAI node.
Add a Telegram bot credential and update the target chat ID (currently set to 7040749953).

Requirements
• A webhook-capable source system (form, app, or API) that sends feedback
• Google account with access to the target Sheets document
• OpenAI API key with credits
• Telegram bot token and chat ID for alerts

Customization
• Change the sentiment categories or trigger condition in the IF node
• Adjust the OpenAI prompt to extract different fields
• Modify the Telegram alert message formatting
• Add extra fields to the Google Sheets log

Additional info
Tested on n8n self-hosted and compatible with n8n cloud. Uses only built-in n8n nodes.

Nodes Used (6)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
Google Sheets
n8n-nodes-base.googleSheets
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Telegram
n8n-nodes-base.telegram