Daily Loop Returns digest in Slack with reason trends

By General Input

Every weekday morning your team gets a short Slack summary of yesterday's returns: top reasons, product spikes, and refund versus exchange totals.

Integrations

  • Loop Returns
  • Slack Bot

Type

Agentic Task

Categories

  • Operations
  • Customer Support

Every weekday at 8am in my local timezone, pull the last 24 hours of returns from Loop Returns and post a short digest to Slack. Use a cron trigger, not a poll trigger.

Pull the data with the Loop Returns Detailed Returns List operation. Do not pass from or to, because that operation already defaults to the previous 24 hours, which matches this schedule exactly. Pass paginate=true and follow nextPageUrl until it comes back null so that busy days are not silently truncated.

Then build a baseline. Call Detailed Returns List a second time with from and to covering the 14 days before the digest window, excluding the digest window itself. Use it to work out an average number of returns per day overall, and an average per product. This is what the spike callout is measured against.

Analyze the last 24 hours two ways: group returns by return reason, and group them by product. Report the top three reasons with a count and a share of the day's total. For products, flag anything clearly above its own recent baseline, for example roughly double its daily average, and only when there are at least three returns for that product that day. The minimum count matters because low volume products will otherwise look like they spiked every time they get a single return. If a spiking product's returns cluster on one reason, say which reason.

Handle money carefully. Loop reports monetary values as a MoneySet: an integer amount in minor units plus a currency code. Convert to major units using that currency's own convention before displaying anything, so 61240 USD becomes $612.40, and remember that some currencies such as JPY have no minor units. Total refund value and exchange value separately, never as one blended number, so the team can see whether the exchange first flow is holding. If the day includes more than one currency, report totals per currency rather than adding different currencies together.

Post the result to Slack with the Send a Message operation, to a channel I choose when setting this up. Format it as Slack mrkdwn, which uses *single asterisks* for bold rather than double. Keep it short enough to read in the channel without clicking to expand, roughly 15 lines: a headline count with the baseline for context, the top three reasons, any product spike, and the refund and exchange totals. No wide tables, no per return listings.

When it was a quiet day, say so plainly and stop. A message like "Quiet day: 2 returns, nothing unusual" plus the totals is the correct output. Do not pad a thin day with filler analysis, do not report a top three when only one or two reasons occurred, and skip sections that have nothing in them. If there were zero returns, say that in one line.

If the Loop Returns call fails or returns nothing usable, post a brief note to the same Slack channel saying the digest could not be generated and why, rather than staying silent. Silence looks identical to a quiet day, and the team should be able to tell the difference.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them