Solutions

On-call & monitoring

A report out of a notification channel.

#stripe-alertsprivate channel3 tool calls

A Stripe events channel is a log nobody reads back. Asked for every cancellation in it, it reads the history in pages, works out the dates and counts in a sandboxed script, and posts the report as a table — with the paging caveat stated rather than hidden, and a CSV attached.

stripe-alerts

Dan6:24 PM

@attest_tag find every message that says a customer unsubscribed and make a report of who unsubscribed and when

attest_tagApp6:28 PM

  • read_channel_history · ~90 days · 3 pages · 118 messages
  • run_js · filter “subscription cancelled” · 9 rows
  • create_artifact · unsubscribes.csv · 9 rows

The unsubscribe report from #stripe-alerts: every subscription-cancelled event in the channel’s history — 9 since June, as a table below: customer, date, price id, the Stripe link, and the thread it was discussed in where there was one.

One caveat: a channel read returns about 40 messages a call, so I paged three times to reach June. Anything older needs more paging, and workspace search would be the cleaner sweep. The CSV is attached — unsubscribes.csv.

google/gemini-flash11.8k in620 out$0.0061Configure

Names, figures, repositories and customers are changed; token counts and cost are illustrative. The ask, and the shape of the answer, are as they were.

How the turn went

Read in pages, counted in the sandbox, delivered as a table and a file.

  1. 01

    It reads the channel in pages

    Forty or so messages a call, three calls to reach the start of the quarter. The number is stated because it bounds the answer.

  2. 02

    The filtering and the dates happen in the sandbox

    The messages go into run_js as JSON; what comes back is the nine rows, parsed and sorted. Nothing is counted in prose.

  3. 03

    The table in the thread, the file beside it

    Ask for it as CSV and create_artifact uploads one to the thread — kept in the console with the channel and the person it was made for.

What it needs

The setup, in the console.

Connection
None for the channel itself. A Stripe connection lets it follow a customer link into Stripe for the current plan; this report did not need it.
Scope
The channel Stripe's Slack integration posts to. Private is fine when the asker is a member.
Artifacts
csv, md, txt, json, yaml or html, up to 1 MB, posted in the thread and listed in the console.

What it will not do

Enforced outside the model.

  • It will not act on a cancellation: the Stripe preset holds writes, and there is no tool to undo one.

  • A Stripe link in an alert is fetched only if the host is on the channel's list; otherwise the proxy refuses it before it leaves.

Try it

Say it in a channel it is in.

The sentence as it was typed. It works in any channel the bot has been invited to that carries the connection above — no command syntax, no form, and follow-ups in the thread need no mention.

@attest_tag find every message that says a customer unsubscribed and make a report of who unsubscribed and when

  • Stripe
  • Slack
  • read_channel_history
  • run_js
  • create_artifact

Bring the channel this would live in.

Sign up, connect the service above in one channel, and type this sentence yourself — or run the same binary on your own infrastructure.

All solutions