Alert Slack and open a HubSpot dunning task on failed Stripe charges

When Stripe reports a charge.failed event, post a plain English alert in Slack and open a HubSpot follow-up task for the deal owner.

Agentic Task
StripeSlack BotHubSpotFinanceOperationsNotifications & AlertsData Sync
PromptCreate

Build me an agent workflow that turns failed Stripe charges into a structured Slack alert and a HubSpot follow up task so dunning actually gets owned.

Trigger: an incoming Stripe webhook on the charge.failed event. Configure the workflow URL as a Stripe webhook endpoint and subscribe only to charge.failed.

When the webhook fires, the agent should:

1. Call Stripe Retrieve Charge with the charge id from the event to get the amount, currency, failure_code, failure_message, outcome reason, and customer id.

2. Call Stripe Retrieve Customer to pull the customer email, name, and any metadata we use to identify accounts.

3. Call Stripe List Charges filtered to that customer for the last 30 days so the agent can see whether this is a one off or part of a repeat pattern, and whether the customer has any successful charges on file.

4. Apply noise control before alerting. Skip the alert if the amount is under a configurable low value threshold (default $20) AND there have been no other failures from this customer in the last 24 hours. Otherwise continue.

5. Post a message to a configurable Slack channel (default #billing-alerts) using Slack Bot Send a Message. The message should be plain English, not a raw Stripe payload. Include: customer name and email, amount and currency, a human readable decline reason translated from failure_code and failure_message (for example, insufficient funds, expired card, do not honor), the count of failures in the last 30 days, the date of the last successful charge, and a link to the charge in the Stripe dashboard.

6. If the charge is high value (default amount over $250) OR the customer has 2 or more failed charges in the last 30 days, also call HubSpot Create Task. The task subject should read "Dunning follow up: <customer name> failed payment". Set due date to tomorrow, priority HIGH, and put the failure reason, amount, customer email, and Stripe charge link in the task body. Associate the task to the customer's HubSpot contact and open deal when they exist, and assign it to the deal owner. If there is no deal owner, fall back to a configurable default owner.

Make these inputs configurable at setup: the Slack channel, the low value threshold for noise suppression, the high value threshold for opening a HubSpot task, the repeat failure window and count, and the fallback HubSpot task owner.

Do not retry the workflow on transient Stripe webhook redeliveries for the same charge id. Treat each unique charge id as a single event.

What does this prompt do?

  • Listens for Stripe charge.failed webhooks and pulls the charge, customer, and recent payment history.
  • Posts a structured alert to a configurable Slack billing channel that explains the decline reason in plain English, not raw Stripe codes.
  • Opens a HubSpot task for the deal owner when the failure is high value or part of a repeat pattern, so dunning gets a real human follow up.
  • Suppresses noise from transient retries on small charges so the channel only pings on signals that actually matter.

What do I need to use this?

  • A Stripe account with permission to configure webhook endpoints and read charges and customers.
  • A connected Slack workspace via Slack Bot, with the bot invited to your billing channel.
  • A HubSpot account with permission to create tasks and read deal owners.
  • A target Slack channel name (for example #billing-alerts) and the thresholds you want for high value vs low value charges.

How can I customize it?

  • Change the Slack channel, message format, and which fields appear in the alert (amount, decline reason, customer email, last successful charge).
  • Tune the noise control rules: dollar threshold for what counts as high value, how many recent failures trigger a HubSpot task, and whether to skip duplicate alerts within a time window.
  • Decide who gets the HubSpot task: the deal owner, the contact owner, or a fallback billing queue when no owner is set.

FAQs

Which Stripe event triggers this workflow?
The Stripe webhook for charge.failed. Stripe sends the event to the workflow URL, the agent retrieves the full charge and customer, and then decides whether to alert and whether to open a HubSpot task.
Will every failed charge ping Slack?
No. The agent applies basic noise control so transient retries on low value charges do not page the channel. You configure the dollar threshold and the repeat failure rule when you set it up.
How does the agent translate Stripe decline codes into plain English?
It reads the failure_code, failure_message, and outcome reason from the retrieved charge, then rewrites them into a human readable sentence (for example, insufficient funds, expired card, or issuer declined) in the Slack post.
Who gets the HubSpot dunning task?
By default the agent looks up the customer in HubSpot, finds the open deal, and assigns the task to the deal owner. You can change the assignment rule during setup, including a fallback owner when no deal is associated.
Can I send to more than one Slack channel?
Yes. You can route by amount or product. For example, send all failures to #billing-alerts and only enterprise tier failures to #revenue-leadership.

Related templates

Build a credential rotation checklist when someone leaves

When someone leaves, we check which shared passwords they used in their final months and post a ranked rotation list to your security channel.

1Password
Rippling
Slack Bot
+1
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
Log Agorapulse social conversations to HubSpot contacts

Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.

Agorapulse
HubSpot
Slack Bot
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
Clean up HubSpot contacts from your Amazon SES suppression list

Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.

Amazon SES
HubSpot
Slack Bot
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

Stop letting failed Stripe charges sit unowned.

Connect Stripe, Slack, and HubSpot once, and Geni alerts the right channel and opens the right task every time a charge fails.