Flag repeat customer contacts in Gorgias and alert Slack using Claude Cowork
Prerequisites
- Claude Desktop with Cowork enabled
- Gorgias account email, API key, and domain
- Slack Incoming Webhook URL for your support escalation channel
Overview
Claude Cowork lets you schedule a recurring task that checks for repeat contacts — customers who have opened 3 or more tickets in the past 7 days. Claude fetches recent tickets from the Gorgias API, groups them by customer, identifies repeat contacts, tags their latest ticket, and posts a Slack alert. No code to write or maintain — everything runs from the task description.
This is the fastest way to set up repeat contact detection without any engineering work.
Step 1: Create a "repeat-contact" tag in Gorgias
Before setting up the task, create the tag you'll use to flag tickets:
- Go to Settings → Tags in Gorgias
- Click Create tag
- Name it
repeat-contact - Optionally set a color (red or orange works well for attention)
This tag lets you create a Gorgias View that shows all flagged tickets in one place.
Step 2: Set up the Slack Incoming Webhook
- Go to Slack API: Incoming Webhooks
- Create a new webhook for your
#support-escalationschannel - Copy the webhook URL — you'll paste it into the Cowork task
Step 3: Create the Cowork task
Open Claude Desktop → Cowork tab → + New task.
Title: Flag repeat customer contacts and alert Slack
Description:
You are a customer support analyst. Your job is to identify customers who have
contacted support 3 or more times in the past 7 days, tag their latest ticket
in Gorgias, and post an alert to Slack.
Gorgias credentials:
- Domain: your-store
- Auth: HTTP Basic (username: you@company.com, password: YOUR_API_KEY)
Slack webhook: YOUR_SLACK_WEBHOOK_URL
Step 1 — Fetch recent tickets:
GET https://your-store.gorgias.com/api/tickets?limit=100&order_by=created_datetime:desc
Step 2 — Filter to tickets created in the last 7 days:
Compare each ticket's created_datetime to today minus 7 days. Discard older tickets.
Step 3 — Group remaining tickets by customer ID:
For each customer, collect their ticket count, email, name, and list of ticket
subjects with IDs.
Step 4 — Identify repeat contacts:
A repeat contact is any customer with 3 or more tickets in the 7-day window.
Step 5 — For each repeat contact, tag their most recent ticket:
PUT https://your-store.gorgias.com/api/tickets/{latest_ticket_id}
Body: {"tags": [{"name": "repeat-contact"}]}
Step 6 — Post a Slack alert for each repeat contact:
POST to the Slack webhook URL with this format:
{
"text": ":rotating_light: *Repeat Contact Flagged*\n\n*[Customer Name]* ([email]) has opened *[count] tickets* in the last 7 days.\n\nRecent tickets:\n- #[id]: [subject] ([status])\n- #[id]: [subject] ([status])\n...\n\n<https://your-store.gorgias.com/app/ticket/[latest_id]|View in Gorgias>"
}
Step 7 — Print a summary:
List each flagged customer, their ticket count, and the ticket subjects.
If no repeat contacts found, print "No repeat contacts found — all clear."
Important:
- Only tag the MOST RECENT ticket per customer, not all of them
- Skip customers tagged as "high-volume-expected" (agencies, resellers)
- Count only customer-initiated tickets, not auto-replies or system messagesTo change the threshold, just edit the task description. Replace "3 or more times in the past 7 days" with whatever makes sense for your business — Claude reads the description as natural language, so no code changes are needed.
Step 4: Set the schedule
Frequency: Every 2–4 hours during business hours
Repeat contact detection doesn't need to be real-time. A check every few hours catches patterns early enough for your team to act before the customer's frustration compounds.
Cowork tasks only execute while Claude Desktop is open and your machine is awake. If you need overnight or weekend coverage, use the Agent Skill approach with a cron job instead.
Step 5: Run manually and review
Click Run now and watch the output. Claude will:
- Fetch recent tickets from Gorgias
- Group them by customer
- Identify repeat contacts
- Tag their latest ticket
- Post Slack alerts
- Print a summary
A typical run summary looks like:
Fetched 92 tickets from the last 7 days.
Grouped into 67 unique customers.
Found 3 repeat contacts:
Sarah M. (sarah@example.com) — 4 tickets in 7 days
- #14501: Can't log in to my account (open)
- #14487: Still can't access order history (open)
- #14463: Password reset not working (closed)
- #14451: Account access issue (closed)
→ Tagged #14501 as "repeat-contact" ✓
→ Slack alert sent ✓
James K. (james@example.com) — 3 tickets in 7 days
- #14498: Wrong item received again (open)
- #14472: Missing item in my order (closed)
- #14460: Shipping damage (closed)
→ Tagged #14498 as "repeat-contact" ✓
→ Slack alert sent ✓
Maria L. (maria@example.com) — 3 tickets in 7 days
- #14495: Coupon code not working (open)
- #14478: Promo price not applied (closed)
- #14466: Checkout error with discount (closed)
→ Tagged #14495 as "repeat-contact" ✓
→ Slack alert sent ✓
Done. 3 customers flagged, 3 Slack alerts sent.Step 6: Brief your support team
Let your agents know what the repeat-contact tag means and how to use it:
- Create a Gorgias View filtered to the
repeat-contacttag — this becomes your escalation queue - When an agent picks up a flagged ticket, they should read all recent tickets from that customer before replying
- The goal is root cause resolution, not just answering the latest question — look for the underlying pattern
- If the pattern points to a product or process issue, escalate to the relevant team with a summary
When to use this approach
- You want repeat contact detection set up in minutes with no code
- Your ticket volume is moderate (under 200 tickets/day)
- Checks every few hours are fast enough for your workflow
- Your team is already using Claude Desktop
When to switch to another approach
- You need real-time detection the moment a ticket is created → use n8n with a webhook
- You need overnight or weekend coverage without a laptop running → use the Agent Skill with cron
- You want to combine repeat contact detection with other automated actions (auto-assign, priority boost) → use n8n for the orchestration flexibility
Need help implementing this?
We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.