Add Shopify order context to new Freshdesk tickets
Every 15 minutes, look up the customer's recent Shopify orders and drop a private note on new Freshdesk tickets so agents skip the alt-tab.
Build me an agent workflow that gives my Freshdesk support agents instant Shopify order context on every new ecommerce ticket, so they don't have to alt-tab into the Shopify admin to look up a customer's order history.
Trigger: cron, every 15 minutes.
On each run, do the following:
1. Use Freshdesk List Tickets to fetch tickets created in the last 30 minutes. Filter to tickets whose source is email or portal, and skip any ticket that already has the tag "shopify-context".
2. For each remaining ticket, take the requester's email address and call Shopify Search Customers on that email.
3. If no matching Shopify customer is found, use Freshdesk Add Note to Ticket to post a short private note that says "No matching Shopify customer found for this requester", then use Freshdesk Update Ticket to add the tag "shopify-context" so we don't re-check this ticket next run. Move on to the next ticket.
4. If a Shopify customer is found, use Shopify Get Customer Orders to pull their order history.
5. Compose a concise private agent note using Freshdesk Add Note to Ticket with private=true. The note should contain:
- A one-line header with the customer's lifetime order count and total spend so the agent can gauge VIP status.
- A callout at the very top of the note if the customer has 3 or more refunds in the last 90 days, or an open unfulfilled order older than 7 days. If neither is true, skip the callout.
- A short list of the customer's 5 most recent orders, each line showing order number, order date, financial status, fulfillment status, and total.
- A brief note highlighting any currently open or unfulfilled orders and any refunds in the last 90 days.
Keep the note tight and scannable. This is an internal cheat sheet for the agent, not a customer-facing reply.
6. After the note is posted, use Freshdesk Update Ticket to add the tag "shopify-context" so this ticket is not enriched again.
Guardrails: never post a public reply, only private notes. Never modify ticket status, priority, or assignee. If a Shopify or Freshdesk call errors on a specific ticket, log the error and continue with the remaining tickets. Do not send anything to the customer.
Additional information
What does this prompt do?
- Watches your Freshdesk inbox for brand new tickets from email or the customer portal every 15 minutes.
- Looks the requester up in Shopify by email and pulls their last five orders, lifetime spend, and any open or refunded orders.
- Posts a concise private note on the ticket so your agent sees the customer's order history the moment they open it, no alt-tab into Shopify admin.
- Flags VIPs, unfulfilled orders older than a week, and repeat-refund customers right at the top of the note.
What do I need to use this?
- A Freshdesk account with permission to read tickets, post private notes, and add tags.
- A Shopify store connection with read access to customers and orders.
- Roughly the last 30 minutes of new tickets already flowing into Freshdesk from email or your customer portal.
How can I customize it?
- Change how often it runs (every 5, 15, or 30 minutes) or the window of tickets it looks back over.
- Adjust the VIP rules, the refund threshold, or how many recent orders show up in the note.
- Limit which ticket sources it runs on, for example email only, or add tags and groups to the filter.
Frequently asked questions
Will my customer see the Shopify order history?
What happens when the ticket requester is not a Shopify customer?
Will it enrich the same ticket over and over?
Can I match customers on something other than email?
Does this work on the Freshdesk free plan?
Related templates
Stop making support agents alt-tab into Shopify.
Connect Freshdesk and Shopify once, and every new ecommerce ticket lands with the customer's order history already attached.