Log failed Stripe charges and trigger 48-hour finance follow-ups

Capture every failed Stripe charge in a Google Sheet, open a 48-hour Asana task, and ping the finance team in Slack so dunning never slips.

Deterministic Code
StripeGoogle SheetsAsanaSlackFinanceOperationsNotifications & AlertsData Sync
PromptCreate

Build a code workflow that watches Stripe for failed charges, logs them to a Google Sheet, creates a 48-hour follow-up task in Asana, and posts a rollup alert to the finance team in Slack. It should run on a schedule (every hour) so we never let a failed charge sit unaddressed.

On each run, call Stripe List Charges and filter for charges where status equals failed and created falls inside the lookback window (last hour, with a small overlap to avoid gaps). For each failed charge, capture the charge ID, customer ID and email, amount in dollars, currency, failure_code, failure_message, and the charge timestamp.

Append one row per new failed charge to a Google Sheet I will pick during setup, with columns: timestamp, charge_id, customer_email, customer_id, amount, currency, failure_code, failure_message, asana_task_url, status. Before writing, read existing charge_ids from the sheet (or keep a small state store) and skip any charge that has already been logged so the same failure is never duplicated.

For each new failed charge, create an Asana task in a project I will pick during setup. Title it "Follow up on failed charge: <customer_email> ($<amount>)". Put the failure reason, charge ID, customer ID, and a link to the Stripe dashboard charge page in the task description. Set the due_on date to 48 hours from now and assign it to the finance owner I configure. After creating the task, write its URL back into the asana_task_url column for that row.

After the Sheets and Asana writes finish, post a single rollup message to the finance Slack channel. Include the count of new failed charges, the total dollar amount at risk, a short bulleted list of the top failures (customer, amount, reason), a link to the Google Sheet, and a link to the Asana project view. If there are zero new failures on a given run, do not post anything.

Handle the obvious edge cases: paginate Stripe results if there are more than 100 failed charges in the window, retry transient 5xx errors with backoff, and if Sheets or Asana fails for one charge, keep going on the others and surface the error in the Slack message so finance knows to reconcile manually.

What does this prompt do?

  • Pulls failed Stripe charges from the last run window and writes one row per charge to a Google Sheet (customer, amount, failure reason, charge ID, timestamp).
  • Creates an Asana task for each failed charge with a due date 48 hours out, assigned to the finance owner.
  • Posts a single rollup alert to the finance Slack channel summarizing how many charges failed, total dollars at risk, and links to the sheet and tasks.
  • Skips charges that have already been logged so the same failure is never written or alerted on twice.

What do I need to use this?

  • A Stripe account with a secret API key (sk_live_ for production).
  • A Google account with edit access to the destination Google Sheet.
  • An Asana workspace with a project where finance follow-up tasks should land, and the assignee user.
  • A Slack workspace and the channel ID where the finance team should be notified.

How can I customize it?

  • Change the polling cadence (default hourly) and the due-date offset (default 48 hours) to match your dunning policy.
  • Adjust the columns written to Google Sheets, or split high-value failures into a separate sheet or Slack channel.
  • Swap Asana for Linear, ClickUp, Jira, or Microsoft Planner if your finance team tracks work elsewhere.

FAQs

How does the workflow know a charge failed?
It calls Stripe's List Charges endpoint and filters by status equal to failed within the lookback window. Each failed charge includes the failure_code and failure_message, which get written to the sheet and the Asana task description.
Why 48 hours for the follow-up deadline?
48 hours is a common dunning SLA: long enough for a customer to respond to an email, short enough that the next retry attempt or account suspension still has runway. You can change it to any offset when the workflow is generated.
Will this double-log the same failed charge if the workflow runs again?
No. The workflow keeps track of charge IDs that have already been written to the sheet (either via a hidden ID column or a small state store) and skips them on subsequent runs.
Can I route failures to different owners based on amount or plan?
Yes. Add a branch that inspects the charge amount or customer metadata and assigns the Asana task, or routes the Slack alert, to a different person or channel.
Does this work with Stripe test mode?
Yes. Use a sk_test_ key during setup to validate the flow against test charges, then swap in your sk_live_ key when you are ready to run against production data.

Related templates

Call overdue Xero customers with an AI collections agent

Every weekday at 10am, an AI voice agent phones your most overdue Xero accounts, logs what each customer promised, and reports back to finance in Slack.

LiveKit
Xero
Deepgram
+2
Agentic Task
Local listing health board for every location you manage

See every Google Maps listing you manage on one screen, ranked worst first, with an audit button that writes the fix list for you.

Local Business Data
Google Sheets
App
Win back LiveChat visitors whose chats went unanswered

Every couple of hours we find the chats your team never answered, email those visitors a real reply, and hand the sensitive ones to a support lead.

LiveChat
Gmail
Slack
Agentic Task
Let support send one-off Loops emails without an engineer

Your team picks a template, finds the customer, checks they are safe to email, then sends it, with every send logged where the whole team can see it.

Loops.so
Stripe
Google Sheets
App
Stop cold emails to anyone with a live deal in Pipedrive

Every night at 2am, pull the contacts on your open and won deals and block them from your cold outreach before the next send goes out.

Mailshake
Pipedrive
Google Sheets
Deterministic Code
Customer lifecycle inspector for Loops, Stripe and PostHog

Open one screen each morning to see a paying customer's billing, product activity and email history, then send the right next email without leaving it.

Loops.so
Stripe
PostHog
App

Stop letting failed Stripe charges fall through the cracks.

Connect Stripe, Google Sheets, Asana, and Slack once, and Geni logs every failure, opens a 48-hour task, and alerts finance automatically.