# Rank cancelled Direct Debit mandates by revenue at risk

> Every weekday, find the Direct Debits that died overnight, work out what each lost payer was worth, and post a ranked win-back list to Slack.

- Workflow type: agent
- Services: GoCardless, Slack Bot, Google Sheets
- Categories: Finance, Operations
- Published: 2026-08-14

## What it does

- Checks every weekday morning for Direct Debit mandates that were cancelled or expired in the last 24 hours
- Looks up each lost payer and their full payment history to estimate the annual revenue you are about to lose
- Posts a single ranked digest to your finance channel, separating high value payers worth a personal call from small ones that only need a re-signup link
- Adds one row per cancellation to a churn tracker spreadsheet so you can watch the trend build over time
- Stays completely silent on days when nothing was cancelled

## What you'll need

- A GoCardless account collecting Direct Debit payments
- A Slack workspace and the channel where your finance updates go
- A Google Sheets spreadsheet to use as the churn tracker, with a header row ready
- A rough idea of what counts as a high value payer for your business, so the digest can split the list sensibly

## Prompt

Every weekday at 8am, check GoCardless for Direct Debit mandates that stopped being collectable in the last 24 hours, work out how much recurring revenue each lost payer represents, and post one prioritized digest to my finance Slack channel.

To find the cancellations, use GoCardless List Events filtered to the mandates resource type with the cancelled and expired actions, and a created_at[gt] filter set to 24 hours before the run. Use the events rather than only listing mandates by status, because a mandate's own created_at is the date it was originally set up, not the date it died, so a date filter on List Mandates would miss a mandate that was signed three years ago and cancelled last night. The event carries the cancellation timestamp and the underlying reason or cause, which I want in the digest. For each mandate id that comes back, call Get Mandate to confirm it is genuinely still cancelled or expired right now and to read the linked customer id. If the events lookup returns nothing at all, cross-check with List Mandates filtered by status cancelled and status expired before concluding it was a quiet day.

For each dead mandate, pull the payer with Get Customer, and their payment history with List Payments filtered to that customer id. Look at the payments that actually succeeded, not the failed or pending ones, since I want to know what this person has really paid me rather than what was attempted.

All GoCardless amounts are integers in the smallest currency unit, so pence or cents. Divide by 100 before showing any money figure in the digest or writing it to the sheet, and keep the currency code alongside it. Do not mix currencies into a single total; if payers span more than one currency, rank within each currency and label the amounts clearly.

Estimate the annual value at risk for each payer from their historical collection amount and cadence. Work out the typical successful collection amount and how regularly the collections came in, for example roughly monthly, quarterly, or annually, then project that forward across a year. A payer on 200 a month is a far bigger loss than a payer on 200 a year, so the cadence matters as much as the amount. Where the history is too thin or too irregular to project honestly, say so instead of inventing a confident number, and fall back to the total they have paid to date as the context figure. Also note how long they had been paying, since a long-standing payer walking away is worth flagging differently from someone who cancelled after one collection.

Rank the cancellations by estimated annual value at risk, highest first. Split them into the high value payers who justify a personal call from someone on my team, and the smaller ones where the sensible next step is just sending a re-signup link. Use the size of the projected annual loss to make that split, and mention the boundary you applied so I can argue with it.

Post the result as a single message to my finance channel using the Slack Bot Send a Message action. One message, not one per payer. Open with the headline number, being how many payers were lost and the total annual value at risk, then list each lost payer in ranked order with their name, the cancellation reason, the estimated annual value at risk, how long they had been paying, and a specific recommended next step. Group the personal-call payers above the re-signup-link ones so the expensive problems are read first.

Then append one row per cancelled mandate to my churn tracker spreadsheet using the Google Sheets Append Values action, so the trend builds up over time. Each row should carry the cancellation date, customer name, customer email, mandate id, cancellation reason, total paid to date, estimated annual value at risk, currency, and the recommended next step. Match the column order already in the sheet.

Two hard rules. Never reinstate a mandate and never create a new one, even though the Reinstate Mandate and Create Mandate actions exist. A customer who cancelled at their bank has to authorise a fresh Direct Debit themselves, so anything I do from this side will not hold. This workflow reports and recommends only, and every action it takes on GoCardless must be read-only. Second, if there were no cancellations in the window, stay quiet: do not post an empty digest, do not post a nothing-to-report message, and do not write anything to the spreadsheet.

## How to customize

- Change the timing, for example run it every morning including weekends, or twice a day if cancellations are costly to miss
- Move the threshold that separates a payer worth a personal call from one that only needs a re-signup link
- Point the digest at a different channel, or send it as a direct message instead
- Add your own columns to the churn tracker, such as sector, account owner, or whether the payer was won back

## FAQ

### Will this cancel or restart anyone's Direct Debit?

No. This workflow only reads your payment data and reports on it. It never cancels, restarts, or sets up a Direct Debit. That is deliberate: when someone cancels at their bank, they have to authorise a fresh Direct Debit themselves, so anything automatic on your side would not stick anyway.

### What happens on a day with no cancellations?

Nothing gets posted. The workflow checks, finds no cancellations, and stays quiet, so the channel only lights up when there is something real to act on.

### How does it work out what a lost payer was worth?

It looks at what that customer has actually paid you in the past, how much each collection was, and how often the payments came in. From that it projects a yearly figure, so a monthly payer and an annual payer are compared fairly rather than by their last payment alone.

### Why does a mandate expire rather than get cancelled?

Both mean the same thing for your revenue: no more payments can be collected. A mandate can lapse on its own after a long period with no activity, or be cancelled by the customer or their bank. This workflow treats both as lost payers and includes them in the digest.

### Can I use this if my team is on Microsoft Teams instead of Slack?

The prompt is written for Slack, but you can ask for the digest to go somewhere else, such as Teams or an email to your finance address. The reporting and ranking logic stays exactly the same.

Use this prompt in General Input: https://www.generalinput.com/prompts/rank-cancelled-direct-debit-mandates-by-revenue-at-risk