Alert Slack on low CSAT scores from Gorgias using n8n
Install this workflow
Download the n8n workflow JSON and import it into your n8n instance.
csat-slack-alert.n8n.jsonPrerequisites
- 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
Why n8n?
n8n gives you richer alerts than Gorgias Rules alone. You can enrich each low-CSAT alert with ticket history, agent name, response time data, and the customer's last message — context that helps your team understand what went wrong before they even open the ticket. You can also route different score ranges to different Slack channels (e.g., scores of 1 to #csat-critical, scores of 2 to #csat-alerts).
Self-hosted n8n is completely free with unlimited executions. n8n Cloud starts at $24/mo for 2,500 executions. CSAT survey volume is typically low (10-50 responses/month for most teams), so this workflow barely registers on your execution quota.
How it works
- Gorgias HTTP integration sends a webhook to n8n every time a satisfaction survey is rated
- Code node extracts the score, ticket ID, customer name, and agent from the webhook payload
- IF node filters on your threshold (default: scores 1-2 out of 5)
- HTTP Request node fetches full ticket details from the Gorgias API for richer context
- Slack node posts a Block Kit alert with score, customer, agent, last message, and a direct link
- HTTP Request node tags the ticket
csat-lowin Gorgias for tracking
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
Troubleshooting
Common questions
How many survey responses should I expect per month?
CSAT response rates typically range from 5-15% of closed tickets. If you close 500 tickets/month, expect 25-75 survey responses. Of those, 10-20% are usually low scores (1-2), so you'd get 3-15 Slack alerts per month — very manageable.
Can I route different scores to different Slack channels?
Yes. Replace the single IF node with a Switch node that routes score 1 to #csat-critical, score 2 to #csat-alerts, and scores 3-5 to a log (or ignore). Each branch connects to its own Slack node with the appropriate channel.
Should I tag the ticket before or after posting to Slack?
After. If the Slack post fails, you still want the tag applied for tracking. Add the tag step last with Retry On Fail enabled so it doesn't block the alert. If you need guaranteed tagging regardless of Slack status, use n8n's Error Workflow to apply the tag on failure.
Cost
- n8n Cloud: ~5 node executions per survey response. 200 survey responses/month = ~1,000 executions — well within the free tier.
- Self-hosted: Free.
Looking to scale your AI operations?
We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.