Alert your team in Slack when a VIP customer opens a Gorgias ticket using n8n

medium complexityCost: $0-24/moRecommended

Prerequisites

Prerequisites
  • n8n instance (cloud or self-hosted)
  • Gorgias account with REST API access and API credentials
  • Slack app with Bot Token and chat:write scope
  • A Slack channel for VIP escalation alerts (e.g., #support-vip)
  • A way to identify VIP customers: a customer tag in Gorgias, or a LTV threshold you can check via API

Overview

This workflow receives all new Gorgias tickets via webhook, looks up the customer's profile and order history to determine if they qualify as a VIP, and posts a rich Slack alert with full context if they do. The n8n approach is more powerful than Gorgias native Rules because you can dynamically calculate VIP status — pulling live order data rather than relying on a pre-applied tag.

Step 1: Create the Webhook trigger

Add a Webhook node:

  • HTTP Method: POST
  • Path: gorgias-vip-alert

Copy the URL and continue.

Step 2: Register the webhook in Gorgias

Go to Settings → Integrations → HTTPAdd HTTP integration:

  • Name: n8n VIP Alert
  • URL: Your n8n webhook URL
  • Events: Ticket created
  • Content-Type: application/json

Step 3: Extract ticket and customer data

Add a Code node to pull the essentials:

const ticket = $input.first().json;
return [{
  json: {
    ticketId: ticket.id,
    subject: ticket.subject || '(no subject)',
    body: ticket.messages?.[0]?.body_text?.slice(0, 400) || '',
    customerId: ticket.requester?.id,
    customerEmail: ticket.requester?.email,
    customerName: ticket.requester?.name || ticket.requester?.email,
    existingTags: (ticket.requester?.meta?.tags || []).map(t => t.name),
  }
}];

Step 4: Check for a VIP tag

Add an IF node to fast-path customers already tagged as vip in Gorgias:

  • Condition: {{ $json.existingTags.includes('vip') }} equals true

  • True branch: Skip the LTV lookup — go straight to the Slack alert (Step 6)

  • False branch: Fetch order history to calculate LTV (Step 5)

Step 5: Look up customer order history (LTV check)

On the False branch, add an HTTP Request node to pull the customer's Gorgias data:

  • Method: GET
  • URL: https://your-store.gorgias.com/api/customers/{{ $json.customerId }}
  • Authentication: Basic Auth (Gorgias email + API key)

Then add a Code node to evaluate VIP status:

const customer = $input.first().json;
const stats = customer.meta || {};
 
// Adjust thresholds to match your business
const totalSpent = parseFloat(stats.shopify_total_spent || '0');
const orderCount = parseInt(stats.shopify_orders_count || '0', 10);
 
const isVip = totalSpent >= 500 || orderCount >= 5;
 
return [{
  json: {
    isVip,
    totalSpent,
    orderCount,
    customerEmail: customer.email,
    customerName: customer.name || customer.email,
  }
}];

Add an IF node: {{ $json.isVip }} equals true. Only the True branch continues to the Slack alert.

Shopify data in Gorgias customer profiles

If you've connected Gorgias to Shopify, the customer object includes Shopify-sourced fields like shopify_total_spent and shopify_orders_count in the meta object. Field names may vary — inspect a real customer API response to confirm the exact keys in your account.

Step 6: Post the Slack alert

Add a Slack node:

  • Resource: Message
  • Operation: Send a Message
  • Channel: #support-vip
  • Message Type: Block Kit
{
  "blocks": [
    {
      "type": "header",
      "text": {
        "type": "plain_text",
        "text": "🚨 VIP Customer — New Support Ticket"
      }
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Customer*\n{{ $('Code').item.json.customerName }}"
        },
        {
          "type": "mrkdwn",
          "text": "*Lifetime Value*\n${{ $('LTV Check').item.json.totalSpent.toFixed(0) }}"
        },
        {
          "type": "mrkdwn",
          "text": "*Total Orders*\n{{ $('LTV Check').item.json.orderCount }}"
        },
        {
          "type": "mrkdwn",
          "text": "*Subject*\n{{ $('Code').item.json.subject }}"
        }
      ]
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Message preview*\n{{ $('Code').item.json.body }}"
      }
    },
    {
      "type": "actions",
      "elements": [
        {
          "type": "button",
          "text": { "type": "plain_text", "text": "Open in Gorgias" },
          "url": "https://your-store.gorgias.com/app/ticket/{{ $('Code').item.json.ticketId }}",
          "style": "primary"
        }
      ]
    }
  ]
}

Step 7: Apply a VIP tag to the ticket

After posting to Slack, apply a tag so the ticket is visible in a VIP view:

  • Method: PUT
  • URL: https://your-store.gorgias.com/api/tickets/{{ $('Code').item.json.ticketId }}
  • Body: { "tags": [{ "name": "vip-escalation" }] }

Step 8: Activate and test

  1. Create a test customer in Gorgias with a vip tag
  2. Submit a support ticket from that customer
  3. Verify the Slack alert appears with correct data
  4. Toggle the workflow to Active

Cost

  • n8n Cloud: ~8 node executions per VIP ticket. Typical VIP ticket volume is low, so this stays well within any plan 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.