Daily Loop Returns digest in Slack with reason trends
Every weekday morning your team gets a short Slack summary of yesterday's returns: top reasons, product spikes, and refund versus exchange totals.
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.
Example output
What does this prompt do?
- Collects every return created in your Loop account over the last 24 hours and groups them by reason and by product.
- Calls out the top three return reasons and flags any product spiking against its own recent two week average.
- Totals refund value and exchange value separately, in readable currency, so you can see whether your exchange first flow is holding.
- Posts one short Slack message your team can read without expanding, and says plainly when it was a quiet day instead of padding the summary.
What do I need to use this?
- A Loop Returns account you can connect, with permission to read returns
- A Slack workspace and a channel where the digest should land
- Ideally a couple of weeks of return history in Loop, so the spike comparison has something to measure against
How can I customize it?
- Change the timing. It runs weekday mornings at 8am by default, but daily or weekly works just as well.
- Pick the channel it posts to, and choose who gets tagged when a product spikes.
- Tune how sensitive the spike alert is, and the minimum number of returns before a product is worth flagging.
FAQs
What happens on a day with no returns?
Will this work if we sell in more than one currency?
How does it decide that a product is spiking?
Can we post to more than one channel?
Do we need a developer to set this up?
Related templates
When someone leaves, we check which shared passwords they used in their final months and post a ranked rotation list to your security channel.
Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.
Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.
Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.
Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.
When you merge a fix in GitHub, this agent checks the matching dead-letter queue, replays the failed messages, and reports back on the pull request and in Slack.
Stop guessing why returns are climbing.
Get a short, honest returns digest in Slack every weekday morning, covering the reasons and the products that actually moved.