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

Auto-fix your calendar when a flight slips, and flag what's at risk

When your flight moves, your calendar times get corrected automatically and you get a Slack note naming the meetings you're about to miss.

Google Calendar
AviationStack
Slack
Agentic Task
Trace phishing emails to the sending IP and report abuse

Every 15 minutes, forwarded phishing reports get traced back to the server that really sent them, with a verdict in Slack and the worst senders reported.

AbuseIPDB
Gmail
Slack
Agentic Task
Weekly Amazon S3 bucket security audit posted to Slack

Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.

Amazon S3
Slack Bot
Google Sheets
Agentic Task
Turn procurement portal tenders into CRM deals each morning

Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.

Anchor Browser
Google Sheets
HubSpot
+1
Agentic Task
Draft polite follow-ups for emails that never got a reply

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.

Aurinko
Google Sheets
Slack Bot
Agentic Task
Turn each week's football fixtures into a venue staffing plan

Every Monday, rank the week's matches by expected demand, put the big ones on your venue calendar, and post a rota-ready summary to Slack.

API-Sports
Google Calendar
Slack
Agentic Task

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.