Skip to content

On a schedule

Close Gorgias tickets the customer never answered

Tickets where you replied last and heard nothing for a week are closed overnight.

Runs
On a schedule
Apps
Gorgias
AI
Not needed
Access
read+write

Send this to your assistant

Create a ClickRuntime automation: every night, close Gorgias tickets where our team sent the last message and the customer hasn't replied in 7 days.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

In a Gorgias helpdesk, a ticket often reaches a state where the support agent has replied and the customer has gone silent. The agent asked for an order number or a photo of the damaged item, and nothing came back. Those tickets stay open for weeks, inflating the open count, dragging down reports on response time and making the queue look bigger than it is for the agent who opens it on Monday.

On a schedule, open tickets are listed and the last message on each is checked. If the last message was sent by your team and is at least 7 days old, the ticket is set to closed. A customer who replies later reopens the conversation as usual, so nothing is lost.

It is meant for e-commerce support teams who want a queue that shows real work, not forgotten threads.

What you get out of it

  • The open queue shows real work

    Agents see tickets that need an answer, not a pile that includes dozens of abandoned conversations. Starting a shift is clearer and prioritizing is faster. That makes starting a shift faster and prioritizing simpler for everyone.

  • Cleaner support metrics

    Open ticket counts, backlog graphs and average resolution times stop being distorted by threads nobody will ever continue. Reports you share with leadership match reality. Leadership reports then reflect the work your team actually does.

  • Less manual housekeeping

    Someone on the team used to sweep the old tickets on a Friday. That sweep happens on its own, and the person gets those hours back for customer conversations. Closing is also consistent, with no thread left open because nobody noticed it.

  • Customers still get a way back

    Closing is not deleting. A late reply from the customer reopens the ticket with its full history, so closing a quiet thread costs nothing. The history stays attached either way, and the customer loses nothing.

  • A consistent rule for everyone

    The seven-day policy is applied the same way to every ticket, instead of depending on which agent noticed which thread. That is easier to explain to customers. If a customer asks why a ticket closed, there is a simple policy to point to.

How it works

What happens, step by step

  1. Every night, ClickRuntime goes through your open Gorgias tickets.

  2. It keeps the ones where your team sent the last message and the customer hasn't replied in seven days.

  3. Each of those tickets is closed, and the total closed is recorded.

Before it runs live

  • Connect Gorgias

What you get

RunsOn a schedule
Close Gorgias tickets the customer never answeredtoday, 9:00Succeeded
Gorgias · Closed ticketsClosed 12 tickets waiting on the customer for 7+ days

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Gorgias steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
auto_close_stale_tickets.pyexample
from datetime import datetime, timedelta, timezone
from clickruntime import on_trigger, credentials, http

API = "https://northwind.gorgias.com/api"

@on_trigger
def run(event):
    auth = (credentials.secret("GORGIAS_EMAIL"), credentials.secret("GORGIAS_API_KEY"))
    cutoff = (datetime.now(timezone.utc) - timedelta(days=7)).isoformat()
    tickets = http.get(f"{API}/tickets", auth=auth, params={"limit": 100, "order_by": "updated_datetime:asc"}).json()["data"]
    closed = 0
    for t in tickets:
        last = t.get("last_message_datetime") or ""
        customer_last = t.get("last_received_message_datetime") or ""
        team_sent_last = last and last > customer_last
        if t["status"] == "open" and team_sent_last and last < cutoff:
            http.put(f"{API}/tickets/{t['id']}", auth=auth, json={"status": "closed"}).raise_for_status()
            closed += 1
    return {"closed": closed}

FAQ

Common questions

Does it close tickets where the customer replied last?
No. It only closes tickets whose last message came from your team. If the customer wrote last, the ticket is waiting on you and stays open, no matter how old it is. That protects customers who are still waiting for an answer from your team.
Can I send a closing message to the customer first?
That is possible as a specific change, for example a note saying the ticket will be closed due to no reply. Ask your AI assistant to add the step and approve the new version before it runs.
Does it touch tickets in Snoozed or Spam status?
It works from the list of open tickets, so tickets with other statuses are left alone. If you use a tag such as waiting-on-customer, the check can be narrowed to tickets carrying it. That way a tag such as waiting-on-customer decides what gets closed, and nothing else.
What permissions does it need?
read+write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Close Gorgias tickets the customer never answered” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.