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

Why n8n?

n8n lets you dynamically determine VIP status at ticket time instead of relying on pre-applied customer tags. The workflow looks up the customer's Shopify data (total spend, order count) via the Gorgias API and calculates VIP status on the fly. This means you never miss a VIP who recently crossed your threshold — no manual re-tagging required.

Self-hosted n8n is completely free with unlimited executions. n8n Cloud starts at $24/mo. VIP ticket volume is typically low (5-15% of total tickets), so this workflow is lightweight on executions.

How it works

  • Gorgias HTTP integration sends a webhook to n8n when a new ticket is created
  • Code node extracts ticket details and checks for an existing vip customer tag (fast path)
  • IF node routes tagged VIPs straight to the Slack alert, untagged customers to the LTV check
  • HTTP Request node fetches customer profile from the Gorgias API to get Shopify metadata (total spend, order count)
  • Code node evaluates VIP criteria: total spend >= $500 OR order count >= 5
  • Slack node posts a Block Kit alert with customer name, LTV, order count, ticket subject, and a direct link
  • HTTP Request node tags the ticket vip-escalation in Gorgias

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

Troubleshooting

Common questions

Where does the Shopify data come from in the Gorgias API?

If you've connected Gorgias to Shopify, the customer profile includes Shopify-sourced fields in the meta object: shopify_total_spent and shopify_orders_count. These are synced automatically. Inspect a real customer API response to confirm the exact field names — they may differ based on your Shopify integration version.

What if a customer has both a VIP tag and low LTV?

The fast-path IF node skips the LTV check for tagged customers. If you want to verify that tagged VIPs still meet your spend threshold, remove the fast path and always run the LTV check. This catches cases where a VIP tag was applied manually to someone who doesn't meet the financial criteria.

How do I adjust the VIP threshold?

Change the constants in the LTV Check Code node: totalSpent >= 500 and orderCount >= 5. Common thresholds vary by AOV — a luxury brand might set $2,000+, while a consumables brand might use $200+ or 10+ orders. Start with your median customer LTV as the lower bound.

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.

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.