Alert Slack on low CSAT scores from Gorgias using n8n
Prerequisites
- n8n instance (cloud or self-hosted)
- Gorgias account with Satisfaction Surveys enabled and REST API access
- Gorgias API credentials: account email and API key
- Slack workspace with a Bot Token or Incoming Webhook URL
Overview
This workflow listens for Gorgias satisfaction survey responses via webhook, evaluates the score against your threshold, and posts a rich Slack alert for low scores. The n8n approach gives you more control than native Gorgias Rules — you can enrich the alert with ticket history, agent name, response time data, and route different score ranges to different channels.
Step 1: Set up the Webhook trigger
Add a Webhook node:
- HTTP Method: POST
- Path:
gorgias-csat-alert
Copy the webhook URL.
Step 2: Register the webhook in Gorgias
Go to Settings → Integrations → HTTP → Add HTTP integration:
- Name: n8n CSAT Webhook
- URL: Your n8n webhook URL
- Events: Satisfaction survey is rated
- Content-Type:
application/json
This fires every time a customer submits a satisfaction rating, sending the survey payload to n8n.
Step 3: Extract and evaluate the score
Add a Code node to parse the survey response and decide whether to alert:
const data = $input.first().json;
const score = data.satisfaction_survey?.score || data.score;
const ticketId = data.ticket?.id || data.ticket_id;
const customerName = data.ticket?.requester?.name || 'Unknown';
const customerEmail = data.ticket?.requester?.email || '';
const subject = data.ticket?.subject || 'No subject';
const agentName = data.ticket?.assignee?.name || 'Unassigned';
// Threshold: alert on scores 1-2 out of 5
const LOW_SCORE_THRESHOLD = 2;
const isLowScore = score <= LOW_SCORE_THRESHOLD;
return [{
json: {
score,
ticketId,
customerName,
customerEmail,
subject,
agentName,
isLowScore,
gorgiasUrl: `https://your-store.gorgias.com/app/ticket/${ticketId}`,
}
}];Replace your-store with your Gorgias subdomain.
Step 4: Filter on low scores
Add an IF node after the Code node:
- Condition:
{{ $json.isLowScore }}equalstrue
The True branch continues to Slack. The False branch can either stop or log high scores to a Google Sheet for trend tracking.
Connect the False branch to a Google Sheets node that logs every survey response with timestamp, score, ticket ID, and agent. This builds your CSAT dataset for weekly reporting without any extra cost.
Step 5: Fetch ticket details for a richer alert
Add an HTTP Request node to get the full ticket details:
- Method: GET
- URL:
https://your-store.gorgias.com/api/tickets/{{ $json.ticketId }} - Authentication: Basic Auth (Gorgias email + API key)
This gives you the full message history, tags, and metadata to include in the Slack alert.
Step 6: Post the Slack alert
Add a Slack node (or HTTP Request to a webhook):
- Channel:
#csat-alerts - Message type: Block Kit
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Low CSAT Score: {{ $('Code').item.json.score }}/5"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Customer:* {{ $('Code').item.json.customerName }}"
},
{
"type": "mrkdwn",
"text": "*Email:* {{ $('Code').item.json.customerEmail }}"
},
{
"type": "mrkdwn",
"text": "*Subject:* {{ $('Code').item.json.subject }}"
},
{
"type": "mrkdwn",
"text": "*Assigned to:* {{ $('Code').item.json.agentName }}"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Last customer message:*\n> {{ $json.messages[0].body_text | truncate: 200 }}"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Open Ticket"
},
"url": "{{ $('Code').item.json.gorgiasUrl }}"
}
]
}
]
}If the customer's last message contains newlines, they can break the JSON block. Use a Code node to replace newlines with \n or truncate the message to a single line before injecting it into the Slack payload.
Step 7: Tag the ticket in Gorgias
Add a final HTTP Request node to tag the ticket for tracking:
- Method: PUT
- URL:
https://your-store.gorgias.com/api/tickets/{{ $('Code').item.json.ticketId }} - Authentication: Basic Auth
- Body:
{
"tags": [{ "name": "csat-low" }]
}This tags the ticket in Gorgias so agents can filter to all low-CSAT tickets in a dedicated View.
Step 8: Activate and test
- Set the workflow to Active
- Close a test ticket in Gorgias and submit a low satisfaction rating
- Verify the Slack alert arrives with the correct details
- Check that the
csat-lowtag is applied to the ticket - Add Retry On Fail on all HTTP Request nodes for resilience
Cost
- n8n Cloud: ~5 node executions per survey response. 200 survey responses/month = ~1,000 executions — well within the free tier.
- Self-hosted: Free.
Need help implementing this?
We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.