How it works

Follow these 5 simple steps to get weekly AI-powered summaries of your closed support tickets

schedule icon

Schedule

App connector: Schedule • Time to complete: 0 minutes (Auto-configured)
Why this matters: Sets the automated timing for when your support ticket analysis runs, ensuring you get consistent weekly insights without manual work.

This step automatically triggers the workflow every Sunday at midnight to analyze the past week's closed tickets. The schedule uses a weekly cron pattern that runs without any intervention from you. No configuration is needed - the timing is pre-set to give you a fresh analysis at the start of each week with data from the previous 7 days.

Query

App connector: Data • Time to complete: 0 minutes (Auto-configured)
Why this matters: Retrieves only the relevant closed tickets from your database based on the specific date range, ensuring your analysis focuses on recent activity rather than old data.

This step automatically queries your "Closed Gorgias Support Tickets" database table to pull tickets that were closed within the last week. The query uses date filtering to select only tickets with a "Closed Date" between one week ago and now. The system handles the date calculations and SQL query execution automatically, gathering all the ticket data that will be analyzed in the next steps.

Format Ticket Messages

App connector: Code • Time to complete: 1 minute
Why this matters: Transforms raw ticket data into a clean format that AI can effectively analyze, extracting just the message content while removing unnecessary database fields.

This step processes the retrieved support tickets and extracts only the message content for AI analysis. The custom JavaScript code maps through each ticket record, pulls out the "Message" field, and converts the collection into a JSON string format. This cleaning process ensures the AI receives structured, readable text data instead of raw database records with metadata that could confuse the analysis.

const Mesa = require('vendor/Mesa.js');

/**
 * A Mesa Script exports a class with a script() method.
 */
module.exports = new class {

  /**
   * Mesa Script
   *
   * @param {object} payload The payload data
   * @param {object} context Additional context about this task
   */
  script = (payload, context) => {
    const vars = context.steps;
    
    // Get support tickets
    let supportTickets = vars.data_1;

    // Pull out the messages
    let supportTicketMessages = supportTickets.map(item => ({ "Message": item.Message }));

    // JSON stringify the messages
    let supportTicketMessagesString = JSON.stringify(supportTicketMessages);

    // We're done, call the next step!
    Mesa.output.next({support_ticket_messages_string: supportTicketMessagesString});
  }
}

Prompt

App connector: AI • Time to complete: 0 minutes (Auto-configured)
Why this matters: Analyzes the ticket content using AI to identify patterns, trends, and customer insights that would take hours to discover manually.

This step sends the formatted ticket messages to an AI system with instructions to analyze the text and identify key trends, customer insights, or concerns. The AI processes all the message content from the week's closed tickets and generates a comprehensive analysis highlighting common issues, customer sentiment patterns, and actionable insights. The temperature is set to 1 for balanced creativity and accuracy in the analysis.

email icon

Send Email

App connector: Email • Time to complete: 1 minute
Why this matters: Delivers the AI-generated insights directly to your inbox, ensuring you see the analysis without having to check multiple systems.

You'll configure the recipient email address where you want to receive your weekly support ticket summary. The email will have "Weekly Summary" as the subject line and contain the AI's analysis of trends and insights from your closed tickets. Enter your email address in the "What is your email address?" field - this is the only configuration required for the entire workflow.

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

Make it your own

Customize this workflow even further:

Set analysis frequency
Change the schedule from weekly to daily, bi-weekly, or monthly to match your support volume and reporting needs.
Add team notifications
Include multiple email recipients or send results to Slack channels so your entire support and product team stays informed about customer feedback trends.
Store insights in databases
Save each week's AI analysis to a database table for long-term trend tracking and to build a searchable history of customer insights.
Create action triggers
Connect the insights to automated follow-up actions, like creating tasks in project management tools when certain issue patterns are detected.

Frequently asked questions

How far back does the weekly analysis look?
The workflow analyzes tickets closed in the past 7 days from when it runs. If you activate it on a Wednesday, your first report will include tickets closed since the previous Wednesday.
What happens if there are no closed tickets in a given week?
The workflow will still run and send you an email, but the AI will indicate that no tickets were found for analysis. This helps confirm the system is working even during quiet periods.
Can I change what specific ticket data gets analyzed beyond just messages?
Yes, you can modify the Custom Code step to include additional fields like ticket priority, resolution time, or customer satisfaction scores by updating the mapping function to extract those database columns.
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 get weekly AI-powered summaries of your closed support tickets?

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 • 5 min setup • Cancel anytime