How it works

Follow these 5 simple steps to save closed support tickets to your own database for analysis and reporting

gorgias logo icon

Ticket Updated

App connector: Gorgias • Time to complete: 0 minutes (Auto-configured)
Why this matters: This trigger monitors your Gorgias account for any ticket status changes, ensuring the workflow captures tickets as soon as they're marked as closed.

The trigger automatically checks your Gorgias account every hour for updated tickets. It pulls in all ticket data including status, ID, and closure timestamp without requiring any configuration from you. When a ticket status changes to "closed," this trigger passes the ticket information to the next step for processing. The hourly polling ensures you won't miss any closed tickets while keeping API usage reasonable.

Filter

App connector: Filter • Time to complete: 0 minutes (Auto-configured)
Why this matters: This step ensures only closed tickets proceed through the workflow, preventing unnecessary processing of tickets that are still open or in progress.

The filter examines each ticket's status and only allows tickets with "closed" status to continue. It automatically compares the ticket status from step 1 against the "closed" value, blocking any tickets that are still open, pending, or solved. This filtering prevents your database from getting cluttered with incomplete ticket data. No configuration is needed as the filter condition is pre-set to look for closed tickets.

Get List of Ticket's Messages

App connector: Gorgias • Time to complete: 0 minutes (Auto-configured)
Why this matters: This step retrieves all conversation messages within each closed ticket, giving you complete context about customer interactions and resolution details.

For each closed ticket that passes the filter, this step automatically fetches all associated messages using the ticket ID. It connects to Gorgias and pulls the full conversation thread including customer messages, agent responses, and internal notes. The retrieved message data includes the actual text content and metadata that gets passed to the database creation step. This ensures your database contains not just ticket information but the complete conversation history.

Loop

App connector: Loop • Time to complete: 0 minutes (Auto-configured)
Why this matters: Since each ticket can contain multiple messages, this loop processes each message individually to create separate database entries for comprehensive analysis.

The loop takes the list of messages from step 3 and processes them one by one. For each message in the conversation thread, it prepares the data for database insertion including the ticket ID, message content, and closure timestamp. This allows you to analyze conversation patterns, response quality, and resolution details at the message level rather than just ticket level. The loop automatically handles tickets with varying numbers of messages.

database icon

Create Record

App connector: Data • Time to complete: 2 minutes
Why this matters: This final step saves each message to your database with structured fields, making your support data searchable and ready for reporting or analysis.

For each message processed by the loop, this step creates a new database record with three key fields: Support Ticket ID (the original ticket number), Message (the actual conversation text), and Closed Date (formatted timestamp of when the ticket was closed). You'll need to specify your database table name - the default is "Closed Gorgias Support Tickets" but you can customize this to match your naming conventions. The step automatically formats the closure date for proper database storage and strips unnecessary formatting from message text.

*Required: These following must be installed before using this workflow.

Make it your own

Customize this workflow even further:

Set custom filters
Add additional filter conditions to capture specific ticket types, such as only tickets from certain channels, specific customer segments, or tickets that took longer than a certain time to resolve.
Connect to analytics tools
Extend the workflow to send ticket data to tools like Google Analytics, Mixpanel, or your business intelligence platform for deeper customer support performance analysis.
Store data in multiple formats
Branch the workflow to simultaneously save ticket data to different destinations like Google Sheets for quick viewing, your CRM for customer history, and a data warehouse for long-term analysis.
Deploy AI for sentiment analysis
Add an AI step that analyzes the message content for customer sentiment, satisfaction indicators, or common issue themes before saving to your database.

Frequently asked questions

What happens if I have a large backlog of closed tickets?
The workflow processes tickets updated within the polling timeframe (hourly by default). For historical tickets, you'll want to manually run the workflow using Time Travel to capture older tickets.
Can I modify which message fields get saved to the database?
Yes, you can customize the database columns in step 5 to include additional message fields like sender type (customer vs agent), timestamp of individual messages, or message channel (email, chat, etc.) by modifying the field mapping.
Will this capture internal notes and private messages between agents?
The workflow retrieves all messages associated with a ticket, including internal notes. If you only want customer-facing messages, you'll need to add a filter step that checks the message type or sender before creating database records.
What is a template?
Templates are pre-made workflows by our team of experts. Instead of building a workflow from scratch, these have all the steps needed to complete the task.
Can I personalize a template?
Yes! Every step can be customized to meet your exact requirements. Additionally, you can even add more steps and make it more sophisticated.
Are templates free?
Yes! Our entire library containing hundreds of templates are free to use and customize to your exact needs.

Ready to save closed support tickets to your own database for analysis and reporting?

Join thousands who've automated their work and saved an average of 3.5 hours every week.

Start with this template — It's free
7-day free trial • 6 min setup • Cancel anytime